Enforce Local Variable and Field-Symbol Naming Conventions
WarningClean ABAP & Modern Syntax#EC PREF_NAMING_VARSRemote Enabled
Overview
Local Variable and Field-Symbol Naming Conventions.
ATC Finding Message:
Local variable or field-symbol name does not match configured pattern
Rationale
Local variables, constants, statics, and field-symbols must follow distinct naming conventions (such as lv_*, lc_*, sv_*, <ls_*>, <lv_*>) to ensure clear scope boundaries, prevent unintended variable shadowing, and eliminate ambiguity during code reviews and debugging.
Non-Compliant
abap
DATA customer_name TYPE string.
FIELD-SYMBOLS <item> TYPE any.Compliant
abap
DATA lv_customer_name TYPE string.
FIELD-SYMBOLS <ls_item> TYPE any.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 |
|---|---|---|---|
LOCAL_DATA | String | ^L._.+$ | Regex pattern for local variables (default: ^L._.+$) |
LOCAL_CONST | String | ^LC_.+$ | Regex pattern for local constants (default: ^LC_.+$) |
LOCAL_FS | String | ^<L._.+>$ | Regex pattern for field-symbols (default: ^<L._.+>$) |
LOCAL_STATICS | String | ^S._.+$ | Regex pattern for local static variables (default: ^S._.+$) |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC PREF_NAMING_VARS
" SAP CI_ prefix format:
... "#EC CI_PREF_NAMING_VARSRelated Rules
- Enforce Class Attribute and Method Parameter Naming Conventions —
#EC PREF_NAME_MEMBERS - Enforce Class, Interface, Type and Object Naming Conventions —
#EC PREF_NAME_OBJECTS - Eliminate Unused Local Variables and Symbols —
#EC NO_UNUSED_VARS
Technical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_NAMING_VARS - Implementation File: zcl_skylint_pref_naming_vars.clas.abap