Skip to content

Avoid Chained Declarations (DATA:, CONSTANTS:, TYPES:) ​

WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC NO_CHAINED_DECLRemote Enabled

Overview ​

Avoid Chained Declarations.

ATC Finding Message: Avoid chained declarations; declare each entity individually

Rationale ​

Chained declarations combine multiple definitions behind a colon and commas, obscuring types and causing noisy version control diffs for single-variable modifications. In modern Clean ABAP, each variable, constant, or type definition should be an independent, fully qualified statement for maximum readability and clean diff tracking.

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 ValueDescription & Guidance
ALLOW_STRUCTURE_CHAINSBooleantrueAllow chained declarations exclusively inside BEGIN OF ... END OF structure definitions

Suppression ​

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

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

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

Technical Details ​

Released under the MIT License.