Skip to content

Commit e1d3f7c

Browse files
authored
Merge pull request #291 from SAP/db-access-in-ut
Y_CHECK_DB_ACCESS_IN_UT: DELETE ... INDEX
2 parents 732976c + c8c877c commit e1d3f7c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/checks/y_check_db_access_in_ut.clas.abap

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ CLASS y_check_db_access_in_ut IMPLEMENTATION.
204204

205205

206206
METHOD is_internal_table.
207-
" Might have 'FROM'
208-
result = xsdbool( is_persistent_object( get_token_abs( statement-from + 1 ) ) = abap_false
209-
AND is_persistent_object( get_token_abs( statement-from + 2 ) ) = abap_false ).
207+
DATA(second_token) = get_token_abs( statement-from + 1 ).
208+
DATA(tirth_token) = get_token_abs( statement-from + 2 ).
209+
210+
DATA(table) = COND #( WHEN second_token = 'FROM' THEN tirth_token
211+
ELSE second_token ).
212+
213+
result = xsdbool( is_persistent_object( table ) = abap_false ).
210214
ENDMETHOD.
211215

212216
ENDCLASS.

src/checks/y_check_db_access_in_ut.clas.testclasses.abap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ CLASS ltc_risk_harmless IMPLEMENTATION.
166166
( ' INSERT profile INTO TABLE profiles. ' )
167167
( ' MODIFY profiles FROM profile INDEX 1. ' )
168168
( ' DELETE profiles FROM profile. ' )
169+
( ' DELETE profiles INDEX lines( profiles ). ' )
169170
( ' ENDMETHOD. ' )
170171
( ' ENDCLASS. ' )
171172
).

0 commit comments

Comments
 (0)