Avoid Obsolete Inline Length Specifications (var(len))
WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC PAREN_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 PAREN_LEN
" SAP CI_ prefix format:
... "#EC CI_PAREN_LENTechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_INLINE_LEN - Implementation File: zcl_skylint_no_inline_len.clas.abap