Avoid Obsolete Inline Length Specifications (var(len))
WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC NO_INLINE_LENRemote Enabled
Overview
Avoid inline length specification in declarations.
ATC Finding Message:
Avoid length in parentheses; use TYPE ... LENGTH ...
Rationale
The legacy lv_name(10) syntax mixes the identifier and its length and is easy to misread as a substring or function call. Modern ABAP writes the type and length as separate, explicit tokens. Use TYPE c LENGTH n or a named type so the declaration is unambiguous.
Non-Compliant
abap
DATA lv_country(2) TYPE c.Compliant
abap
DATA lv_country TYPE c LENGTH 2.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 NO_INLINE_LEN
" SAP CI_ prefix format:
... "#EC CI_NO_INLINE_LENRelated Rules
- Prefer Modern Inline Declarations in ABAP 7.40+ —
#EC PREF_INLINE - Avoid Chained Declarations (DATA:, CONSTANTS:, TYPES:) —
#EC NO_CHAINED_DECL - Avoid Chained Assignments (a = b = c = 1) —
#EC NO_CHAINED_ASSIGN
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_INLINE_LEN - Implementation File: zcl_skylint_no_inline_len.clas.abap