Skip to content

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):

  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 PAREN_LEN

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

Technical Details ​

Released under the MIT License.