Avoid Single-Letter Variable Names
WarningClean ABAP & Modern Syntax#EC NO_SINGLE_LETTERRemote Enabled
Overview
Avoid single-letter variable names.
ATC Finding Message:
Avoid single-letter variable names; use descriptive identifiers
Rationale
Single-letter variables (e.g. i, x, lv_i, ls_x) obscure the meaning of code, make text searching difficult, and increase cognitive load. Use intention-revealing names such as index, customer, or total_amount.
Non-Compliant
abap
DATA i TYPE i.
DATA lv_i TYPE i.Compliant
abap
DATA line_index TYPE i.
DATA count TYPE i.Configuration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value | Description & Guidance |
|---|---|---|---|
MIN_NAME_LEN | Integer | 2 | Minimum allowable identifier length (default: 2, excludes i, j, x, y loop indices) |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_SINGLE_LETTER
" SAP CI_ prefix format:
... "#EC CI_NO_SINGLE_LETTERRelated Rules
- Prefer FINAL( ) over DATA( ) when the variable is never written again —
#EC PREF_FINAL_DATA - Enforce Local Variable and Field-Symbol Naming Conventions —
#EC PREF_NAMING_VARS - Avoid Variable Scope Leaking from Inner Blocks —
#EC NO_SCOPE_LEAK
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_SINGLE_LETTER - Implementation File: zcl_skylint_no_single_letter.clas.abap