Hi Jörg-Michael, I found an issue with the rule "Delete unused variables".
Here's a scenario in which it works correctly.
Before:
REPORT yexample.
CLASS lcl_ DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
METHODS test1.
ENDCLASS.
CLASS lcl_ IMPLEMENTATION.
METHOD test1.
SELECT
FROM e071
FIELDS activity
INTO TABLE @DATA(test).
test1( ).
ENDMETHOD.
ENDCLASS.
After:
REPORT yexample.
CLASS lcl_ DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
METHODS test1.
ENDCLASS.
CLASS lcl_ IMPLEMENTATION.
METHOD test1.
SELECT
FROM e071
FIELDS activity
" TODO: variable is assigned but never used (ABAP cleaner)
INTO TABLE @DATA(test).
test1( ).
ENDMETHOD.
ENDCLASS.
It doesn't work if the method is named like the variable. This code is unchanged:
REPORT yexample.
CLASS lcl_ DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
METHODS test.
ENDCLASS.
CLASS lcl_ IMPLEMENTATION.
METHOD test.
SELECT
FROM e071
FIELDS activity
INTO TABLE @DATA(test).
test( ).
ENDMETHOD.
ENDCLASS.
Thanks! 🙂
Hi Jörg-Michael, I found an issue with the rule "Delete unused variables".
Here's a scenario in which it works correctly.
Before:
After:
It doesn't work if the method is named like the variable. This code is unchanged:
Thanks! 🙂