Enforce Class, Interface, Type and Object Naming Conventions
WarningClean ABAP & Modern Syntax#EC PREF_NAME_OBJECTSRemote Enabled
Overview
Class, Interface, Type and Object Naming.
ATC Finding Messages:
Local class name does not match configured patternGlobal class name does not match configured patternLocal interface name does not match configured patternGlobal interface name does not match configured patternType name does not match configured patternEvent or event handler name does not match configured patternTest method 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 patternFunction group name does not match configured patternProgram name does not match configured pattern
Rationale
Object-oriented entities and global artifacts must maintain standardized prefixes (such as zcl_ / lcl_ for classes, zif_ / lif_ for interfaces, ty_ for type definitions, and on_* for event handlers). This standard maintains harmony across packages, enhances IDE searchability, and reinforces Clean ABAP architecture.
Non-Compliant
abap
CLASS my_service DEFINITION.
INTERFACE my_contract.
TYPES item_type TYPE string.Compliant
abap
CLASS lcl_my_service DEFINITION.
INTERFACE lif_my_contract.
TYPES ty_item 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 | Description & Guidance |
|---|---|---|---|
CLASS_LOCAL | String | ^LC(L|X)_.+$ | Regex pattern for local class names (default: ^LC(L|X)_.+$) |
CLASS_TEST | String | ^LTCL_.+$ | Regex pattern for test class names (default: ^LTCL_.+$) |
CLASS_GLOBAL | String | ^ZC(L|X)_.+$ | Regex pattern for global class names (default: ^ZC(L|X)_.+$) |
INTF_LOCAL | String | ^LIF_.+$ | Regex pattern for local interface names (default: ^LIF_.+$) |
INTF_GLOBAL | String | ^ZIF_.+$ | Regex pattern for global interface names (default: ^ZIF_.+$) |
TYPES_PATTERN | String | ^TY_.+$ | Regex pattern for type definitions (default: ^TY_.+$) |
MACRO_PATTERN | String | ^_.+$ | Regex pattern for macros (default: ^_.+$) |
FORM_PATTERN | String | ^F_.+$ | Regex pattern for form routines (default: ^F_.+$) |
FUNCTION_PATTERN | String | ^Z.*$ | Regex pattern for function modules (default: ^Z.*$) |
EVENT_NAME | String | ^[A-Z][A-Z0-9_]+$ | Regex pattern for event names |
EVENT_HANDLER | String | ^ON_.+$ | Regex pattern for event handlers (default: ^ON_.+$) |
TEST_METHOD | String | ^(TEST|SHOULD)_.+$ | Regex pattern for test method names (default: ^(TEST|SHOULD)_.+$) |
PROG_PATTERN | String | ^Z.+$ | Regex pattern for program names (default: ^Z.+$) |
FUGR_PATTERN | String | ^Z.+$ | Regex pattern for function groups (default: ^Z.+$) |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC PREF_NAME_OBJECTS
" SAP CI_ prefix format:
... "#EC CI_PREF_NAME_OBJECTSRelated Rules
- Enforce Class Attribute and Method Parameter Naming Conventions —
#EC PREF_NAME_MEMBERS - Enforce Local Variable and Field-Symbol Naming Conventions —
#EC PREF_NAMING_VARS - Use Predicate Naming for Boolean Methods (is_, has_, can_) —
#EC PREF_PRED_NAME
Technical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_NAME_OBJECTS - Implementation File: zcl_skylint_pref_name_objects.clas.abap