Skip to content

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 NameData TypeDefault ValueDescription & Guidance
LOCAL_DATAString^L._.+$Regex pattern for local variables (default: ^L._.+$)
LOCAL_CONSTString^LC_.+$Regex pattern for local constants (default: ^LC_.+$)
LOCAL_FSString^<L._.+>$Regex pattern for field-symbols (default: ^<L._.+>$)
LOCAL_STATICSString^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_VARS

Technical Details ​

Released under the MIT License.