Avoid Redundant CONTINUE at End of Loop
WarningClean ABAP & Modern SyntaxQuickFix Ready#EC NO_USELESS_CONTRemote Enabled
Overview
Avoid Redundant CONTINUE at End of Loop.
ATC Finding Message:
CONTINUE immediately before loop end is redundant
Rationale
A CONTINUE statement located immediately before ENDLOOP, ENDWHILE, or ENDDO has zero effect because loop execution naturally cycles at the end of the block. Remove redundant trailing CONTINUE statements to keep loop bodies concise and avoid misleading code reviewers into expecting remaining logic.
Non-Compliant
abap
LOOP AT lt_items ASSIGNING <ls_item>.
do_work( <ls_item> ).
CONTINUE.
ENDLOOP.Compliant
abap
LOOP AT lt_items ASSIGNING <ls_item>.
do_work( <ls_item> ).
ENDLOOP.Automated QuickFix
This rule provides an automated QuickFix directly in Eclipse ABAP Development Tools (ADT):
- Position the cursor on the flagged statement.
- Press Ctrl + 1 (Quick Assist).
- Select the automated refactoring to apply the clean syntax immediately.
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_USELESS_CONT
" SAP CI_ prefix format:
... "#EC CI_NO_USELESS_CONTRelated Rules
- Avoid Loops That Execute At Most Once —
#EC NO_SINGLE_ITER - Avoid Dead Code with Constant Conditions —
#EC NO_DEAD_CODE - Avoid Dead / Unreachable Code —
#EC NO_UNREACHABLE
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_USELESS_CONT - Implementation File: zcl_skylint_no_useless_cont.clas.abap