Skip to content

Enforce Class Attribute and Method Parameter Naming Conventions ​

WarningClean ABAP & Modern Syntax#EC PREF_NAME_MEMBERSRemote Enabled

Overview ​

Class Attribute and Parameter Naming Conventions.

ATC Finding Messages:

  • Class attribute name does not match configured pattern
  • Method parameter name does not match configured pattern
  • Selection screen element name does not match configured pattern

Rationale ​

Member variables and method signatures communicate the contract of object-oriented components. Enforcing prefixes (mv_* for instance attributes, gv_* for static attributes, iv_* for importing, ev_* for exporting, cv_* for changing, and rv_* for returning parameters) clarifies usage semantics across callers.

Non-Compliant ​

abap
METHODS execute
  IMPORTING data TYPE i
  RETURNING VALUE(result) TYPE i.

Compliant ​

abap
METHODS execute
  IMPORTING iv_data TYPE i
  RETURNING VALUE(rv_result) TYPE i.

Configuration & Thresholds ​

This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:

Parameter NameData TypeDefault ValueDescription & Guidance
ATTR_IGN_EXCBooleantrueIgnore exception class attributes (cx_*)
ATTR_IGN_LOCALBooleantrueIgnore attributes in local test classes
ATTR_IGN_INTFBooleanfalseIgnore interface component naming
ATTR_STATICSString^G._.+$Regex pattern for static class attributes (default: ^G._.+$)
ATTR_INSTANCEString^M._.+$Regex pattern for instance class attributes (default: ^M._.+$)
ATTR_CONSTANTSStringRegex pattern for class constants (default: ^C._.+$)
PARAM_IGN_EXCBooleantrueIgnore parameter naming in exception classes
PARAM_IMPORTINGString^I._.+$Regex pattern for importing parameters (default: ^I._.+$)
PARAM_RETURNINGString^R._.+$Regex pattern for returning parameters (default: ^R._.+$)
PARAM_CHANGINGString^C._.+$Regex pattern for changing parameters (default: ^C._.+$)
PARAM_EXPORTINGString^E._.+$Regex pattern for exporting parameters (default: ^E._.+$)
SSCR_PARAMString^P_.+$Regex pattern for selection screen parameters (default: ^P_.+$)
SSCR_SELOPTString^S_.+$Regex pattern for select-options (default: ^S_.+$)

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC PREF_NAME_MEMBERS

" SAP CI_ prefix format:
... "#EC CI_PREF_NAME_MEMBERS

Technical Details ​

Released under the MIT License.