Avoid LIKE Typing on Global Dictionary Objects
WarningAnti-Patterns & Bad Practices#EC LIKE_OBJECTSRemote Enabled
Overview
Avoid LIKE referencing data objects; use explicit TYPE.
ATC Finding Message:
Avoid LIKE for data declarations; specify TYPE explicitly
Rationale
LIKE copies the type of a data object, which couples the new declaration to an implementation detail rather than to a type contract. For Dictionary objects, TYPE references the type directly and stays stable when the referenced object changes. Use LIKE only for local data objects whose type is intentionally shared.
Non-Compliant
abap
DATA lv_material LIKE mara-matnr.Compliant
abap
DATA lv_material TYPE mara-matnr.Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC LIKE_OBJECTS
" SAP CI_ prefix format:
... "#EC CI_LIKE_OBJECTSTechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_LIKE_OBJECTS - Implementation File: zcl_skylint_no_like_objects.clas.abap