Skip to content

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):

  1. Position the cursor on the flagged statement.
  2. Press Ctrl + 1 (Quick Assist).
  3. 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_CONT

Technical Details ​

Released under the MIT License.