Skip to content

Statement Indentation Must Match Block Nesting ​

WarningClean ABAP & Modern SyntaxQuickFix Ready#EC BAD_INDENTRemote Enabled

Overview ​

Bad Statement Indentation.

ATC Finding Message: Statement indentation does not match block nesting

Rationale ​

Indentation is the fastest visual cue for block nesting, so inconsistent indentation misleads readers about which statements belong together. It also creates noisy diffs when a formatter runs. Indent each block level consistently.

Non-Compliant ​

abap
METHOD calculate.
DATA lv_total TYPE i.
  LOOP AT lt_items INTO ls_item.
lv_total = lv_total + ls_item-amount.
  ENDLOOP.
ENDMETHOD.

Compliant ​

abap
METHOD calculate.
  DATA lv_total TYPE i.
  LOOP AT lt_items INTO ls_item.
    lv_total = lv_total + ls_item-amount.
  ENDLOOP.
ENDMETHOD.

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.

Configuration & Thresholds ​

This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:

Parameter NameData TypeDefault Value
INDENT_STEPInteger2

Suppression ​

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

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

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

Technical Details ​

Released under the MIT License.