Enforce Naming Conventions
WarningClean ABAP & Modern Syntax#EC NAMINGRemote Enabled
Overview
Standard Naming Conventions.
ATC Finding Messages:
Class attribute name does not match configured patternMethod parameter name does not match configured patternLocal variable name does not match configured patternLocal class name does not match configured patternGlobal class name does not match configured patternSelection screen element name does not match configured patternType name does not match configured patternMacro name does not match configured patternForm routine name does not match configured patternFunction module name does not match configured patternLocal interface name does not match configured patternGlobal interface name does not match configured patternEvent or event handler name does not match configured patternTest method name does not match configured patternProgram name does not match configured patternFunction group name does not match configured pattern
Rationale
Without a naming convention, local variables, parameters, and types are indistinguishable and the code becomes harder to navigate. Prefixes such as lv_, iv_, and ty_ encode scope and kind at a glance. Apply the configured patterns consistently within a team.
Non-Compliant
abap
DATA customer_name TYPE string.Compliant
abap
DATA lv_customer_name TYPE string.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 |
|---|---|---|
ATTR_IGN_EXC | Boolean | true |
ATTR_IGN_LOCAL | Boolean | true |
ATTR_IGN_INTF | Boolean | false |
ATTR_STATICS | String | ^G._.+$ |
ATTR_INSTANCE | String | ^M._.+$ |
ATTR_CONSTANTS | String | |
PARAM_IGN_EXC | Boolean | true |
PARAM_IMPORTING | String | ^I._.+$ |
PARAM_RETURNING | String | ^R._.+$ |
PARAM_CHANGING | String | ^C._.+$ |
PARAM_EXPORTING | String | ^E._.+$ |
LOCAL_DATA | String | ^L._.+$ |
LOCAL_CONST | String | ^LC_.+$ |
LOCAL_FS | String | ^<L._.+>$ |
LOCAL_STATICS | String | ^S._.+$ |
CLASS_LOCAL | String | ^LC(L|X)_.+$ |
CLASS_TEST | String | ^LTCL_.+$ |
CLASS_GLOBAL | String | ^ZC(L|X)_.+$ |
SSCR_PARAM | String | ^P_.+$ |
SSCR_SELOPT | String | ^S_.+$ |
TYPES_PATTERN | String | ^TY_.+$ |
MACRO_PATTERN | String | ^_.+$ |
FORM_PATTERN | String | ^F_.+$ |
FUNCTION_PATTERN | String | ^Z.*$ |
INTF_LOCAL | String | ^LIF_.+$ |
INTF_GLOBAL | String | ^ZIF_.+$ |
EVENT_NAME | String | ^[A-Z][A-Z0-9_]+$ |
EVENT_HANDLER | String | ^ON_.+$ |
TEST_METHOD | String | ^(TEST|SHOULD)_.+$ |
PROG_PATTERN | String | ^Z.+$ |
FUGR_PATTERN | String | ^Z.+$ |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NAMING
" SAP CI_ prefix format:
... "#EC CI_NAMINGTechnical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_NAMING - Implementation File: zcl_skylint_pref_naming.clas.abap