Skip to content

Prefer Modern Inline Declarations in ABAP 7.40+ ​

WarningClean ABAP & Modern Syntax#EC PREFER_INLINERemote Enabled

Overview ​

Prefer Inline Declarations.

ATC Finding Message: Prefer inline declaration over separate DATA and assignment

Rationale ​

Declaring a variable at the top and assigning it in the very next statement separates the declaration from its first use. Inline DATA( ) keeps the variable close to where it is needed and shortens its lifetime in the reader mind. Use inline declarations when the type is obvious from the initial value.

Non-Compliant ​

abap
DATA lv_name TYPE string.
lv_name = |Order { lv_id }|.

Compliant ​

abap
DATA(lv_name) = |Order { lv_id }|.

Suppression ​

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

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

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

Technical Details ​

Released under the MIT License.