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):
- Position the cursor on the flagged statement.
- Press Ctrl + 1 (Quick Assist).
- 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_MACROSTechnical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_EXPAND_MACRO - Implementation File: zcl_skylint_pref_expand_macro.clas.abap