sapdev logo background
sapdev logo sapdev logo
Comments

ABAP MESSAGE TEXT Statement syntax, information and example SAP source code



Return to Statement index



MESSAGE - text

Short Reference

ABAP Syntax ... text TYPE mtype ... .

What does it do? This variant sends a character string in text as a
message of the
message type specified in mtype . text is a character-like expression position whose value is used as the short text of the message. Only the first 300 characters are used. No long text can be defined for a mes
sage of this type.
mtype expects a character-like data object containing the message type in uppercase letters. Invalid message types raise a non-handleable exception.
Latest notes: In this variant, the additions WITH and INTO
in message_options are not allowed.
If field symbols or formal parameters of the type any or
data are specified for text , these must be character-like when the statement is executed. The syntactically identical variant MESSAGE oref cannot be executed using generically typed field symbols or formal parameters.
The system fields sy-msgid and sy-msgno are filled in a non-specific way when a character string is specified. This means that this variant should only be used on rare occasions if the content of the system fields is not required for identifying the message. Otherwise, in all cases in which messages are passed using these system fields (for example, from function modules ) or logged, language-independent access to the message text would be lost.
Example ABAP Coding Produces an exception text as an information message .
DATA oref TYPE REF TO cx_sy_arithmetic_error.
TRY.
...
CATCH cx_sy_arithmetic_error INTO oref.
MESSAGE oref->get_text( ) TYPE 'I'.
ENDTRY.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




MESSAGE_RAISING
METHOD




comments powered by Disqus