You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error at rule "Replace READ TABLE with table expression" #448
we did a mass cleaning (CLI) with the latest abap-cleaner version 1.21.4 .
The filename with errors is now shown in the error log. Thank you very much for that again.
It would be nice, if the whole filename with path would be shown there. It shows currently only the sub folders starting from the entry point (src\...) and the filename without extension (.abap). So it is not possilbe to copy and paste the filename to open it with VS Code for example.
We received during the cleaning an error.
Here is a shorten version of the coding for testing the issue:
REPORT zfm_test_cleaner.
PERFORMtest.
FORMtest.
DATA lv_user_id TYPE uname.
DATA lt_bname TYPE STANDARD TABLE OF xubname.
READ TABLE lt_bname WITH KEY lv_user_id TRANSPORTING NO FIELDS.
IFsy-subrc<>0.
RETURN.
ENDIF.
ENDFORM.
We receive the following error
I had for this test only the rule "READ TABLE with table expression" active (restricted to ABAP 7.50).
I assume that the issue is the WITH KEY lv_user_id. If I replace it by WITH KEY table_line = lv_user_id then it works fine.
thanks a lot for reporting this issue. This obsolete key syntax is indeed not yet considered in ABAP cleaner, will fix this to introduce "table_line =" in such a case!
on a closer look, it is the obsolete form WITH KEY = dobj that can always be replaced by table_line = dobj: for this alternative, the documentation reads: "This statement has the same function as specifying the pseudo component table_line as a free key".
By contrast, in my understanding this might not be true in all cases of WITH KEY dobj, and ABAP cleaner usually cannot retrieve the type information to check that. Therefore, with the bugfix, WITH KEY dobj will be kept, while WITH KEY = dobj will be replaced:
Activity
jmgrassau commentedon Sep 26, 2025
Hi Frank,
thanks a lot for reporting this issue. This obsolete key syntax is indeed not yet considered in ABAP cleaner, will fix this to introduce "table_line =" in such a case!
Kind regards,
Jörg-Michael
jmgrassau commentedon Sep 26, 2025
Hi Frank,
on a closer look, it is the obsolete form
WITH KEY = dobjthat can always be replaced bytable_line = dobj: for this alternative, the documentation reads: "This statement has the same function as specifying the pseudo component table_line as a free key".By contrast, in my understanding this might not be true in all cases of
WITH KEY dobj, and ABAP cleaner usually cannot retrieve the type information to check that. Therefore, with the bugfix,WITH KEY dobjwill be kept, whileWITH KEY = dobjwill be replaced:Kind regards,
Jörg-Michael
fmabap commentedon Sep 26, 2025
Hi Jörg,
thank you very much for the explanation and the fast bug fix. It sounds plausible to me.
Kind regards
Frank
fix ReadTableRule for obsolete forms of free key (SAP#448)
fix ReadTableRule for obsolete forms of free key (#448)
jmgrassau commentedon Sep 29, 2025
Hi Frank,
thanks again for reporting this bug! This should now be fixed with version 1.22.0, which was just released!
Kind regards,
Jörg-Michael