ABAP Keyword Documentation → ABAP - Reference → User Dialogs → Messages
MESSAGE
Other versions: 7.31 | 7.40 | 7.54
Syntax
MESSAGE { msg | text }
[message_options].
Effect
This statement interrupts the program flow and either displays the short text of a
message specified in msg from the table
T100 in the logon language
of the current user, or any text from text as a message. The exact
behavior of the statement MESSAGE
(that is, how the text is displayed and how the program flow is continued after the MESSAGE statement) is context-dependent and is determined by a
message type specified
in msg or text. This behavior can be changed using the message_options additions and the placeholders can be replaced in messages.
System Fields
| Name | Meaning |
|---|---|
sy-msgid |
Contains the message class after a message is sent, and the value "00" after any text is sent. |
sy-msgno |
Contains the message number after a message is sent, and the value "001" after any text is sent. |
sy-msgty |
Contains the identifier of the message type with which the message or the text was sent. |
sy-msgv1 to sy-msgv4 |
Contain the content of the data objects specified after the addition WITHafter sending a message (in order). After any text is sent, contain the first 200 characters of the data object text. |
Notes
-
Messages are one way of interacting with a user. Except for messages of the type "X",
the statement
MESSAGEshould be use exclusively in the presentation logic layer and never in the application logic layer. -
Setting the text environment
using the statement
SET LOCALEhas no effect on the language in which the message is displayed.
Exceptions
Non-Catchable Exceptions
-
Cause: Message type unknown
Runtime Error:MESSAGE_TYPE_UNKNOWN -
Cause: Deliberate raising of a termination with short dump
Runtime Error:MESSAGE_TYPE_X
Runtime Error:MESSAGE_TYPE_X_TEXT -
Cause: It is not possible to catch messages of the type
'A'with the language elementCALL FUNCTION ... EXCEPTIONS error_messageduringON COMMITprocessing.
Runtime Error:MESSAGE_ROLLBACK_ON_COMMIT -
Cause: It is not possible to catch messages of the type
'A'with the language elementCALL FUNCTION ... EXCEPTIONS error_messageduring an update.
Runtime errorMESSAGE_ROLLBACK_IN_POSTING