Avoid Using ABAP Keywords as Identifier Names
WarningAnti-Patterns & Bad Practices#EC KEYWORD_NAMERemote Enabled
Overview
Avoid Using ABAP Keywords as Identifier Names.
ATC Finding Message:
Identifier name matches an ABAP keyword
Rationale
Using a language keyword such as class, type, or data as an identifier shadows the keyword and forces readers to disambiguate from context. It also complicates searching and can confuse tooling. Prefix identifiers with their role, for example lv_type.
Non-Compliant
abap
DATA interface TYPE string.
DATA report TYPE i.Compliant
abap
DATA lv_interface TYPE string.
DATA lv_report TYPE i.Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC KEYWORD_NAME
" SAP CI_ prefix format:
... "#EC CI_KEYWORD_NAMETechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_KEYWORD_NAME - Implementation File: zcl_skylint_no_keyword_name.clas.abap