Skip to content

Avoid Chained Declarations & Assignments ​

WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC CHAIN_DECLRemote Enabled

Overview ​

Avoid chained declarations and chained assignments.

ATC Finding Messages:

  • Avoid chained declarations; declare each entity individually
  • Avoid chained assignments; write separate assignment statements

Rationale ​

Chained statements pack several definitions behind a colon and commas, so a modifier or type can appear to apply to more than one name. They also turn a one-line change into a large diff and make merge conflicts harder to resolve. Write each declaration or assignment as its own complete statement so scope and modifiers are unambiguous.

Non-Compliant ​

abap
DATA: lv_order_id TYPE string,
      lv_status   TYPE string.

Compliant ​

abap
DATA lv_order_id TYPE string.
DATA lv_status TYPE string.

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
ALLOW_STRUCTURE_CHAINSBooleantrue
CHECK_CHAINED_DECLBooleantrue
CHECK_CHAINED_ASSIGNBooleantrue

Suppression ​

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

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

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

Technical Details ​

Released under the MIT License.