Instruction stringclasses 1 value | Input stringlengths 79 33k | Response stringlengths 106 9.29k | __index_level_0__ int64 0 2.83k |
|---|---|---|---|
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT cluster_objects REFERENCE INTO DATA(object).
ASSIGN object->*-value->* TO <con>.
READ TABLE table_list REFERENCE INTO DATA(_table)
WITH KEY fake_table = CONV tabname( object->*-name ).
ASSERT FIELDS object->*-name CONDITION sy-subrc = 0.
DELETE FROM (object->*-name) WHERE (_table->*-where_restriction).
INSERT (object->*-name) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (object->*-name) WHERE (_table->*-where_restriction).
INSERT (object->*-name) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,501 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT cluster_objects REFERENCE INTO DATA(object).
ASSIGN object->*-value->* TO <con>.
DELETE FROM (object->*-name).
INSERT (object->*-name) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (object->*-name).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (object->*-name).
INSERT (object->*-name) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,502 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF table->*-is_initial = abap_false.
MODIFY (table->*-fake_table) FROM TABLE <con>.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
IF table->*-is_initial = abap_false.
MODIFY (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
ENDIF.
ENDLOOP.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
IF table->*-is_initial = abap_false.
MODIFY (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
ENDIF.
ENDLOOP.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,503 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
IF table->*-fake_table NOT IN get_whitelist( ).
CONTINUE.
ENDIF.
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = get_tdc_parameter_name( table->* )
i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (table->*-fake_table).
" If no content is exported in other than the "ECATTDEFAULT"-variant,
" <con> contains the parameter value of the "ECATTDEFAULT"-variant.
" Therefore INSERT-Statement is only executed, when the exported content is not initial.
IF table->*-is_initial = abap_false.
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDIF.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (table->*-fake_table).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,504 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF table->*-is_initial = abap_false.
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
INSERT (table->*-fake_table) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,505 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table_conjunction).
DATA(idx) = sy-tabix.
CREATE DATA:
actual_content TYPE STANDARD TABLE OF (table_conjunction->*-source_table),
exported_content TYPE STANDARD TABLE OF (table_conjunction->*-source_table).
ASSIGN actual_content->* TO <actual_content>.
get_exported_content( EXPORTING table_conjunction = table_conjunction->*
IMPORTING content = exported_content ).
ASSIGN exported_content->* TO <exported_content>.
SELECT * FROM (table_conjunction->*-source_table)
INTO TABLE @<actual_content>
WHERE (table_conjunction->*-where_restriction).
IF compare( lhs = <exported_content> rhs = <actual_content> ) = abap_true.
APPEND idx TO indicies.
ENDIF.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (table_conjunction->*-source_table)
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,506 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD source_table_has_changed.
DATA: actual_content TYPE REF TO data,
exported_content TYPE REF TO data.
FIELD-SYMBOLS: <actual_content> TYPE STANDARD TABLE,
<exported_content> TYPE STANDARD TABLE.
CREATE DATA:
actual_content TYPE STANDARD TABLE OF (table_conjunction-source_table),
exported_content TYPE STANDARD TABLE OF (table_conjunction-source_table).
ASSIGN actual_content->* TO <actual_content>.
get_exported_content( EXPORTING table_conjunction = table_conjunction
IMPORTING content = exported_content ).
ASSIGN exported_content->* TO <exported_content>.
SELECT * FROM (table_conjunction-source_table)
INTO TABLE @<actual_content>
WHERE (table_conjunction-where_restriction).
has_changed = compare( lhs = <exported_content> rhs = <actual_content> ).
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (table_conjunction-source_table)
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,507 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
param_name = create_parameter( _table-fake_table ).
INSERT _table INTO TABLE table_list.
CREATE DATA content TYPE STANDARD TABLE OF (_table-source_table).
ASSIGN content->* TO <con>.
SELECT * FROM (_table-source_table) INTO TABLE @<con>
WHERE (_table-where_restriction).
set_parameter_value( content = <con> name = param_name ).
CATCH cx_sy_dynamic_osql_error INTO DATA(osql_syntax_error).
RAISE EXCEPTION TYPE zcx_export_where_clause_invali
EXPORTING
table = _table-source_table
where_clause = _table-where_restriction
failure_description = osql_syntax_error->msgtext.
CATCH cx_ecatt_tdc_access INTO DATA(ecatt_failure).
zcx_export_error=>wrap_ecatt_failure( ecatt_failure ).
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (_table-source_table) INTO TABLE @<con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,508 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = table->*-fake_table i_variant_name = variant
CHANGING e_param_value = <con> ).
MODIFY (table->*-fake_table) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
MODIFY (table->*-fake_table) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,509 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = table->*-fake_table i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
INSERT (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,510 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = table->*-fake_table i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (table->*-fake_table).
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (table->*-fake_table).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (table->*-fake_table).
INSERT (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,511 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
_table-tdc_parameter_name = create_parameter( _table-fake_table ).
CREATE DATA content TYPE STANDARD TABLE OF (_table-source_table).
ASSIGN content->* TO <con>.
SELECT * FROM (_table-source_table) INTO TABLE @<con>
WHERE (_table-where_restriction).
_table-is_initial = xsdbool( <con> IS INITIAL ).
set_parameter_value( content = <con> name = _table-tdc_parameter_name ).
INSERT _table INTO TABLE table_list.
CATCH cx_sy_dynamic_osql_error INTO DATA(osql_syntax_error).
RAISE EXCEPTION TYPE zcx_export_where_clause_invali
EXPORTING
table = _table-source_table
where_clause = _table-where_restriction
failure_description = osql_syntax_error->msgtext.
CATCH cx_ecatt_tdc_access INTO DATA(ecatt_failure).
zcx_export_error=>wrap_ecatt_failure( ecatt_failure ).
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (_table-source_table) INTO TABLE @<con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,512 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF table->*-is_initial = abap_false.
MODIFY (table->*-fake_table) FROM TABLE <con>.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
MODIFY (table->*-fake_table) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,513 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = get_tdc_parameter_name( table->* )
i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
" If no content is exported in other than the "ECATTDEFAULT"-variant,
" <con> contains the parameter value of the "ECATTDEFAULT"-variant.
" Therefore INSERT-Statement is only executed, when the exported content is not initial.
IF table->*-is_initial = abap_false.
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDIF.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,514 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF table->*-is_initial = abap_false.
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
IF table->*-is_initial = abap_false.
INSERT (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
ENDIF.
ENDLOOP.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
IF table->*-is_initial = abap_false.
INSERT (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
ENDIF.
ENDLOOP.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,515 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
param_name = create_parameter( _table-fake_table ).
INSERT _table INTO TABLE table_list.
CREATE DATA content TYPE STANDARD TABLE OF (_table-source_table).
ASSIGN content->* TO <con>.
SELECT * FROM (_table-source_table) INTO TABLE <con>
WHERE (_table-where_restriction).
set_parameter_value( content = <con> name = param_name ).
CATCH cx_sy_dynamic_osql_error.
RAISE EXCEPTION TYPE zcx_export_where_clause_invali
EXPORTING
table = _table-source_table
where_clause = _table-where_restriction.
CATCH cx_ecatt_tdc_access INTO DATA(ecatt_failure).
zcx_export_error=>wrap_ecatt_failure( ecatt_failure ).
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (_table-source_table) INTO TABLE <con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,518 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT tdc->get_param_list( ) REFERENCE INTO DATA(param)
WHERE table_line <> 'ZEXPORT_TABLE_LIST'.
CREATE DATA content TYPE STANDARD TABLE OF (param->*).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = param->* i_variant_name = variant
CHANGING e_param_value = <con> ).
MODIFY (param->*) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
MODIFY (param->*) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,523 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT tdc->get_param_list( ) REFERENCE INTO DATA(param)
WHERE table_line <> 'ZEXPORT_TABLE_LIST'.
CREATE DATA content TYPE STANDARD TABLE OF (param->*).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = param->* i_variant_name = variant
CHANGING e_param_value = <con> ).
IF <con> IS INITIAL.
CONTINUE.
ENDIF.
DATA(where_restriction) = get_where_restriction( param->* ).
DELETE FROM (param->*) WHERE (where_restriction).
INSERT (param->*) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (param->*) WHERE (where_restriction).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (param->*) WHERE (where_restriction).
INSERT (param->*) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,524 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT tdc->get_param_list( ) REFERENCE INTO DATA(param)
WHERE table_line <> 'ZEXPORT_TABLE_LIST'.
CREATE DATA content TYPE STANDARD TABLE OF (param->*).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = param->* i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (param->*).
INSERT (param->*) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (param->*).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (param->*).
INSERT (param->*) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,525 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
SELECT * FROM (_table-source_table) INTO TABLE @<con>
WHERE (_table-where_restriction).
CATCH cx_sy_dynamic_osql_error INTO DATA(osql_syntax_error).
RAISE EXCEPTION TYPE zcx_export_where_clause_invali
EXPORTING
table = _table-source_table
where_clause = _table-where_restriction
failure_description = osql_syntax_error->msgtext.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (_table-source_table) INTO TABLE @<con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,526 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = get_tdc_parameter_name( table->* )
i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (table->*-fake_table).
" If no content is exported in other than the "ECATTDEFAULT"-variant,
" <con> contains the parameter value of the "ECATTDEFAULT"-variant.
" Therefore INSERT-Statement is only executed, when the exported content is not initial.
IF table->*-is_initial = abap_false.
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDIF.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (table->*-fake_table).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,531 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD delete.
DATA: content TYPE REF TO data.
FIELD-SYMBOLS: <content> TYPE STANDARD TABLE.
CREATE DATA content TYPE STANDARD TABLE OF (table_conjunction-fake_table).
ASSIGN content->* TO <content>.
select_from_fake( EXPORTING table_conjunction = table_conjunction
IMPORTING content = <content> ).
DELETE (table_conjunction-fake_table) FROM TABLE <content>.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
DELETE (table_conjunction-fake_table) FROM TABLE <content>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,532 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
zexport_utils=>get_table_for_all_entries( EXPORTING
table_conjunction = table_conjunction
RECEIVING table_name = DATA(table_name)
EXCEPTIONS not_for_all_entries_cond = 4 ).
IF sy-subrc = 0.
READ TABLE table_list REFERENCE INTO DATA(foe_conjunction)
WITH KEY source_table = table_name+1.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_export_invalid_name
EXPORTING
name = table_name.
ENDIF.
CREATE DATA table_for_all_entries TYPE STANDARD TABLE OF (table_name+1).
get_exported_content( EXPORTING table_conjunction = foe_conjunction->*
IMPORTING content = table_for_all_entries ).
ASSIGN table_for_all_entries->* TO FIELD-SYMBOL(<table_for_all_entries>).
zexport_utils=>select( EXPORTING table_for_all_entries = <table_for_all_entries>
table_conjunction = table_conjunction table_name = table_name
select_from_fake = from_fake
IMPORTING result = content ).
ELSE.
DATA(data_source) = COND tabname( WHEN from_fake = abap_true
THEN table_conjunction-fake_table ELSE table_conjunction-source_table ).
SELECT * FROM (data_source) INTO TABLE @content
WHERE (table_conjunction-where_restriction).
ENDIF.
CATCH zcx_export_error INTO DATA(exc).
RAISE EXCEPTION TYPE zcx_import_error
EXPORTING
previous = exc.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (data_source) INTO TABLE @content
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,533 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT cluster_objects REFERENCE INTO DATA(object).
ASSIGN object->*-value->* TO <con>.
READ TABLE table_list REFERENCE INTO DATA(_table)
WITH KEY fake_table = CONV tabname( object->*-name ).
ASSERT FIELDS object->*-name CONDITION sy-subrc = 0.
DELETE FROM (object->*-name) WHERE (_table->*-where_restriction).
INSERT (object->*-name) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (object->*-name) WHERE (_table->*-where_restriction).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (object->*-name) WHERE (_table->*-where_restriction).
INSERT (object->*-name) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,537 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
_table-tdc_parameter_name = create_parameter( _table-fake_table ).
INSERT _table INTO TABLE table_list.
CREATE DATA content TYPE STANDARD TABLE OF (_table-source_table).
ASSIGN content->* TO <con>.
SELECT * FROM (_table-source_table) INTO TABLE @<con>
WHERE (_table-where_restriction).
set_parameter_value( content = <con> name = _table-tdc_parameter_name ).
CATCH cx_sy_dynamic_osql_error INTO DATA(osql_syntax_error).
RAISE EXCEPTION TYPE zcx_export_where_clause_invali
EXPORTING
table = _table-source_table
where_clause = _table-where_restriction
failure_description = osql_syntax_error->msgtext.
CATCH cx_ecatt_tdc_access INTO DATA(ecatt_failure).
zcx_export_error=>wrap_ecatt_failure( ecatt_failure ).
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (_table-source_table) INTO TABLE @<con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,544 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = get_tdc_parameter_name( table->* )
i_variant_name = variant
CHANGING e_param_value = <con> ).
MODIFY (table->*-fake_table) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
MODIFY (table->*-fake_table) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,545 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = get_tdc_parameter_name( table->* )
i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (table->*-fake_table) WHERE (table->*-where_restriction).
INSERT (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,546 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT table_list REFERENCE INTO DATA(table).
CREATE DATA content TYPE STANDARD TABLE OF (table->*-fake_table).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = get_tdc_parameter_name( table->* )
i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (table->*-fake_table).
INSERT (table->*-fake_table) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (table->*-fake_table).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
DELETE FROM (table->*-fake_table).
INSERT (table->*-fake_table) FROM TABLE <con>. * <-- There is a problem here
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,547 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
SELECT * FROM (_table-source_table) INTO TABLE <con>
WHERE (_table-where_restriction).
CATCH cx_sy_dynamic_osql_error.
RAISE EXCEPTION TYPE zcx_export_where_clause_invali
EXPORTING
table = _table-source_table
where_clause = _table-where_restriction.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (_table-source_table) INTO TABLE <con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,548 |
Find vulnerabilities in this ABAP code snippet. | ```abap
method ADD_TABLE_TO_BUNDLE.
DATA: name TYPE tabname.
FIELD-SYMBOLS: <con> TYPE STANDARD TABLE.
IF fake_table IS NOT INITIAL.
name = fake_table.
ELSE.
name = table.
ENDIF.
IF line_exists( cluster_objects[ name = name ] ).
RAISE EXCEPTION TYPE zcx_export_table_duplicate
EXPORTING
table = name.
ENDIF.
APPEND INITIAL LINE TO cluster_objects
ASSIGNING FIELD-SYMBOL(<content>).
<content>-name = name.
CREATE DATA <content>-value TYPE STANDARD TABLE OF
(table).
ASSIGN <content>-value->* TO <con>.
SELECT * FROM (table) INTO TABLE <con>
WHERE (where_restriction).
instance = me.
endmethod.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (table) INTO TABLE <con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,553 |
Find vulnerabilities in this ABAP code snippet. | ```abap
method ADD_TABLE_TO_BUNDLE.
DATA: content TYPE REF TO data,
param_name TYPE etp_name.
FIELD-SYMBOLS: <con> TYPE STANDARD TABLE.
IF fake_table IS NOT INITIAL.
param_name = create_parameter( fake_table ).
ELSE.
param_name = create_parameter( table ).
ENDIF.
CREATE DATA content TYPE STANDARD TABLE OF (table).
ASSIGN content->* TO <con>.
SELECT * FROM (table) INTO TABLE <con>
WHERE (where_restriction).
set_parameter_value( content = <con> name = param_name ).
endmethod.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (table) INTO TABLE <con>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,555 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT cluster_objects REFERENCE INTO DATA(object).
ASSIGN object->*-value->* TO <con>.
DELETE FROM (object->*-name).
INSERT (object->*-name) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (object->*-name).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
INSERT (object->*-name) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,557 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT tdc->get_param_list( ) REFERENCE INTO DATA(param).
CREATE DATA content TYPE STANDARD TABLE OF (param->*).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = param->* i_variant_name = variant
CHANGING e_param_value = <con> ).
MODIFY (param->*) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
MODIFY (param->*) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,558 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT tdc->get_param_list( ) REFERENCE INTO DATA(param).
CREATE DATA content TYPE STANDARD TABLE OF (param->*).
ASSIGN content->* TO <con>.
tdc->get_value( EXPORTING i_param_name = param->* i_variant_name = variant
CHANGING e_param_value = <con> ).
DELETE FROM (param->*).
INSERT (param->*) FROM TABLE <con>.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM (param->*).
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
INSERT (param->*) FROM TABLE <con>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,559 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD get_object_id.
* Get object ID - internal call
CALL 'OBJMGR_GET_INFO' ID 'OPNAME' FIELD 'GET_OBJID' "#EC CI_CCALL
ID 'OBJID' FIELD rv_oid
ID 'OBJ' FIELD io_ref.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
CALL 'OBJMGR_GET_INFO' ID 'OPNAME' FIELD 'GET_OBJID'
```
Explanation: Potential dangerous statement KERNEL CALL. | 1,655 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD get_object_id.
* Get object ID - internal call
CALL 'OBJMGR_GET_INFO' ID 'OPNAME' FIELD 'GET_OBJID'
ID 'OBJID' FIELD rv_oid
ID 'OBJ' FIELD io_ref.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
CALL 'OBJMGR_GET_INFO' ID 'OPNAME' FIELD 'GET_OBJID'
```
Explanation: Potential dangerous statement KERNEL CALL. | 1,656 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD get_object_id.
* Get object ID - internal call
CALL 'OBJMGR_GET_INFO' ID 'OPNAME' FIELD 'GET_OBJID' "#EC CI_CCALL
ID 'OBJID' FIELD rv_oid
ID 'OBJ' FIELD io_ref.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
CALL 'OBJMGR_GET_INFO' ID 'OPNAME' FIELD 'GET_OBJID'
```
Explanation: Potential dangerous statement KERNEL CALL. | 1,657 |
Find vulnerabilities in this ABAP code snippet. | ```abap
CASE column.
WHEN 'NAVIGATE'.
CALL TRANSACTION 'SU01'.
ENDCASE.
``` | I found vulnerabilities in the line:
```abap
CALL TRANSACTION 'SU01'.
```
Explanation: Add an authority check to CALL TRANSACTION. | 1,661 |
Find vulnerabilities in this ABAP code snippet. | ```abap
CASE e_salv_function.
WHEN 'SE38'.
CALL TRANSACTION 'SE38'.
ENDCASE.
``` | I found vulnerabilities in the line:
```abap
CALL TRANSACTION 'SE38'.
```
Explanation: Add an authority check to CALL TRANSACTION. | 1,662 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
" Database view?
SELECT COUNT( * ) INTO <lv_count>
FROM (lv_table_name)
WHERE (lv_where).
RETURN.
CATCH cx_sy_dynamic_osql_semantics.
" Based on internal table lines[]
<lv_count> = 0.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT COUNT( * ) INTO <lv_count>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,667 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF lv_db IS NOT INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE <lt_table>
UP TO lv_count ROWS
FROM (lv_db)
WHERE (lv_where)
ORDER BY (ls_sort_param-db_sort).
ENDIF.
``` | I found vulnerabilities in the line:
```abap
SELECT * INTO CORRESPONDING FIELDS OF TABLE <lt_table>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,668 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD do_update.
UPDATE ztaqo_option
SET (iv_set)
WHERE package_id = p_pack
AND option_id = p_opt_id.
IF sy-subrc = 0.
MESSAGE 'Data updated'(upd) TYPE 'S'.
ELSE.
MESSAGE 'Error during updating!'(edu) TYPE 'S' DISPLAY LIKE 'E'.
ENDIF.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
UPDATE ztaqo_option
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,669 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF io_tech_request_context->has_inlinecount( ) = abap_true.
DATA dbcount TYPE int4 .
SELECT COUNT(*)
INTO @dbcount
FROM snwd_bpa AS bp
INNER JOIN snwd_ad AS ad
ON bp~address_guid = ad~node_key
WHERE (where_clause).
es_response_context-inlinecount = dbcount. "why is this a string?
ENDIF.
``` | I found vulnerabilities in the line:
```abap
SELECT COUNT(*)
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,670 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
" $inlinecount=allpages
IF io_tech_request_context->has_inlinecount( ) = abap_true.
DATA dbcount TYPE int4 .
SELECT COUNT(*)
INTO @dbcount
FROM snwd_bpa AS bp
INNER JOIN snwd_ad AS ad
ON bp~address_guid = ad~node_key
WHERE (where_clause).
es_response_context-inlinecount = dbcount. "why is this a string?
ENDIF.
" Get primary keys
SELECT bp~node_key
FROM snwd_bpa AS bp
INNER JOIN snwd_ad AS ad
ON bp~address_guid = ad~node_key
WHERE (where_clause)
ORDER BY (orderby_clause)
INTO CORRESPONDING FIELDS OF @<entity>.
CHECK sy-dbcnt > skip.
APPEND <entity> TO <entityset>.
IF top > 0 AND lines( <entityset> ) GE top.
EXIT.
ENDIF.
ENDSELECT.
CATCH cx_sy_dynamic_osql_error INTO DATA(cx_sy_dynamic_osql_error).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
previous = cx_sy_dynamic_osql_error
message = |{ cx_sy_dynamic_osql_error->get_text( ) }|.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT bp~node_key
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,671 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF io_tech_request_context->has_inlinecount( ) = abap_true.
DATA dbcount TYPE int4 .
SELECT COUNT(*)
INTO dbcount
FROM snwd_so
WHERE (where_clause).
es_response_context-inlinecount = dbcount. "why is this a string?
ENDIF.
``` | I found vulnerabilities in the line:
```abap
SELECT COUNT(*)
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,672 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
" $inlinecount=allpages
IF io_tech_request_context->has_inlinecount( ) = abap_true.
DATA dbcount TYPE int4 .
SELECT COUNT(*)
INTO dbcount
FROM snwd_so
WHERE (where_clause).
es_response_context-inlinecount = dbcount. "why is this a string?
ENDIF.
" Get primary keys
SELECT node_key
INTO CORRESPONDING FIELDS OF @<entity>
FROM snwd_so
WHERE (where_clause)
ORDER BY (orderby_clause).
CHECK sy-dbcnt > skip.
APPEND <entity> TO <entityset>.
IF top > 0 AND lines( <entityset> ) GE top.
EXIT.
ENDIF.
ENDSELECT.
CATCH cx_sy_dynamic_osql_error INTO DATA(cx_sy_dynamic_osql_error).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
previous = cx_sy_dynamic_osql_error
message = |{ cx_sy_dynamic_osql_error->get_text( ) }|.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT node_key * <-- There is a problem here
INTO CORRESPONDING FIELDS OF @<entity>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,673 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF io_tech_request_context->has_inlinecount( ) = abap_true.
DATA dbcount TYPE int4 .
SELECT COUNT(*)
INTO @dbcount
FROM snwd_so
WHERE (where_clause).
es_response_context-inlinecount = dbcount. "why is this a string?
ENDIF.
``` | I found vulnerabilities in the line:
```abap
SELECT COUNT(*)
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,676 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
" $inlinecount=allpages
IF io_tech_request_context->has_inlinecount( ) = abap_true.
DATA dbcount TYPE int4 .
SELECT COUNT(*)
INTO @dbcount
FROM snwd_so
WHERE (where_clause).
es_response_context-inlinecount = dbcount. "why is this a string?
ENDIF.
" Get primary keys
SELECT node_key
INTO CORRESPONDING FIELDS OF @<entity>
FROM snwd_so
WHERE (where_clause)
ORDER BY (orderby_clause).
CHECK sy-dbcnt > skip.
APPEND <entity> TO <entityset>.
IF top > 0 AND lines( <entityset> ) GE top.
EXIT.
ENDIF.
ENDSELECT.
CATCH cx_sy_dynamic_osql_error INTO DATA(cx_sy_dynamic_osql_error).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception
EXPORTING
textid = /iwbep/cx_mgw_busi_exception=>business_error
previous = cx_sy_dynamic_osql_error
message = |{ cx_sy_dynamic_osql_error->get_text( ) }|.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT node_key * <-- There is a problem here
INTO CORRESPONDING FIELDS OF @<entity>
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,677 |
Find vulnerabilities in this ABAP code snippet. | ```abap
*&---------------------------------------------------------------------*
*& Report zbw_tools
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zbw_tools.
* Define screen 101 as sub-screen
SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
PARAMETERS: "activate TRFN RSDG_TRFN_ACTIVATE
pa_atrf RADIOBUTTON GROUP rad1,
"activate RSDS RSDS_DATASOURCE_ACTIVATE_ALL
pa_arsd RADIOBUTTON GROUP rad1,
"activate DTP RSBKDTPREPAIR
pa_adtp RADIOBUTTON GROUP rad1,
"activate HCPR RSDG_HCPR_ACTIVATE
pa_ahcp RADIOBUTTON GROUP rad1,
"activate all ADSO requests
pa_adso RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF SCREEN 101.
SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
PARAMETERS:
"change DTP request status zcl_bw_tools_gui->change_request_status
pa_chgst RADIOBUTTON GROUP rad2,
"re-import objects rsdg_after_import_for_corr
pa_reimp RADIOBUTTON GROUP rad2,
"delete process chain variant zbw_rspc_var_del
pa_dpvar RADIOBUTTON GROUP rad2,
"start rspc zbw_rspc_start
pa_srsp RADIOBUTTON GROUP rad2,
"drop oh tables zbw_drop_oh_table
pa_doh RADIOBUTTON GROUP rad2,
"repair iobj RSDG_IOBJ_REORG
pa_rpiob RADIOBUTTON GROUP rad2,
"change rspc status based on RSPC_PROCESS_FINISH
pa_crsp RADIOBUTTON GROUP rad2,
"Unlock User
pa_user RADIOBUTTON GROUP rad2,
"DTP execution
pa_dtp RADIOBUTTON GROUP rad2,
"Check transformation --> RSDHA_SUPPORT = 'x'
pa_trans RADIOBUTTON GROUP rad2,
"Datasources
pa_ds RADIOBUTTON GROUP rad2,
"Composite Providers
pa_hcpr RADIOBUTTON GROUP rad2.
SELECTION-SCREEN END OF SCREEN 102.
SELECTION-SCREEN BEGIN OF TABBED BLOCK t1 FOR 20 LINES.
SELECTION-SCREEN TAB (20) tab1 USER-COMMAND ucomm1 DEFAULT SCREEN 101.
SELECTION-SCREEN TAB (20) tab2 USER-COMMAND ucomm2 DEFAULT SCREEN 102.
SELECTION-SCREEN END OF BLOCK t1.
INITIALIZATION.
tab1 = TEXT-001.
tab2 = TEXT-002.
END-OF-SELECTION.
IF t1-activetab = 'UCOMM1'.
IF pa_atrf = abap_true.
SUBMIT rsdg_trfn_activate VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_arsd = abap_true.
SUBMIT rsds_datasource_activate_all VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_adtp = abap_true.
SUBMIT rsbkdtprepair VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_ahcp = abap_true.
SUBMIT rsdg_hcpr_activate VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_adso = abap_true.
SUBMIT zbw_adso_request_act VIA SELECTION-SCREEN AND RETURN.
ENDIF.
ELSEIF t1-activetab = 'UCOMM2'.
IF pa_chgst = abap_true.
zcl_bw_tools_gui=>change_request_status( ).
ELSEIF pa_reimp = abap_true.
SUBMIT rsdg_after_import_for_corr VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_dpvar = abap_true.
SUBMIT zbw_rspc_var_del VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_srsp = abap_true.
SUBMIT zbw_rspc_start VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_doh = abap_true.
SUBMIT zbw_drop_oh_table VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_rpiob = abap_true.
SUBMIT rsdg_iobj_reorg VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_crsp = abap_true.
SUBMIT zbw_rspc_stat_chg VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_user = abap_true.
SUBMIT zbw_unlock_user VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_dtp = abap_true.
SUBMIT RSBK0001 VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_trans = abap_true.
SUBMIT RSTRAN_GUI_START VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_ds = abap_true.
CALL Transaction 'RSDS'.
ELSEIF pa_hcpr = abap_true.
CALL Transaction 'RSOADSO'.
ENDIF.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
CALL Transaction 'RSDS'.
```
Explanation: Add an authority check to CALL TRANSACTION.
```abap
CALL Transaction 'RSOADSO'.
```
Explanation: Add an authority check to CALL TRANSACTION. | 1,678 |
Find vulnerabilities in this ABAP code snippet. | ```abap
*&---------------------------------------------------------------------*
*& Report zbw_tools
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zbw_tools.
* Define screen 101 as sub-screen
SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN.
PARAMETERS: "activate TRFN RSDG_TRFN_ACTIVATE
pa_atrf RADIOBUTTON GROUP rad1,
"activate RSDS RSDS_DATASOURCE_ACTIVATE_ALL
pa_arsd RADIOBUTTON GROUP rad1,
"activate DTP RSBKDTPREPAIR
pa_adtp RADIOBUTTON GROUP rad1,
"activate HCPR RSDG_HCPR_ACTIVATE
pa_ahcp RADIOBUTTON GROUP rad1,
"activate all ADSO requests
pa_adso RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF SCREEN 101.
SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN.
PARAMETERS:
"change DTP request status zcl_bw_tools_gui->change_request_status
pa_chgst RADIOBUTTON GROUP rad2,
"re-import objects rsdg_after_import_for_corr
pa_reimp RADIOBUTTON GROUP rad2,
"delete process chain variant zbw_rspc_var_del
pa_dpvar RADIOBUTTON GROUP rad2,
"start rspc zbw_rspc_start
pa_srsp RADIOBUTTON GROUP rad2,
"drop oh tables zbw_drop_oh_table
pa_doh RADIOBUTTON GROUP rad2,
"repair iobj RSDG_IOBJ_REORG
pa_rpiob RADIOBUTTON GROUP rad2,
"change rspc status based on RSPC_PROCESS_FINISH
pa_crsp RADIOBUTTON GROUP rad2,
"Unlock User based on BAPI_USER_UNLOCK
pa_user RADIOBUTTON GROUP rad2.
SELECTION-SCREEN END OF SCREEN 102.
SELECTION-SCREEN BEGIN OF SCREEN 103 AS SUBSCREEN.
PARAMETERS:
"DTP execution based on rsbk0001
pa_dtp RADIOBUTTON GROUP rad3,
"Check transformation based on rstran_gui_start
pa_trans RADIOBUTTON GROUP rad3,
"Data sources based on transaction RSDS
pa_ds RADIOBUTTON GROUP rad3,
"Composite Providers based on RSOADSO
pa_hcpr RADIOBUTTON GROUP rad3.
SELECTION-SCREEN END OF SCREEN 103.
SELECTION-SCREEN BEGIN OF TABBED BLOCK t1 FOR 20 LINES.
SELECTION-SCREEN TAB (20) tab1 USER-COMMAND ucomm1 DEFAULT SCREEN 101.
SELECTION-SCREEN TAB (20) tab2 USER-COMMAND ucomm2 DEFAULT SCREEN 102.
SELECTION-SCREEN TAB (20) tab3 USER-COMMAND ucomm3 DEFAULT SCREEN 103.
SELECTION-SCREEN END OF BLOCK t1.
INITIALIZATION.
tab1 = TEXT-001.
tab2 = TEXT-002.
tab3 = TEXT-003.
END-OF-SELECTION.
IF t1-activetab = 'UCOMM1'.
IF pa_atrf = abap_true.
SUBMIT rsdg_trfn_activate VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_arsd = abap_true.
SUBMIT rsds_datasource_activate_all VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_adtp = abap_true.
SUBMIT rsbkdtprepair VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_ahcp = abap_true.
SUBMIT rsdg_hcpr_activate VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_adso = abap_true.
SUBMIT zbw_adso_request_act VIA SELECTION-SCREEN AND RETURN.
ENDIF.
ELSEIF t1-activetab = 'UCOMM2'.
IF pa_chgst = abap_true.
zcl_bw_tools_gui=>change_request_status( ).
ELSEIF pa_reimp = abap_true.
SUBMIT rsdg_after_import_for_corr VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_dpvar = abap_true.
SUBMIT zbw_rspc_var_del VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_srsp = abap_true.
SUBMIT zbw_rspc_start VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_doh = abap_true.
SUBMIT zbw_drop_oh_table VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_rpiob = abap_true.
SUBMIT rsdg_iobj_reorg VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_crsp = abap_true.
SUBMIT zbw_rspc_stat_chg VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_user = abap_true.
SUBMIT zbw_unlock_user VIA SELECTION-SCREEN AND RETURN.
ENDIF.
ELSEIF t1-activetab = 'UCOMM3'.
IF pa_dtp = abap_true.
SUBMIT rsbk0001 VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_trans = abap_true.
SUBMIT rstran_gui_start VIA SELECTION-SCREEN AND RETURN.
ELSEIF pa_ds = abap_true.
CALL TRANSACTION 'RSDS'.
ELSEIF pa_hcpr = abap_true.
CALL TRANSACTION 'RSOADSO'.
ENDIF.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
CALL TRANSACTION 'RSDS'.
```
Explanation: Add an authority check to CALL TRANSACTION.
```abap
CALL TRANSACTION 'RSOADSO'.
```
Explanation: Add an authority check to CALL TRANSACTION. | 1,679 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZCILIB_BOT_V.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZCILIB_BOT WHERE
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZCILIB_BOT WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,680 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZCILIB_HOST_V.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZCILIB_HOST WHERE
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZCILIB_HOST WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,681 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZCILIB_REPO_V.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZCILIB_REPO WHERE
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZCILIB_REPO WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,682 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZCILIB_SETT_V.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZCILIB_SETTINGS WHERE
VERSION EQ '000' AND
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZCILIB_SETTINGS WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,683 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZCILIB_SYSGRP_V.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZCILIB_SYSGRP WHERE
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZCILIB_SYSGRP WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,684 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZCILIB_SYSTEM_V.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZCILIB_SYSTEM WHERE
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZCILIB_SYSTEM WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,685 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZCILIB_SETT_V.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZCILIB_SETTINGS WHERE
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZCILIB_SETTINGS WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,699 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc = 0 AND lv_cproject+1(1) CA ' S'.
DELETE FROM tadir
WHERE pgmid = @is_tadir-pgmid AND object = @is_tadir-object AND obj_name = @is_tadir-obj_name.
IF sy-subrc = 0.
rv_cleaned_up = abap_true.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM tadir
```
Explanation: Modify only own DB tables. | 1,703 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF p_forc = abap_true.
DELETE FROM sotr_headu WHERE concept = @is_headu-concept.
DELETE FROM sotr_textu WHERE concept = @is_headu-concept.
DELETE FROM sotr_useu WHERE concept = @is_headu-concept.
DELETE FROM sotr_aliau WHERE concept = @is_headu-concept.
WRITE: 'Force Deleted' COLOR COL_POSITIVE.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM sotr_headu WHERE concept = @is_headu-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_textu WHERE concept = @is_headu-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_useu WHERE concept = @is_headu-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_aliau WHERE concept = @is_headu-concept.
```
Explanation: Modify only own DB tables. | 1,704 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF p_forc = abap_true.
DELETE FROM sotr_head WHERE concept = @is_head-concept.
DELETE FROM sotr_text WHERE concept = @is_head-concept.
DELETE FROM sotr_use WHERE concept = @is_head-concept.
DELETE FROM sotr_alia WHERE concept = @is_head-concept.
WRITE: 'Force Deleted' COLOR COL_POSITIVE.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM sotr_head WHERE concept = @is_head-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_text WHERE concept = @is_head-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_use WHERE concept = @is_head-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_alia WHERE concept = @is_head-concept.
```
Explanation: Modify only own DB tables. | 1,705 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF ( sy-subrc <> 0 AND p_forc = abap_true ) OR sy-subrc = 9.
DELETE FROM tadir
WHERE pgmid = 'R3TR' AND object = @iv_obj_type AND obj_name = @iv_obj_name.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM tadir
```
Explanation: Modify only own DB tables. | 1,706 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD delete.
DELETE REPORT co_report_name.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Latest build: Deletion failed. Subrc = { sy-subrc }| ).
ENDIF.
delete_tadir_entry( ).
DATA(lo_package) = NEW zcl_abapgit_object_devc( is_item = VALUE #( obj_type = 'DEVC'
obj_name = co_package
devclass = co_package )
iv_language = sy-langu ).
lo_package->zif_abapgit_object~delete( ).
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
DELETE REPORT co_report_name.
```
Explanation: Potential dangerous statement DELETE REPORT. | 1,711 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD install.
IF mi_package->exists( ) = abap_false.
mi_package->create( VALUE #(
as4user = sy-uname
devclass = co_package
ctext = |abapGit latest build|
) ).
ENDIF.
INSERT REPORT co_report_name
FROM mt_latest_build
STATE 'A'
PROGRAM TYPE '1'.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Latest build: Installation failed. Subrc = { sy-subrc }| ).
ENDIF.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
object = co_report_name
object_class = 'ABAP'
devclass = co_package
master_language = sy-langu
mode = 'INSERT'
EXCEPTIONS
cancelled = 1
permission_failure = 2
unknown_objectclass = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Latest build: Installation failed. RS_CORR_INSERT Subrc = { sy-subrc }| ).
ENDIF.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
INSERT REPORT co_report_name
```
Explanation: Potential dangerous statement INSERT REPORT. | 1,712 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc <> 0 AND sy-msgid = 'TR' AND sy-msgno = '024'.
" Object directory entry cannot be deleted, since the object is distributed (TR 024)
" Force deletion of TADIR
DELETE FROM tadir
WHERE pgmid = 'R3TR' AND object = @iv_obj_type AND obj_name = @iv_obj_name.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM tadir
```
Explanation: Modify only own DB tables. | 1,713 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc <> 0.
" Object directory entry cannot be deleted, since the object is distributed (TR 024)
" Force deletion of TADIR
DELETE FROM tadir
WHERE pgmid = 'R3TR' AND object = @iv_obj_type AND obj_name = @iv_obj_name.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM tadir
```
Explanation: Modify only own DB tables. | 1,715 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF p_forc = abap_true.
DELETE FROM sotr_head WHERE concept = @ls_head-concept.
DELETE FROM sotr_text WHERE concept = @ls_head-concept.
DELETE FROM sotr_use WHERE concept = @ls_head-concept.
DELETE FROM sotr_alia WHERE concept = @ls_head-concept.
WRITE: 'Force Deleted' COLOR COL_POSITIVE.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM sotr_head WHERE concept = @ls_head-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_text WHERE concept = @ls_head-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_use WHERE concept = @ls_head-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_alia WHERE concept = @ls_head-concept.
```
Explanation: Modify only own DB tables. | 1,726 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF p_forc = abap_true.
DELETE FROM sotr_headu WHERE concept = @ls_headu-concept.
DELETE FROM sotr_textu WHERE concept = @ls_headu-concept.
DELETE FROM sotr_useu WHERE concept = @ls_headu-concept.
DELETE FROM sotr_aliau WHERE concept = @ls_headu-concept.
WRITE: 'Force Deleted' COLOR COL_POSITIVE.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM sotr_headu WHERE concept = @ls_headu-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_textu WHERE concept = @ls_headu-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_useu WHERE concept = @ls_headu-concept.
```
Explanation: Modify only own DB tables.
```abap
DELETE FROM sotr_aliau WHERE concept = @ls_headu-concept.
```
Explanation: Modify only own DB tables. | 1,727 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc <> 0 AND p_forc = abap_true.
DELETE FROM tadir
WHERE pgmid = 'R3TR' AND object = @iv_obj_type AND obj_name = @iv_obj_name.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM tadir
```
Explanation: Modify only own DB tables. | 1,728 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD delete.
DELETE REPORT co_report_name.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Latest build: Deletion failed. Subrc = { sy-subrc }| ).
ENDIF.
delete_tadir_entry( ).
DATA(lo_package) = NEW zcl_abapgit_object_devc( is_item = VALUE #( obj_type = 'DEVC'
obj_name = co_package
devclass = co_package )
iv_language = sy-langu ).
lo_package->zif_abapgit_object~delete( co_package ).
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
DELETE REPORT co_report_name.
```
Explanation: Potential dangerous statement DELETE REPORT. | 1,730 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc = 0.
SELECT profile FROM (profile_db) INTO TABLE result.
IF sy-subrc = 0.
RETURN.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
SELECT profile FROM (profile_db) INTO TABLE result.
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,739 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
SELECT SINGLE devclass FROM tadir INTO @DATA(package)
WHERE pgmid = 'R3TR' AND
object = 'TABL' AND
obj_name = @obj_name.
IF sy-subrc NE 0.
result = abap_false.
RETURN.
ENDIF.
DATA(checked_object) = cl_abap_dyn_prg=>check_table_name_str(
val = obj_name
packages = package ).
DATA dynamic_line TYPE REF TO data.
FIELD-SYMBOLS <table_structure> TYPE any.
CREATE DATA dynamic_line TYPE (checked_object).
ASSIGN dynamic_line->* TO <table_structure>.
SELECT SINGLE * FROM (checked_object) INTO <table_structure>.
result = abap_true.
CATCH cx_abap_not_a_table cx_abap_not_in_package cx_sy_dynamic_osql_semantics cx_root.
result = abap_false.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT SINGLE * FROM (checked_object) INTO <table_structure>.
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,740 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD activate_check.
is_check_compatible( name ).
INSERT scitests FROM name.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE cx_failed.
ENDIF.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
INSERT scitests FROM name.
```
Explanation: Modify only own DB tables. | 1,741 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD deactivate_check.
is_check_compatible( name ).
DELETE FROM scitests WHERE name = name.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE cx_failed.
ENDIF.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM scitests WHERE name = name.
```
Explanation: Modify only own DB tables. | 1,742 |
Find vulnerabilities in this ABAP code snippet. | ```abap
CLASS lcl_cute_table IMPLEMENTATION.
METHOD lif_cute~edit.
lif_cute~table_helper = lcl_cute_tab_helper=>get_instance( lif_cute~source_information ).
lif_cute~read( ).
edit_grid( ).
ENDMETHOD.
METHOD lif_cute~set_source.
lif_cute~source_information = source_info.
ENDMETHOD.
METHOD lif_cute~read.
FIELD-SYMBOLS <table> TYPE table.
DATA(tabref) = lif_cute~table_helper->get_data_reference_origin( ).
ASSIGN tabref->* TO <table>.
SELECT * FROM (lif_cute~source_information->header-tabname)
INTO TABLE <table>.
lif_cute~map_origin_to_edit( ).
ENDMETHOD.
METHOD lif_cute~save.
FIELD-SYMBOLS <origin_data> TYPE table.
lif_cute~map_edit_to_origin( ).
DATA(origin_data) = lif_cute~table_helper->get_data_reference_origin( ).
ASSIGN origin_data->* TO <origin_data>.
MODIFY (lif_cute~source_information->header-tabname)
FROM TABLE <origin_data>.
IF sy-subrc = 0.
MESSAGE 'data has been saved.'(svs) TYPE 'S'.
ELSE.
MESSAGE 'Error saving data... ;('(sve) TYPE 'I'.
ENDIF.
ENDMETHOD.
METHOD lif_cute~check.
ENDMETHOD.
METHOD edit_grid.
FIELD-SYMBOLS <edit_data> TYPE table.
DATA(edit_data) = lif_cute~table_helper->get_data_reference_edit( ).
ASSIGN edit_data->* TO <edit_data>.
grid = NEW #(
i_parent = cl_gui_container=>screen0
i_appl_events = ' ' ).
grid->register_edit_event( cl_gui_alv_grid=>mc_evt_enter ).
grid->set_ready_for_input( 1 ).
SET HANDLER handle_data_changed FOR grid.
SET HANDLER handle_user_command FOR grid.
SET HANDLER handle_toolbar FOR grid.
DATA layout TYPE lvc_s_layo.
DATA(fcat) = lif_cute~table_helper->get_field_catalog( ).
grid->set_table_for_first_display(
EXPORTING
is_variant = VALUE #( handle = 'GRID' report = sy-repid username = sy-uname )
i_save = 'A'
i_default = abap_true
is_layout = layout
it_toolbar_excluding = grid_excluded_functions( )
CHANGING
it_outtab = <edit_data>
it_fieldcatalog = fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 ).
IF sy-subrc = 0.
grid->set_toolbar_interactive( ).
WRITE space.
ENDIF.
ENDMETHOD.
METHOD grid_excluded_functions.
APPEND cl_gui_alv_grid=>mc_mb_view TO functions.
APPEND cl_gui_alv_grid=>mc_fc_reprep TO functions.
APPEND cl_gui_alv_grid=>mc_fc_maximum TO functions.
APPEND cl_gui_alv_grid=>mc_fc_minimum TO functions.
APPEND cl_gui_alv_grid=>mc_mb_sum TO functions.
APPEND cl_gui_alv_grid=>mc_mb_subtot TO functions.
APPEND cl_gui_alv_grid=>mc_fc_graph TO functions.
ENDMETHOD.
METHOD lif_cute~map_edit_to_origin.
DATA(origin_data) = lif_cute~table_helper->get_data_reference_origin( ).
DATA(edit_data) = lif_cute~table_helper->get_data_reference_edit( ).
FIELD-SYMBOLS <origin_data> TYPE table.
FIELD-SYMBOLS <edit_data> TYPE table.
ASSIGN origin_data->* TO <origin_data>.
ASSIGN edit_data->* TO <edit_data>.
<origin_data> = CORRESPONDING #( <edit_data> ).
ENDMETHOD.
METHOD lif_cute~map_origin_to_edit.
DATA(origin_data) = lif_cute~table_helper->get_data_reference_origin( ).
DATA(edit_data) = lif_cute~table_helper->get_data_reference_edit( ).
FIELD-SYMBOLS <origin_data> TYPE table.
FIELD-SYMBOLS <edit_data> TYPE table.
ASSIGN origin_data->* TO <origin_data>.
ASSIGN edit_data->* TO <edit_data>.
<edit_data> = CORRESPONDING #( <origin_data> ).
ENDMETHOD.
METHOD handle_data_changed.
ENDMETHOD.
METHOD handle_toolbar.
DATA button TYPE stb_button.
CLEAR button.
button-butn_type = 3. "Separator
APPEND button TO e_object->mt_toolbar.
"add save button
CLEAR button.
button-function = 'SAVE'.
button-icon = icon_system_save.
button-quickinfo = 'Save data'(svq).
button-butn_type = '0'. "normal Button
button-disabled = ' '.
APPEND button TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'SAVE'.
lif_cute~save( ).
WHEN OTHERS.
ENDCASE.
ENDMETHOD.
ENDCLASS.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (lif_cute~source_information->header-tabname)
```
Explanation: Potential dangerous statement Dynamic SQL.
```abap
MODIFY (lif_cute~source_information->header-tabname)
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,752 |
Find vulnerabilities in this ABAP code snippet. | ```abap
CLASS lcl_cute_table IMPLEMENTATION.
METHOD lif_cute~edit.
lif_cute~container = container.
lif_cute~table_helper = lcl_cute_tab_helper=>get_instance( lif_cute~source_information ).
lif_cute~read( ).
edit_grid( ).
ENDMETHOD.
METHOD lif_cute~set_source.
lif_cute~source_information = source_info.
ENDMETHOD.
METHOD lif_cute~read.
FIELD-SYMBOLS <table> TYPE table.
DATA(tabref) = lif_cute~table_helper->get_data_reference_origin( ).
ASSIGN tabref->* TO <table>.
SELECT * FROM (lif_cute~source_information->name)
INTO TABLE <table>.
lif_cute~map_origin_to_edit( ).
ENDMETHOD.
METHOD lif_cute~save.
FIELD-SYMBOLS <origin_data> TYPE table.
lif_cute~map_edit_to_origin( ).
DATA(origin_data) = lif_cute~table_helper->get_data_reference_origin( ).
ASSIGN origin_data->* TO <origin_data>.
MODIFY (lif_cute~source_information->name)
FROM TABLE <origin_data>.
IF sy-subrc = 0.
MESSAGE 'data has been saved.'(svs) TYPE 'S'.
ELSE.
MESSAGE 'Error saving data... ;('(sve) TYPE 'I'.
ENDIF.
ENDMETHOD.
METHOD lif_cute~check.
ENDMETHOD.
METHOD edit_grid.
FIELD-SYMBOLS <edit_data> TYPE table.
DATA(edit_data) = lif_cute~table_helper->get_data_reference_edit( ).
ASSIGN edit_data->* TO <edit_data>.
splitter = NEW #(
parent = lif_cute~container
orientation = cl_gui_easy_splitter_container=>orientation_vertical
sash_position = 70 ).
grid = NEW #(
i_parent = splitter->top_left_container
i_applogparent = splitter->bottom_right_container
i_appl_events = ' ' ).
grid->register_edit_event( cl_gui_alv_grid=>mc_evt_enter ).
grid->set_ready_for_input( 1 ).
SET HANDLER handle_data_changed FOR grid.
SET HANDLER handle_user_command FOR grid.
SET HANDLER handle_toolbar FOR grid.
DATA layout TYPE lvc_s_layo.
DATA(fcat) = lif_cute~table_helper->get_field_catalog( grid ).
grid->set_table_for_first_display(
EXPORTING
is_variant = VALUE #( handle = 'GRID' report = sy-repid username = sy-uname )
i_save = 'A'
i_default = abap_true
is_layout = layout
it_toolbar_excluding = grid_excluded_functions( )
CHANGING
it_outtab = <edit_data>
it_fieldcatalog = fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 ).
IF sy-subrc = 0.
grid->set_toolbar_interactive( ).
WRITE space.
ENDIF.
ENDMETHOD.
METHOD grid_excluded_functions.
APPEND cl_gui_alv_grid=>mc_mb_view TO functions.
APPEND cl_gui_alv_grid=>mc_fc_reprep TO functions.
APPEND cl_gui_alv_grid=>mc_fc_maximum TO functions.
APPEND cl_gui_alv_grid=>mc_fc_minimum TO functions.
APPEND cl_gui_alv_grid=>mc_mb_sum TO functions.
APPEND cl_gui_alv_grid=>mc_mb_subtot TO functions.
APPEND cl_gui_alv_grid=>mc_fc_graph TO functions.
ENDMETHOD.
METHOD lif_cute~map_edit_to_origin.
DATA(origin_data) = lif_cute~table_helper->get_data_reference_origin( ).
DATA(edit_data) = lif_cute~table_helper->get_data_reference_edit( ).
FIELD-SYMBOLS <origin_data> TYPE table.
FIELD-SYMBOLS <edit_data> TYPE table.
ASSIGN origin_data->* TO <origin_data>.
ASSIGN edit_data->* TO <edit_data>.
<origin_data> = CORRESPONDING #( <edit_data> ).
ENDMETHOD.
METHOD lif_cute~map_origin_to_edit.
DATA(origin_data) = lif_cute~table_helper->get_data_reference_origin( ).
DATA(edit_data) = lif_cute~table_helper->get_data_reference_edit( ).
FIELD-SYMBOLS <origin_data> TYPE table.
FIELD-SYMBOLS <edit_data> TYPE table.
ASSIGN origin_data->* TO <origin_data>.
ASSIGN edit_data->* TO <edit_data>.
<edit_data> = CORRESPONDING #( <origin_data> ).
ENDMETHOD.
METHOD handle_data_changed.
DATA msgid TYPE sy-msgid.
DATA msgty TYPE sy-msgty.
DATA msgno TYPE sy-msgno.
DATA msgv1 TYPE sy-msgv1.
DATA msgv2 TYPE sy-msgv2.
DATA msgv3 TYPE sy-msgv3.
DATA msgv4 TYPE sy-msgv4.
DATA value_internal TYPE string.
CHECK e_onf4 IS INITIAL
AND e_onf4_after IS INITIAL
AND e_onf4_before IS INITIAL.
LOOP AT er_data_changed->mt_good_cells INTO DATA(good_cell).
DATA(field_info) = lif_cute~source_information->get_field_info( good_cell-fieldname ).
* CALL FUNCTION 'DDUT_INPUT_CHECK'
* EXPORTING
* tabname = lif_cute~source_information->name
* fieldname = conv FNAM_____4( good_cell-fieldname )
* value = good_cell-value
* value_is_external = 'X'
* no_forkey_check = ' '
* keep_fieldinfo = ' '
* IMPORTING
* msgid = msgid
* msgty = msgty
* msgno = msgno
* msgv1 = msgv1
* msgv2 = msgv2
* msgv3 = msgv3
* msgv4 = msgv4
* value_internal = value_internal
* EXCEPTIONS
* no_ddic_field = 1
* illegal_move = 2
* OTHERS = 3.
* IF sy-subrc = 0 AND msgid IS NOT INITIAL.
* er_data_changed->add_protocol_entry(
* i_msgid = msgid
* i_msgty = msgty
* i_msgno = msgno
* i_msgv1 = msgv1
* i_msgv2 = msgv2
* i_msgv3 = msgv3
* i_msgv4 = msgv4
* i_fieldname = good_cell-fieldname
* i_row_id = good_cell-row_id
* i_tabix = good_cell-tabix ).
* ENDIF.
ENDLOOP.
" fm DDUT_INPUT_CHECK
ENDMETHOD.
METHOD handle_toolbar.
DATA button TYPE stb_button.
CLEAR button.
button-butn_type = 3. "Separator
APPEND button TO e_object->mt_toolbar.
"add save button
CLEAR button.
button-function = 'SAVE'.
button-icon = icon_system_save.
button-quickinfo = 'Save data'(svq).
button-butn_type = '0'. "normal Button
button-disabled = ' '.
APPEND button TO e_object->mt_toolbar.
ENDMETHOD.
METHOD handle_user_command.
CASE e_ucomm.
WHEN 'SAVE'.
lif_cute~save( ).
WHEN OTHERS.
ENDCASE.
ENDMETHOD.
ENDCLASS.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (lif_cute~source_information->name)
```
Explanation: Potential dangerous statement Dynamic SQL.
```abap
MODIFY (lif_cute~source_information->name)
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,754 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD read_table_data.
" Read data of the table to be scrambled
DATA:
lr_data TYPE REF TO data
,lr_data_db TYPE REF TO data
.
CREATE DATA lr_data TYPE TABLE OF (iv_tabname).
ASSIGN lr_data->* TO <gfs_tab>.
CREATE DATA lr_data_db TYPE TABLE OF (iv_tabname).
ASSIGN lr_data_db->* TO <gfs_tab_db>.
DATA(lt_where) = create_where( iv_tabname = iv_tabname ).
SELECT * "dynamic select
FROM (iv_tabname)
BYPASSING BUFFER
INTO CORRESPONDING FIELDS OF TABLE @<gfs_tab_db>
WHERE (lt_where).
<gfs_tab> = CORRESPONDING #( <gfs_tab_db> ). "original values
DATA(lv_lines) = lines( <gfs_tab> ).
bal_log_msg_add( is_msg = VALUE bal_s_msg(
msgty = SWITCH char1( sy-subrc
WHEN 0 THEN 'I'
ELSE 'W' )
msgno = '004'
msgv1 = iv_tabname
msgv2 = lv_lines
msgv3 = sy-subrc
) )."table content fetch finished
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
SELECT * "dynamic select * <-- There is a problem here
FROM (iv_tabname)
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,756 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT <gfs_tab> ASSIGNING FIELD-SYMBOL(<fs_line>).
CLEAR lv_random_c.
UNASSIGN <lfs>.
ASSIGN COMPONENT iv_fieldname OF STRUCTURE <fs_line> TO <lfs>.
CHECK sy-subrc IS INITIAL.
DESCRIBE FIELD <lfs> TYPE DATA(lv_type). "data type.
lv_string = <lfs>.
IF lv_string NE ''.
DATA(lv_field_len) = strlen( lv_string ). "field lenght for non-numeric fields
ELSE.
CLEAR lv_field_len.
ENDIF.
"to avoid updating of numeric table fields with characters and vice versa
"Numeric Data Type ID
"b b
"s s
"i I
"int8 8
"p P
"decfloat16 a
"decfloat34 e
"f F
IF
lv_type = 'b'
OR lv_type = 'D' "rel2
OR lv_type = 's'
OR lv_type = 'I'
OR lv_type = '8'
OR lv_type = 'P'
OR lv_type = 'a'
OR lv_type = 'e'
OR lv_type = 'F'
OR lv_type = 'N'.
* CALL FUNCTION 'GENERAL_GET_RANDOM_INT' "rel2
* EXPORTING
* range = CONV i( <lfs> ) " The random int will be <= range
* IMPORTING
* random = lv_random. " Random value
IF lv_field_len <> 0.
DESCRIBE FIELD <lfs> LENGTH DATA(lv_len) IN BYTE MODE. "data lenght
IF lv_len <> 1.
lv_len = lv_len - 1. "dot
ENDIF.
DATA(lv_alphabet) = CONV char200( '0123456789' ).
CALL 'RSEC_GEN_PASSWD'
ID 'ALPHABET' FIELD lv_alphabet
ID 'ALPHABETLEN' FIELD 10
ID 'OUTPUT' FIELD lv_random_c
ID 'OUTPUTLEN' FIELD lv_len
ID 'FORCE_INIT' FIELD ''. "#EC CI_CCALL
<lfs> = lv_random_c.
ENDIF.
ELSEIF lv_type = 'C'.
IF lv_field_len <> 0.
* CALL FUNCTION 'GENERAL_GET_RANDOM_STRING' "rel2
* EXPORTING
* number_chars = lv_field_len " Specifies the number of generated chars
* IMPORTING
* random_string = lv_string. " Generated string
lv_alphabet = CONV char200( 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789@$%&/\()=+-#~ []{}' ).
CALL 'RSEC_GEN_PASSWD'
ID 'ALPHABET' FIELD lv_alphabet
ID 'ALPHABETLEN' FIELD 77
ID 'OUTPUT' FIELD lv_random_c
ID 'OUTPUTLEN' FIELD lv_field_len
ID 'FORCE_INIT' FIELD ''. "#EC CI_CCALL
* <lfs> = |{ lv_random_c CASE = (cl_abap_format=>c_upper) }|.
<lfs> = lv_random_c.
ENDIF.
ELSE.
IF lv_field_len <> 0.
CALL FUNCTION 'GENERAL_GET_RANDOM_STRING'
EXPORTING
number_chars = lv_field_len " Specifies the number of generated chars
IMPORTING
random_string = lv_string. " Generated string
* <lfs> = |{ lv_string CASE = (cl_abap_format=>c_upper) }|.
<lfs> = lv_string .
ENDIF.
ENDIF.
cv_field_count = cv_field_count + 1.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DATA(lv_alphabet) = CONV char200( '0123456789' ).
CALL 'RSEC_GEN_PASSWD' * <-- There is a problem here
ID 'ALPHABET' FIELD lv_alphabet
ID 'ALPHABETLEN' FIELD 10
```
Explanation: Potential dangerous statement KERNEL CALL. | 1,757 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF lv_field_len <> 0.
* CALL FUNCTION 'GENERAL_GET_RANDOM_STRING' "rel2
* EXPORTING
* number_chars = lv_field_len " Specifies the number of generated chars
* IMPORTING
* random_string = lv_string. " Generated string
lv_alphabet = CONV char200( 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789@$%&/\()=+-#~ []{}' ).
CALL 'RSEC_GEN_PASSWD'
ID 'ALPHABET' FIELD lv_alphabet
ID 'ALPHABETLEN' FIELD 77
ID 'OUTPUT' FIELD lv_random_c
ID 'OUTPUTLEN' FIELD lv_field_len
ID 'FORCE_INIT' FIELD ''. "#EC CI_CCALL
* <lfs> = |{ lv_random_c CASE = (cl_abap_format=>c_upper) }|.
<lfs> = lv_random_c.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
lv_alphabet = CONV char200( 'ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456789@$%&/\()=+-#~ []{}' ).
CALL 'RSEC_GEN_PASSWD' * <-- There is a problem here
ID 'ALPHABET' FIELD lv_alphabet
ID 'ALPHABETLEN' FIELD 77
```
Explanation: Potential dangerous statement KERNEL CALL. | 1,758 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
DELETE (iv_tabname) FROM TABLE <gfs_tab_db>. "delete
IF sy-subrc <> 0.
CALL FUNCTION 'DB_ROLLBACK'.
bal_log_msg_add( is_msg = VALUE bal_s_msg(
msgty = 'E'
msgno = '009'
msgv1 = iv_tabname
probclass = 1
) ).
EXIT.
ELSE.
MODIFY (iv_tabname) FROM TABLE <gfs_tab> .
IF sy-subrc <> 0.
CALL FUNCTION 'DB_ROLLBACK'.
bal_log_msg_add( is_msg = VALUE bal_s_msg(
msgty = 'E'
msgno = '009'
msgv1 = iv_tabname
) ).
EXIT.
ENDIF.
ENDIF.
CATCH cx_sy_open_sql_db INTO DATA(lx_ref). "SQL errors
cl_message_helper=>set_msg_vars_for_clike( text = lx_ref->get_text( ) ).
bal_log_msg_add( is_msg = VALUE bal_s_msg(
msgty = 'E'
msgno = '006'
msgv1 = sy-msgv1
msgv2 = sy-msgv2
msgv3 = sy-msgv3
msgv4 = sy-msgv4
probclass = 1
) )."& SQL error
sy-subrc = '99'.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
DELETE (iv_tabname) FROM TABLE <gfs_tab_db>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL.
```abap
MODIFY (iv_tabname) FROM TABLE <gfs_tab> .
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,759 |
Find vulnerabilities in this ABAP code snippet. | ```abap
FORM GET_DATA_ZBC_V_IDOC_CFG.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZBC_IDOC_CFG WHERE
(VIM_WHERETAB) .
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM ZBC_IDOC_CFG WHERE
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,760 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD export_all.
TYPES:
BEGIN OF ty_pdat_line,
paramname TYPE string,
varname TYPE c LENGTH 255,
END OF ty_pdat_line,
ty_pdat_lines TYPE STANDARD TABLE OF ty_pdat_line WITH EMPTY KEY,
BEGIN OF ty_pdat_level3,
p0 TYPE REF TO data,
p1 TYPE REF TO data,
p2 TYPE REF TO data,
p3 TYPE REF TO data,
p4 TYPE REF TO data,
p5 TYPE REF TO data,
p6 TYPE REF TO data,
p7 TYPE REF TO data,
p8 TYPE REF TO data,
p9 TYPE REF TO data,
END OF ty_pdat_level3,
BEGIN OF ty_pdat_level2,
p0 TYPE ty_pdat_level3,
p1 TYPE ty_pdat_level3,
p2 TYPE ty_pdat_level3,
p3 TYPE ty_pdat_level3,
p4 TYPE ty_pdat_level3,
p5 TYPE ty_pdat_level3,
p6 TYPE ty_pdat_level3,
p7 TYPE ty_pdat_level3,
p8 TYPE ty_pdat_level3,
p9 TYPE ty_pdat_level3,
END OF ty_pdat_level2,
BEGIN OF ty_pdat_level1,
p0 TYPE ty_pdat_level2,
p1 TYPE ty_pdat_level2,
p2 TYPE ty_pdat_level2,
p3 TYPE ty_pdat_level2,
p4 TYPE ty_pdat_level2,
p5 TYPE ty_pdat_level2,
p6 TYPE ty_pdat_level2,
p7 TYPE ty_pdat_level2,
p8 TYPE ty_pdat_level2,
p9 TYPE ty_pdat_level2,
END OF ty_pdat_level1.
DATA:
p TYPE ty_pdat_level1,
ref_line TYPE REF TO data,
xstring TYPE xstring,
ref_table TYPE REF TO data.
FIELD-SYMBOLS:
<id_field> TYPE ty_id_field,
<srtf2> TYPE i,
<clustr> TYPE numeric,
<clustd> TYPE any,
<table> TYPE STANDARD TABLE,
<database_field> TYPE any.
IF id_new IS NOT INITIAL.
_validate_id_new_type( id_new = id_new tabname = tabname ).
ENDIF.
DATA(properties) = get_info( tabname ).
DATA(level1) = 0.
DATA(level2) = 0.
DATA(level3) = 0.
DATA(pdat_lines) = VALUE ty_pdat_lines( ).
LOOP AT tab_cpar REFERENCE INTO DATA(cpar).
DATA(varname) = |P-P{ level1 }-P{ level2 }-P{ level3 }|.
ASSIGN (varname) TO FIELD-SYMBOL(<var>).
<var> = cpar->dref.
pdat_lines = VALUE #( BASE pdat_lines
( paramname = cpar->name varname = |{ varname }->*| ) ).
level3 = level3 + 1.
IF level3 = 10.
level3 = 0.
level2 = level2 + 1.
IF level2 = 10.
level2 = 0.
level1 = level1 + 1.
IF level1 = 10.
" MORE THAN 1000 DATA OBJECTS !
RAISE EXCEPTION TYPE zcx_expimp_table EXPORTING textid = zcx_expimp_table=>export_too_many_objects.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
TRY.
IF compression = abap_false.
EXPORT (pdat_lines) TO DATA BUFFER xstring COMPRESSION OFF.
ELSE.
EXPORT (pdat_lines) TO DATA BUFFER xstring COMPRESSION ON.
ENDIF.
CATCH cx_sy_compression_error cx_sy_export_buffer_no_memory INTO DATA(lx_export).
RAISE EXCEPTION TYPE zcx_expimp_table EXPORTING textid = zcx_expimp_table=>export_data_buffer_error.
ENDTRY.
CREATE DATA ref_line TYPE (tabname).
ASSIGN ref_line->* TO FIELD-SYMBOL(<line>).
" CLIENT
IF properties-client_fieldname IS NOT INITIAL.
ASSIGN COMPONENT properties-client_fieldname OF STRUCTURE <line> TO FIELD-SYMBOL(<client>).
ASSERT sy-subrc = 0.
<client> = client.
ENDIF.
" AREA
ASSIGN COMPONENT 'RELID' OF STRUCTURE <line> TO FIELD-SYMBOL(<relid>).
ASSERT sy-subrc = 0.
<relid> = area.
" ID fields
LOOP AT properties-id_fields ASSIGNING <id_field>.
ASSIGN COMPONENT <id_field>-fieldname OF STRUCTURE <line> TO <database_field>.
ASSERT sy-subrc = 0.
IF id_new IS NOT INITIAL.
ASSIGN COMPONENT <id_field>-fieldname OF STRUCTURE id_new TO FIELD-SYMBOL(<id_new_field>).
IF sy-subrc = 0.
<database_field> = <id_new_field>.
ENDIF.
ELSE.
DATA(len) = nmin( val1 = <id_field>-length val2 = strlen( id ) - <id_field>-offset ).
IF len = 0.
EXIT.
ENDIF.
<database_field> = id+<id_field>-offset(<id_field>-length).
ENDIF.
ENDLOOP.
IF wa IS NOT INITIAL.
LOOP AT properties-attr_fieldnames ASSIGNING FIELD-SYMBOL(<attr_fieldname>).
ASSIGN COMPONENT <attr_fieldname> OF STRUCTURE <line> TO <database_field>.
IF sy-subrc = 0.
ASSIGN COMPONENT <attr_fieldname> OF STRUCTURE wa TO FIELD-SYMBOL(<wa_field>).
<database_field> = <wa_field>.
ENDIF.
ENDLOOP.
ENDIF.
" Transfer XSTRING to the Export/Import Table
CREATE DATA ref_table TYPE TABLE OF (tabname).
ASSIGN ref_table->* TO <table>.
IF properties-is_structure_one_row = abap_false.
ASSIGN COMPONENT 'SRTF2' OF STRUCTURE <line> TO <srtf2>.
ASSERT sy-subrc = 0.
ASSIGN COMPONENT 'CLUSTR' OF STRUCTURE <line> TO <clustr>.
ASSERT sy-subrc = 0.
ASSIGN COMPONENT 'CLUSTD' OF STRUCTURE <line> TO <clustd>.
ASSERT sy-subrc = 0.
DATA(offset) = 0.
<srtf2> = 0.
WHILE offset < xstrlen( xstring ).
<clustd> = xstring+offset.
offset = offset + properties-clustd_length.
IF offset < xstrlen( xstring ).
<clustr> = properties-clustd_length.
ELSE.
" last line
<clustr> = xstrlen( xstring ) - offset + properties-clustd_length.
ENDIF.
APPEND <line> TO <table>.
ADD 1 TO <srtf2>.
ENDWHILE.
ELSE.
ASSIGN COMPONENT 'CLUSTD' OF STRUCTURE <line> TO <clustd>.
ASSERT sy-subrc = 0.
<clustd> = xstring.
APPEND <line> TO <table>.
ENDIF.
MODIFY (tabname) FROM TABLE <table>.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_expimp_table EXPORTING textid = zcx_expimp_table=>database_error.
ENDIF.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
MODIFY (tabname) FROM TABLE <table>.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,761 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD import_as_xstring.
DATA:
ref_table TYPE REF TO data,
where TYPE string,
length TYPE i.
FIELD-SYMBOLS:
<id_field> TYPE ty_id_field,
<id_new_field> TYPE clike,
<table> TYPE STANDARD TABLE,
<wa_fieldname> TYPE any,
<line_bytes> TYPE x,
<clustd> TYPE any,
<first_line> TYPE any,
<length2> TYPE int2,
<length4> TYPE i,
<database_field> TYPE any,
<wa_field> TYPE any.
xstring = VALUE #( ).
CLEAR wa.
IF id_new IS NOT INITIAL.
_validate_id_new_type( id_new = id_new tabname = tabname ).
ENDIF.
DATA(info) = get_info( tabname ).
where = _build_where(
tabname = tabname
client = client
area = area
id = id
id_new = id_new
info = info ).
" The following
" SELECT * FROM (table_name) CLIENT SPECIFIED
" WHERE <client-field> = client
" AND <area-field> = area
" AND <id-field1> = <substring-1-of-id>
" AND <id-field2> = <substring-2-of-id>
" AND ...
" INTO TABLE <table>.
" wa-field1 = <table>[ 1 ]-field1.
" wa-field2 = <table>[ 1 ]-field2.
" (which is equivalent to
" IMPORT (all-fields) FROM DATABASE <table>(<area>) TO <wa> CLIENT <client> ID <id>
" )
CREATE DATA ref_table TYPE TABLE OF (tabname).
ASSIGN ref_table->* TO <table>.
SELECT * FROM (tabname) CLIENT SPECIFIED
INTO TABLE <table>
WHERE (where).
IF sy-subrc <> 0.
" EMPTY
RETURN.
ENDIF.
" Sort by SRTF2 ascending
SORT <table> BY table_line.
" XSTRING
IF info-is_structure_one_row = abap_false.
CLEAR xstring.
LOOP AT <table> ASSIGNING <line_bytes> CASTING.
ASSIGN <line_bytes>+info-offset_clustr(2) TO <length2> CASTING.
IF <length2> <> 0.
CONCATENATE xstring <line_bytes>+info-offset_clustd(<length2>) INTO xstring IN BYTE MODE.
ELSE.
ASSERT 1 = 1. " Weird - That happened in table COVREF in 7.52 SP 0 developer edition.
ENDIF.
ENDLOOP.
ELSE.
ASSIGN <table>[ 1 ] TO <first_line>.
ASSIGN COMPONENT 'CLUSTD' OF STRUCTURE <first_line> TO <clustd>.
ASSERT sy-subrc = 0.
xstring = <clustd>.
ENDIF.
" WA (+ avoid errors in case parameter WA is not passed/is not a structure)
DATA(rtti_wa) = cl_abap_typedescr=>describe_by_data( wa ).
IF rtti_wa->kind = rtti_wa->kind_struct.
ASSIGN <table>[ 1 ] TO <first_line>.
wa = CORRESPONDING #( <first_line> ).
ENDIF.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (tabname) CLIENT SPECIFIED
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,762 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT lt_objects ASSIGNING <object>.
DELETE FROM /inw/enhema_set WHERE guid = <object>-object_guid.
IF sy-subrc = 0.
WRITE: / 'Einstellungen für Objekt', <object>-control_name, 'gelöscht.'.
ELSE.
WRITE: / 'Keine Einstellungen vorhanden für', <object>-control_name.
ENDIF.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
DELETE FROM /inw/enhema_set WHERE guid = <object>-object_guid.
```
Explanation: Modify only own DB tables. | 1,763 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY .
SELECT * FROM (ms_settings-structure_name) INTO TABLE <data> UP TO 40 ROWS.
CATCH cx_root INTO DATA(lx_root).
MESSAGE lx_root TYPE 'S'.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (ms_settings-structure_name) INTO TABLE <data> UP TO 40 ROWS.
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,764 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY .
SELECT * FROM (zguidrasil_setting_gridp-structure_name)
INTO TABLE <data> UP TO 40 ROWS.
CATCH cx_root INTO DATA(lx_root).
MESSAGE lx_root TYPE 'I'.
RETURN.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (zguidrasil_setting_gridp-structure_name)
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,765 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD get_kernel_release.
* Kernel Info retrival copied from FuGrp SHSY Module get_kinfo
TYPES:
BEGIN OF ty_kernel_info,
key TYPE c LENGTH 21,
data TYPE c LENGTH 400,
END OF ty_kernel_info.
DATA:
lt_kernel_info TYPE STANDARD TABLE OF ty_kernel_info,
lo_kernel_info TYPE REF TO ty_kernel_info.
* Kernel Release Information
CALL 'SAPCORE'
ID 'ID' FIELD 'VERSION'
ID 'TABLE' FIELD lt_kernel_info. "#EC CI_CCALL
READ TABLE lt_kernel_info REFERENCE INTO lo_kernel_info INDEX 12.
IF sy-subrc = 0.
rs_details-release = lo_kernel_info->data.
ENDIF.
READ TABLE lt_kernel_info REFERENCE INTO lo_kernel_info INDEX 15.
IF sy-subrc = 0.
rs_details-patch = lo_kernel_info->data.
ENDIF.
* 32- or 64-bit Kernel
READ TABLE lt_kernel_info REFERENCE INTO lo_kernel_info INDEX 3.
IF sy-subrc = 0 AND lo_kernel_info->data CS '64'.
rs_details-version = 64.
ELSE.
rs_details-version = 32.
ENDIF.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
CALL 'SAPCORE'
```
Explanation: Potential dangerous statement KERNEL CALL. | 1,767 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD set_user_parameter.
" Save parameter to user record
DATA ls_usr05 TYPE usr05.
ls_usr05-mandt = sy-mandt.
ls_usr05-bname = sy-uname.
ls_usr05-parid = iv_parameter.
ls_usr05-parva = iv_value.
MODIFY usr05 FROM ls_usr05 ##SUBRC_OK.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
MODIFY usr05 FROM ls_usr05 ##SUBRC_OK.
```
Explanation: Modify only own DB tables. | 1,768 |
Find vulnerabilities in this ABAP code snippet. | ```abap
TRY.
CREATE DATA lr_data TYPE ('SPFL_PARAMETER_LIST_T').
ASSIGN lr_data->* TO <lt_parameters> ##SUBRC_OK.
" Dynamic call since class is not available in lower releases
CALL METHOD ('CL_SPFL_PROFILE_PARAMETER')=>('GET_ALL_PARAMETER')
IMPORTING
parameter_sub = <lt_parameters>.
LOOP AT <lt_parameters> ASSIGNING <ls_parameter>.
ASSIGN COMPONENT 'NAME' OF STRUCTURE <ls_parameter> TO <lv_name> ##SUBRC_OK.
ASSIGN COMPONENT 'USER_VALUE' OF STRUCTURE <ls_parameter> TO <lv_value> ##SUBRC_OK.
IF <lv_value> IS INITIAL.
ASSIGN COMPONENT 'DEFAULT_VALUE' OF STRUCTURE <ls_parameter> TO <lv_value> ##SUBRC_OK.
ENDIF.
ro_parameters->set(
iv_key = <lv_name>
iv_val = <lv_value> ).
" Original parameter name
ro_parameters->set(
iv_key = c_original_name && <lv_name>
iv_val = <lv_name> ).
ENDLOOP.
CATCH cx_root.
" For lower releases resort to c-call
CALL 'C_SAPGALLPARAM'
ID 'PAR_SUB' FIELD lt_par_sub. "#EC CI_CCALL
LOOP AT lt_par_sub ASSIGNING <ls_par_sub>.
ASSIGN COMPONENT 'PNAME' OF STRUCTURE <ls_par_sub> TO <lv_name> ##SUBRC_OK.
ASSIGN COMPONENT 'USER_WERT' OF STRUCTURE <ls_par_sub> TO <lv_value> ##SUBRC_OK.
IF <lv_value> IS INITIAL.
ASSIGN COMPONENT 'DEFAULT_WERT' OF STRUCTURE <ls_par_sub> TO <lv_value> ##SUBRC_OK.
ENDIF.
ro_parameters->set(
iv_key = |{ <lv_name> }|
iv_val = |{ <lv_value> }| ).
" Original parameter name
ro_parameters->set(
iv_key = c_original_name && <lv_name>
iv_val = <lv_name> ).
ENDLOOP.
ENDTRY.
``` | I found vulnerabilities in the line:
```abap
CALL 'C_SAPGALLPARAM'
```
Explanation: Potential dangerous statement KERNEL CALL. | 1,769 |
Find vulnerabilities in this ABAP code snippet. | ```abap
METHOD sync.
" Installer persistence
CONSTANTS lc_tabname TYPE tabname VALUE 'ZMBTINST'.
DATA:
lv_name TYPE string,
ls_inst TYPE ty_inst,
ls_cont TYPE ty_content.
lv_name = io_tool->get_name( ).
SELECT SINGLE * FROM (lc_tabname) INTO ls_cont WHERE name = lv_name.
IF sy-subrc = 0.
ls_inst-pack = io_tool->get_package( ).
ls_inst-version = io_tool->get_version( ).
ls_inst-sem_version = /mbtools/cl_version=>convert_string_to_version( ls_inst-version ).
ls_inst-description = io_tool->get_description( ).
ls_inst-source_type = 'INTERNET'.
ls_inst-source_name = io_tool->get_url_download( ).
ls_inst-transport = ''.
ls_inst-folder_logic = 'PREFIX'.
ls_inst-installed_langu = 'E'.
ls_inst-installed_by = sy-uname.
ls_inst-installed_at = io_tool->get_last_update( abap_true ).
ls_inst-status = 'I'.
" Update
ls_cont = _sync_json( ls_inst ).
UPDATE (lc_tabname) FROM ls_cont.
IF sy-subrc <> 0.
/mbtools/cx_exception=>raise( 'Error updating MBT Installer persistence'(003) ).
ENDIF.
ELSE.
ls_inst-name = io_tool->get_name( ).
ls_inst-pack = io_tool->get_package( ).
ls_inst-version = io_tool->get_version( ).
ls_inst-sem_version = /mbtools/cl_version=>convert_string_to_version( ls_inst-version ).
ls_inst-description = io_tool->get_description( ).
ls_inst-source_type = 'INTERNET'.
ls_inst-source_name = io_tool->get_url_download( ).
ls_inst-transport = ''.
ls_inst-folder_logic = 'PREFIX'.
ls_inst-installed_langu = 'E'.
ls_inst-installed_by = sy-uname.
ls_inst-installed_at = io_tool->get_last_update( abap_true ).
ls_inst-status = 'I'.
" Insert
ls_cont = _sync_json( ls_inst ).
INSERT (lc_tabname) FROM ls_cont.
IF sy-subrc <> 0.
/mbtools/cx_exception=>raise( 'Error inserting MBT Installer persistence'(002) ).
ENDIF.
ENDIF.
rv_result = abap_true.
ENDMETHOD.
``` | I found vulnerabilities in the line:
```abap
SELECT SINGLE * FROM (lc_tabname) INTO ls_cont WHERE name = lv_name.
```
Explanation: Potential dangerous statement Dynamic SQL.
```abap
INSERT (lc_tabname) FROM ls_cont.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,770 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc = 0.
ls_inst-pack = io_tool->get_package( ).
ls_inst-version = io_tool->get_version( ).
ls_inst-sem_version = /mbtools/cl_version=>convert_string_to_version( ls_inst-version ).
ls_inst-description = io_tool->get_description( ).
ls_inst-source_type = 'INTERNET'.
ls_inst-source_name = io_tool->get_url_download( ).
ls_inst-transport = ''.
ls_inst-folder_logic = 'PREFIX'.
ls_inst-installed_langu = 'E'.
ls_inst-installed_by = sy-uname.
ls_inst-installed_at = io_tool->get_last_update( abap_true ).
ls_inst-status = 'I'.
" Update
ls_cont = _sync_json( ls_inst ).
UPDATE (lc_tabname) FROM ls_cont.
IF sy-subrc <> 0.
/mbtools/cx_exception=>raise( 'Error updating MBT Installer persistence'(003) ).
ENDIF.
``` | I found vulnerabilities in the line:
```abap
UPDATE (lc_tabname) FROM ls_cont.
```
Explanation: Modify only own DB tables | Potential dangerous statement Dynamic SQL. | 1,771 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT it_where INTO lv_where.
SELECT * FROM (iv_name) APPENDING TABLE <lg_tab> WHERE (lv_where).
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
ASSIGN rr_data->* TO <lg_tab>.
LOOP AT it_where INTO lv_where.
SELECT * FROM (iv_name) APPENDING TABLE <lg_tab> WHERE (lv_where). * <-- There is a problem here
ENDLOOP.
IF lines( it_where ) = 0.
SELECT * FROM (iv_name) INTO TABLE <lg_tab>.
```
Explanation: Potential dangerous statement Dynamic SQL.
```abap
ASSIGN rr_data->* TO <lg_tab>.
LOOP AT it_where INTO lv_where.
SELECT * FROM (iv_name) APPENDING TABLE <lg_tab> WHERE (lv_where). * <-- There is a problem here
ENDLOOP.
IF lines( it_where ) = 0.
SELECT * FROM (iv_name) INTO TABLE <lg_tab>.
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,772 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF lines( it_where ) = 0.
SELECT * FROM (iv_name) INTO TABLE <lg_tab>.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
SELECT * FROM (iv_name) APPENDING TABLE <lg_tab> WHERE (lv_where).
ENDLOOP.
IF lines( it_where ) = 0.
SELECT * FROM (iv_name) INTO TABLE <lg_tab>. * <-- There is a problem here
ENDIF.
ENDMETHOD.
```
Explanation: Potential dangerous statement Dynamic SQL.
```abap
SELECT * FROM (iv_name) APPENDING TABLE <lg_tab> WHERE (lv_where).
ENDLOOP.
IF lines( it_where ) = 0.
SELECT * FROM (iv_name) INTO TABLE <lg_tab>. * <-- There is a problem here
ENDIF.
lv_records = lines( <lg_tab> ).
```
Explanation: Potential dangerous statement Dynamic SQL. | 1,773 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc = 3.
" For cases that standard function does not handle (like FUGR),
" we save active and inactive version of source with the given PROGRAM TYPE.
" Without the active version, the code will not be visible in case of activation errors.
INSERT REPORT is_progdir-name
FROM it_source
STATE 'A'
PROGRAM TYPE is_progdir-subc.
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
PROGRAM TYPE is_progdir-subc.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from INSERT REPORT .. PROGRAM TYPE' ).
ENDIF.
``` | I found vulnerabilities in the line:
```abap
INSERT REPORT is_progdir-name * <-- There is a problem here
FROM it_source
STATE 'A'
```
Explanation: Potential dangerous statement INSERT REPORT.
```abap
PROGRAM TYPE is_progdir-subc.
INSERT REPORT is_progdir-name * <-- There is a problem here
FROM it_source
```
Explanation: Potential dangerous statement INSERT REPORT. | 1,779 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc = 0 AND is_progdir-varcl <> ls_progdir_new-varcl.
UPDATE progdir SET varcl = is_progdir-varcl
WHERE name = ls_progdir_new-name
AND state = ls_progdir_new-state. "#EC CI_SUBRC
ENDIF.
``` | I found vulnerabilities in the line:
```abap
UPDATE progdir SET varcl = is_progdir-varcl
```
Explanation: Modify only own DB tables. | 1,781 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF lt_old <> it_source.
INSERT REPORT iv_program FROM it_source.
ASSERT sy-subrc = 0.
rv_updated = abap_true.
ELSE.
``` | I found vulnerabilities in the line:
```abap
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Fatal error. Include { iv_program } should have been created previously!| ).
ENDIF.
IF lt_old <> it_source.
INSERT REPORT iv_program FROM it_source. * <-- There is a problem here
ASSERT sy-subrc = 0.
rv_updated = abap_true.
ELSE.
rv_updated = abap_false.
ENDIF.
```
Explanation: Potential dangerous statement INSERT REPORT.
```abap
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Fatal error. Include { iv_program } should have been created previously!| ).
ENDIF.
IF lt_old <> it_source.
INSERT REPORT iv_program FROM it_source. * <-- There is a problem here
ASSERT sy-subrc = 0.
rv_updated = abap_true.
ELSE.
rv_updated = abap_false.
ENDIF.
```
Explanation: Potential dangerous statement INSERT REPORT. | 1,786 |
Find vulnerabilities in this ABAP code snippet. | ```abap
CLASS zcl_abapgit_object_msag IMPLEMENTATION.
METHOD delete_documentation.
DATA: lv_key_s TYPE dokhl-object.
CLEAR lv_key_s.
CALL FUNCTION 'DOCU_OBJECT_NAME_CONCATENATE'
EXPORTING
docu_id = 'NA'
element = iv_message_id
addition = ' '
IMPORTING
object = lv_key_s
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'DOKU_DELETE_ALL'
EXPORTING
doku_id = 'NA'
doku_object = lv_key_s
generic_use = 'X'
suppress_authority = space
suppress_enqueue = space
suppress_transport = space
EXCEPTIONS
header_without_text = 01
index_without_header = 02
no_authority_for_devclass_xxxx = 03
no_docu_found = 04
object_is_already_enqueued = 05
object_is_enqueued_by_corr = 06
user_break = 07.
ENDMETHOD.
METHOD delete_msgid.
delete_documentation( iv_message_id ).
DELETE FROM t100a WHERE arbgb = iv_message_id.
IF sy-subrc = 0 OR sy-subrc = 4.
CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT'
EXPORTING
object = iv_message_id
operation = 'DELETE'
program = space
type = 'CN'.
DELETE FROM t100o WHERE arbgb = iv_message_id.
DELETE FROM t100t WHERE arbgb = iv_message_id. "#EC CI_NOFIRST
DELETE FROM t100u WHERE arbgb = iv_message_id.
DELETE FROM t100x WHERE arbgb = iv_message_id.
DELETE FROM t100 WHERE arbgb = iv_message_id.
ENDIF.
ENDMETHOD.
METHOD deserialize_texts.
DATA: lv_msg_id TYPE rglif-message_id,
ls_t100 TYPE t100,
lt_t100t TYPE TABLE OF t100t,
lt_t100_texts TYPE ty_t100_texts,
lt_t100u TYPE TABLE OF t100u.
FIELD-SYMBOLS: <ls_t100_text> TYPE ty_t100_text.
lv_msg_id = ms_item-obj_name.
SELECT * FROM t100u INTO TABLE lt_t100u
WHERE arbgb = lv_msg_id ORDER BY PRIMARY KEY. "#EC CI_GENBUFF
ii_xml->read( EXPORTING iv_name = 'T100_TEXTS'
CHANGING cg_data = lt_t100_texts ).
ii_xml->read( EXPORTING iv_name = 'T100T'
CHANGING cg_data = lt_t100t ).
MODIFY t100t FROM TABLE lt_t100t. "#EC CI_SUBRC
LOOP AT lt_t100_texts ASSIGNING <ls_t100_text>.
"check if message exists
READ TABLE lt_t100u TRANSPORTING NO FIELDS
WITH KEY arbgb = lv_msg_id msgnr = <ls_t100_text>-msgnr BINARY SEARCH.
CHECK sy-subrc = 0. "if original message doesn't exist no translations added
MOVE-CORRESPONDING <ls_t100_text> TO ls_t100.
ls_t100-arbgb = lv_msg_id.
MODIFY t100 FROM ls_t100.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD free_access_permission.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
mode = 'FREE'
object = iv_message_id
object_class = 'T100'.
ENDMETHOD.
METHOD serialize_longtexts_msag.
DATA: lv_doku_object_name TYPE dokhl-object,
lt_doku_object_names TYPE STANDARD TABLE OF dokhl-object
WITH NON-UNIQUE DEFAULT KEY,
lt_dokil TYPE zif_abapgit_definitions=>ty_dokil_tt,
ls_dokil LIKE LINE OF lt_dokil.
FIELD-SYMBOLS: <ls_t100> TYPE t100.
IF lines( it_t100 ) = 0.
RETURN.
ENDIF.
LOOP AT it_t100 ASSIGNING <ls_t100>.
lv_doku_object_name = <ls_t100>-arbgb && <ls_t100>-msgnr.
INSERT lv_doku_object_name INTO TABLE lt_doku_object_names.
ENDLOOP.
IF ii_xml->i18n_params( )-main_language_only = abap_true.
SELECT * FROM dokil
INTO TABLE lt_dokil
FOR ALL ENTRIES IN lt_doku_object_names
WHERE id = 'NA'
AND object = lt_doku_object_names-table_line
AND masterlang = abap_true
ORDER BY PRIMARY KEY.
ELSE.
SELECT * FROM dokil
INTO TABLE lt_dokil
FOR ALL ENTRIES IN lt_doku_object_names
WHERE id = 'NA'
AND object = lt_doku_object_names-table_line
ORDER BY PRIMARY KEY.
ENDIF.
CLEAR ls_dokil-dokstate.
MODIFY lt_dokil FROM ls_dokil TRANSPORTING dokstate WHERE dokstate IS NOT INITIAL.
IF lines( lt_dokil ) > 0.
serialize_longtexts( ii_xml = ii_xml
it_dokil = lt_dokil ).
ENDIF.
ENDMETHOD.
METHOD serialize_texts.
DATA: lv_msg_id TYPE rglif-message_id,
lt_t100_texts TYPE ty_t100_texts,
lt_t100t TYPE TABLE OF t100t,
lt_i18n_langs TYPE TABLE OF langu.
lv_msg_id = ms_item-obj_name.
IF ii_xml->i18n_params( )-main_language_only = abap_true.
RETURN. " skip
ENDIF.
" Collect additional languages
" Skip main lang - it has been already serialized
SELECT DISTINCT sprsl AS langu INTO TABLE lt_i18n_langs
FROM t100t
WHERE arbgb = lv_msg_id
AND sprsl <> mv_language. "#EC CI_BYPASS "#EC CI_GENBUFF
SORT lt_i18n_langs ASCENDING.
IF lines( lt_i18n_langs ) > 0.
SELECT * FROM t100t INTO CORRESPONDING FIELDS OF TABLE lt_t100t
WHERE sprsl <> mv_language
AND arbgb = lv_msg_id. "#EC CI_GENBUFF
SELECT * FROM t100 INTO CORRESPONDING FIELDS OF TABLE lt_t100_texts
FOR ALL ENTRIES IN lt_i18n_langs
WHERE sprsl = lt_i18n_langs-table_line
AND arbgb = lv_msg_id
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
SORT lt_t100t BY sprsl ASCENDING.
SORT lt_t100_texts BY sprsl msgnr ASCENDING.
ii_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
ii_xml->add( iv_name = 'T100T'
ig_data = lt_t100t ).
ii_xml->add( iv_name = 'T100_TEXTS'
ig_data = lt_t100_texts ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE lastuser FROM t100a INTO rv_user
WHERE arbgb = ms_item-obj_name. "#EC CI_GENBUFF
IF sy-subrc <> 0 OR rv_user = ''.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: ls_t100a TYPE t100a,
lv_frozen TYPE abap_bool,
lv_message_id TYPE arbgb,
lv_access_granted TYPE abap_bool.
* parameter SUPPRESS_DIALOG doesnt exist in all versions of FM RS_DELETE_MESSAGE_ID
* replaced with a copy
lv_message_id = ms_item-obj_name.
IF ms_item-obj_name = space.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."blank message id
ENDIF.
SELECT SINGLE * FROM t100a INTO ls_t100a WHERE arbgb = ms_item-obj_name.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."not found
ENDIF.
CLEAR lv_frozen.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
authority_check = 'X'
global_lock = 'X'
mode = 'MODIFY'
object = lv_message_id
object_class = 'T100'
IMPORTING
frozen = lv_frozen
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_frozen <> space.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
lv_access_granted = abap_true.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
global_lock = 'X'
object = lv_message_id
object_class = 'MSAG'
mode = 'D'
suppress_dialog = abap_true
EXCEPTIONS
cancelled = 01
permission_failure = 02.
IF sy-subrc <> 0.
IF lv_access_granted = abap_true.
free_access_permission( lv_message_id ).
ENDIF.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
delete_msgid( lv_message_id ).
IF lv_access_granted = abap_true.
free_access_permission( lv_message_id ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* fm RPY_MESSAGE_ID_INSERT almost works, but not in older versions
DATA: ls_t100a TYPE t100a,
ls_t100t TYPE t100t,
ls_t100u TYPE t100u,
lt_t100 TYPE TABLE OF t100,
lt_before TYPE TABLE OF t100u.
FIELD-SYMBOLS: <ls_t100> LIKE LINE OF lt_t100.
io_xml->read( EXPORTING iv_name = 'T100A'
CHANGING cg_data = ls_t100a ).
io_xml->read( EXPORTING iv_name = 'T100'
CHANGING cg_data = lt_t100 ).
corr_insert( iv_package ).
SELECT * FROM t100u INTO TABLE lt_before
WHERE arbgb = ls_t100a-arbgb ORDER BY msgnr. "#EC CI_GENBUFF "#EC CI_BYPASS
LOOP AT lt_t100 ASSIGNING <ls_t100>.
DELETE lt_before WHERE msgnr = <ls_t100>-msgnr.
MODIFY t100 FROM <ls_t100>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
CLEAR ls_t100u.
MOVE-CORRESPONDING <ls_t100> TO ls_t100u ##enh_ok.
ls_t100u-name = sy-uname.
ls_t100u-datum = sy-datum.
ls_t100u-selfdef = '3'.
MODIFY t100u FROM ls_t100u.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100U modify failed' ).
ENDIF.
ENDLOOP.
ls_t100a-masterlang = mv_language.
ls_t100a-lastuser = sy-uname.
ls_t100a-respuser = sy-uname.
ls_t100a-ldate = sy-datum.
ls_t100a-ltime = sy-uzeit.
MODIFY t100a FROM ls_t100a.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100A modify failed' ).
ENDIF.
ls_t100t-sprsl = mv_language.
ls_t100t-arbgb = ls_t100a-arbgb.
ls_t100t-stext = ls_t100a-stext.
MODIFY t100t FROM ls_t100t.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100T modify failed' ).
ENDIF.
LOOP AT lt_before INTO ls_t100u.
DELETE FROM t100 WHERE arbgb = ls_t100u-arbgb
AND msgnr = ls_t100u-msgnr. "#EC CI_SUBRC
DELETE FROM t100u WHERE arbgb = ls_t100u-arbgb
AND msgnr = ls_t100u-msgnr. "#EC CI_SUBRC
ENDLOOP.
deserialize_longtexts( io_xml ).
deserialize_texts( io_xml ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_arbgb TYPE t100a-arbgb.
SELECT SINGLE arbgb FROM t100a INTO lv_arbgb
WHERE arbgb = ms_item-obj_name. "#EC CI_GENBUFF
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lv_argument TYPE seqg3-garg.
lv_argument = |{ ms_item-obj_name }|.
OVERLAY lv_argument WITH ' '.
lv_argument = lv_argument && '*'.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = |ES_MSGSI|
iv_argument = lv_argument ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = 'MSAG'
in_new_window = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_msg_id TYPE rglif-message_id,
ls_inf TYPE t100a,
lt_source TYPE ty_t100s.
lv_msg_id = ms_item-obj_name.
SELECT SINGLE * FROM t100a INTO ls_inf
WHERE arbgb = lv_msg_id. "#EC CI_GENBUFF
IF sy-subrc <> 0.
RETURN.
ENDIF.
CLEAR ls_inf-respuser.
SELECT * FROM t100 INTO TABLE lt_source
WHERE sprsl = mv_language
AND arbgb = lv_msg_id
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
CLEAR: ls_inf-lastuser,
ls_inf-ldate,
ls_inf-ltime.
io_xml->add( iv_name = 'T100A'
ig_data = ls_inf ).
io_xml->add( ig_data = lt_source
iv_name = 'T100' ).
serialize_longtexts_msag( it_t100 = lt_source
ii_xml = io_xml ).
serialize_texts( io_xml ).
ENDMETHOD.
ENDCLASS.
``` | I found vulnerabilities in the line:
```abap
MODIFY t100a FROM ls_t100a.
```
Explanation: Modify only own DB tables.
```abap
MODIFY t100t FROM ls_t100t.
```
Explanation: Modify only own DB tables. | 1,795 |
Find vulnerabilities in this ABAP code snippet. | ```abap
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
ls_trnspacett-namespace = iv_namespace.
READ TABLE lt_nspc_texts ASSIGNING <ls_nspc_text> WITH KEY spras = <lv_lang>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |NSPC_TEXTS cannot find lang { <lv_lang> } in XML| ).
ENDIF.
MOVE-CORRESPONDING <ls_nspc_text> TO ls_trnspacett.
MODIFY trnspacett FROM ls_trnspacett.
IF sy-subrc <> 0.
INSERT trnspacett FROM ls_trnspacett.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error upserting text for namespace| ).
ENDIF.
ENDLOOP.
``` | I found vulnerabilities in the line:
```abap
MODIFY trnspacett FROM ls_trnspacett. * <-- There is a problem here
IF sy-subrc <> 0.
```
Explanation: Modify only own DB tables. | 1,797 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc <> 0.
INSERT trnspacett FROM ls_trnspacett.
ENDIF.
``` | I found vulnerabilities in the line:
```abap
IF sy-subrc <> 0.
INSERT trnspacett FROM ls_trnspacett. * <-- There is a problem here
ENDIF.
```
Explanation: Modify only own DB tables. | 1,798 |
Find vulnerabilities in this ABAP code snippet. | ```abap
CLASS zcl_abapgit_object_nspc IMPLEMENTATION.
METHOD add_to_transport.
DATA: li_sap_package TYPE REF TO zif_abapgit_sap_package.
li_sap_package = zcl_abapinst_factory=>get_sap_package( iv_package ).
IF li_sap_package->are_changes_recorded_in_tr_req( ) = abap_true.
corr_insert( iv_package ).
ENDIF.
ENDMETHOD.
METHOD deserialize_texts.
DATA:
ls_trnspacett TYPE trnspacett,
lt_i18n_langs TYPE TABLE OF langu,
lt_nspc_texts TYPE ty_nspc_texts.
FIELD-SYMBOLS:
<lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_nspc_text> LIKE LINE OF lt_nspc_texts.
ii_xml->read( EXPORTING iv_name = 'I18N_LANGS'
CHANGING cg_data = lt_i18n_langs ).
ii_xml->read( EXPORTING iv_name = 'NSPC_TEXTS'
CHANGING cg_data = lt_nspc_texts ).
SORT lt_i18n_langs.
SORT lt_nspc_texts BY spras. " Optimization
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
ls_trnspacett-namespace = iv_namespace.
READ TABLE lt_nspc_texts ASSIGNING <ls_nspc_text> WITH KEY spras = <lv_lang>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |NSPC_TEXTS cannot find lang { <lv_lang> } in XML| ).
ENDIF.
MOVE-CORRESPONDING <ls_nspc_text> TO ls_trnspacett.
MODIFY trnspacett FROM ls_trnspacett.
IF sy-subrc <> 0.
INSERT trnspacett FROM ls_trnspacett.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error upserting text for namespace| ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD serialize_texts.
DATA:
ls_trnspacett TYPE trnspacett,
lt_nspc_texts TYPE ty_nspc_texts,
lt_i18n_langs TYPE TABLE OF langu.
FIELD-SYMBOLS:
<lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_nspc_text> LIKE LINE OF lt_nspc_texts.
IF ii_xml->i18n_params( )-main_language_only = abap_true.
RETURN.
ENDIF.
" Collect additional languages, skip main lang - it was serialized already
SELECT DISTINCT spras AS langu FROM trnspacett INTO TABLE lt_i18n_langs
WHERE namespace = ms_item-obj_name AND spras <> mv_language. "#EC CI_SUBRC
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
SELECT SINGLE * FROM trnspacett INTO ls_trnspacett
WHERE namespace = ms_item-obj_name AND spras = <lv_lang>.
IF sy-subrc = 0.
APPEND INITIAL LINE TO lt_nspc_texts ASSIGNING <ls_nspc_text>.
MOVE-CORRESPONDING ls_trnspacett TO <ls_nspc_text>.
ENDIF.
ENDLOOP.
SORT lt_i18n_langs ASCENDING.
SORT lt_nspc_texts BY spras ASCENDING.
IF lines( lt_i18n_langs ) > 0.
ii_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
ii_xml->add( iv_name = 'NSPC_TEXTS'
ig_data = lt_nspc_texts ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE changeuser FROM trnspacet INTO rv_user
WHERE namespace = ms_item-obj_name.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
RETURN. " not supported
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA:
ls_nspc TYPE ty_nspc,
ls_nspc_text TYPE ty_nspc_text,
lv_modifiable TYPE abap_bool,
ls_trnspacet TYPE trnspacet,
ls_trnspacett TYPE trnspacett.
io_xml->read( EXPORTING iv_name = 'NSPC'
CHANGING cg_data = ls_nspc ).
io_xml->read( EXPORTING iv_name = 'NSPC_TEXT'
CHANGING cg_data = ls_nspc_text ).
add_to_transport( iv_package ).
SELECT SINGLE * FROM trnspacet INTO ls_trnspacet WHERE namespace = ls_nspc-namespace.
IF sy-subrc = 0.
" For existing namespace, check if it's modifiable (SE03)
SELECT SINGLE editflag FROM trnspace INTO lv_modifiable WHERE namespace = ls_nspc-namespace.
IF sy-subrc = 0 AND lv_modifiable = abap_false.
zcx_abapgit_exception=>raise( |Namespace is not modifiable| ).
ENDIF.
" keep existing role
ls_trnspacet-replicense = ls_nspc-replicense.
ls_trnspacet-sscrflag = ls_nspc-sscrflag.
ls_trnspacet-sapflag = ls_nspc-sapflag.
ls_trnspacet-gen_only = ls_nspc-gen_only.
ls_trnspacet-changeuser = sy-uname.
ls_trnspacet-changedate = sy-datum.
MODIFY trnspacet FROM ls_trnspacet.
ELSE.
MOVE-CORRESPONDING ls_nspc TO ls_trnspacet.
ls_trnspacet-role = 'C'. " customer repair license
ls_trnspacet-changeuser = sy-uname.
ls_trnspacet-changedate = sy-datum.
INSERT trnspacet FROM ls_trnspacet.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error upserting namespace| ).
ENDIF.
SELECT SINGLE * FROM trnspacett INTO ls_trnspacett
WHERE namespace = ls_nspc-namespace AND spras = mv_language.
IF sy-subrc = 0.
ls_trnspacett-descriptn = ls_nspc_text-descriptn.
ls_trnspacett-owner = ls_nspc_text-owner.
MODIFY trnspacett FROM ls_trnspacett.
ELSE.
MOVE-CORRESPONDING ls_nspc_text TO ls_trnspacett.
ls_trnspacett-namespace = ls_nspc-namespace.
INSERT trnspacett FROM ls_trnspacett.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error upserting text for namespace| ).
ENDIF.
deserialize_texts( ii_xml = io_xml
iv_namespace = ls_nspc-namespace ).
" Fill trnspace and trnspacel tables
CALL FUNCTION 'TR_ACTIVATE_NAMESPACE'
EXPORTING
iv_namespace = ls_nspc-namespace
EXCEPTIONS
deletion_not_allowed = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error activating namespace| ).
ENDIF.
" Make namespace modifiable
UPDATE trnspace SET editflag = abap_true WHERE namespace = ls_nspc-namespace.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA lv_namespace TYPE trnspace-namespace.
lv_namespace = ms_item-obj_name.
CALL FUNCTION 'TR_CHECK_NAMESPACE'
EXPORTING
iv_namespace = lv_namespace
EXCEPTIONS
namespace_not_valid = 1
OTHERS = 2.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = zif_abapgit_object~exists( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
" Launch general maintenance for namespaces
CALL FUNCTION 'VIEW_MAINTENANCE_CALL'
EXPORTING
action = 'S'
view_name = 'V_TRNSPACE'
no_warning_for_clientindep = 'X'
variant_for_selection = 'STANDARD'
EXCEPTIONS
client_reference = 1
foreign_lock = 2
invalid_action = 3
no_clientindependent_auth = 4
no_database_function = 5
no_editor_function = 6
no_show_auth = 7
no_tvdir_entry = 8
no_upd_auth = 9
only_show_allowed = 10
system_failure = 11
unknown_field_in_dba_sellist = 12
view_not_found = 13
OTHERS = 14.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA:
ls_nspc TYPE ty_nspc,
ls_nspc_text TYPE ty_nspc_text.
SELECT SINGLE * FROM trnspacet INTO CORRESPONDING FIELDS OF ls_nspc
WHERE namespace = ms_item-obj_name.
SELECT SINGLE * FROM trnspacett INTO CORRESPONDING FIELDS OF ls_nspc_text
WHERE namespace = ms_item-obj_name AND spras = mv_language.
io_xml->add( iv_name = 'NSPC'
ig_data = ls_nspc ).
io_xml->add( iv_name = 'NSPC_TEXT'
ig_data = ls_nspc_text ).
serialize_texts( io_xml ).
ENDMETHOD.
ENDCLASS.
``` | I found vulnerabilities in the line:
```abap
MODIFY trnspacet FROM ls_trnspacet.
```
Explanation: Modify only own DB tables.
```abap
INSERT trnspacet FROM ls_trnspacet.
```
Explanation: Modify only own DB tables.
```abap
ls_trnspacett-namespace = ls_nspc-namespace.
INSERT trnspacett FROM ls_trnspacett. * <-- There is a problem here
ENDIF.
```
Explanation: Modify only own DB tables.
```abap
UPDATE trnspace SET editflag = abap_true WHERE namespace = ls_nspc-namespace.
```
Explanation: Modify only own DB tables. | 1,799 |
Find vulnerabilities in this ABAP code snippet. | ```abap
IF sy-subrc = 0.
ls_trnspacett-descriptn = ls_nspc_text-descriptn.
ls_trnspacett-owner = ls_nspc_text-owner.
MODIFY trnspacett FROM ls_trnspacett.
ELSE.
``` | I found vulnerabilities in the line:
```abap
ls_trnspacett-owner = ls_nspc_text-owner.
MODIFY trnspacett FROM ls_trnspacett. * <-- There is a problem here
ELSE.
```
Explanation: Modify only own DB tables. | 1,800 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.