Skip to content

Expand Macro Calls into Explicit Statements ​

WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC EXPAND_MACROSRemote Enabled

Overview ​

Expand Macro Calls.

ATC Finding Message: Macro call should be expanded into explicit statements

Rationale ​

Macros expand textually, so the debugger cannot step into them and syntax errors point at the invocation rather than the definition. They are obsolete and unsupported in ABAP Cloud. Replace each macro call with explicit statements or a method.

Non-Compliant ​

abap
DEFINE set_status.
  lv_status = &1.
END-OF-DEFINITION.
DATA lv_status TYPE string.
set_status 'A'.

Compliant ​

abap
DATA lv_status TYPE string.
lv_status = 'A'.

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 EXPAND_MACROS

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

Technical Details ​

Released under the MIT License.