Skip to content

Use a message class (SE91) instead of inline message text ​

WarningClean ABAP & Modern Syntax#EC MSG_CLASSLocal Only

Overview ​

Use a message class instead of inline message text.

ATC Finding Message: Define the message class and raise it as e001( msg_class )

Rationale ​

Inline message texts are not translatable through SE91 and are scattered across the codebase. A message class centralizes text, numbering, and translation for all consumers. Raise messages with MESSAGE e001(zmsg) or a class-based exception that references the message text.

Non-Compliant ​

abap
MESSAGE 'Something went wrong' TYPE 'E'.

Compliant ​

abap
MESSAGE e001(zmsg).

Suppression ​

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

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

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

Technical Details ​

Released under the MIT License.