If a local variable is declared but not used, it is dead code and should be removed. Doing so will improve maintainability because developers will
not wonder what the variable is used for.
Noncompliant Code Example
FUNCTION f.
DATA: LOCAL_1 LIKE BAR.
DATA: LOCAL_2 LIKE BAR. "Noncompliant
SELECT * FROM LOCAL_1.
ENDFUNCTION.
Compliant Solution
FUNCTION f.
DATA: LOCAL_1 LIKE BAR.
SELECT * FROM LOCAL_1.
ENDFUNCTION.