Skip to content

Avoid Assignments Whose Value Is Never Read ​

WarningAnti-Patterns & Bad Practices#EC NO_DEAD_STORERemote Enabled

Overview ​

Avoid assignments that are never read.

ATC Finding Message: This value is overwritten before it is read; remove the assignment or read it

Rationale ​

An assignment whose value is overwritten before any read computes a result nobody uses: the work, the helper call, and the temporary state are all wasted. Such dead stores usually survive a refactor that removed the consuming branch, and they mislead readers into believing the value matters. Either read the value or delete the assignment.

Non-Compliant ​

abap
lv_status = 'NEW'.
lv_status = 'DONE'.
WRITE lv_status.

Compliant ​

abap
lv_status = 'DONE'.
WRITE lv_status.

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC NO_DEAD_STORE

" SAP CI_ prefix format:
... "#EC CI_NO_DEAD_STORE

Technical Details ​

Released under the MIT License.