abapOpenChecks
abapOpenChecks copied to clipboard
Check suggestion - inline FS declaration's scope in loops
Given that the ABAP compiler doesn't have proper scope checks for inline field symbols defined in:
LOOP AT lt_table ASSIGNING FIELD-SYMBOLS(<ls_line>).
...
ENDLOOP.
Meaning that it is valid code to use <ls_line>
after ENDLOOP
then I suggest a new check which will alert the user when such occurrences happen.
For example:
LOOP AT lt_table ASSIGNING FIELD-SYMBOLS(<ls_line>).
...
ENDLOOP.
WRITE <ls_line>.
good idea
accessing the compiler information in ABAP is a bit difficult, but instead I might implement this in https://abaplint.org