Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Messages 

MESSAGE

Short Reference

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 MESSAGE statement (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 sending a message, and the value "00" after sending any text.
sy-msgno Contains the message number after sending a message, and the value "001" after sending any text.
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 sending any text, they 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 MESSAGE statement should be use exclusively in the presentation logic layer and never in the application logic layer.
  • Setting the text environment by means of the SET LOCALE statement has 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 element CALL FUNCTION ... EXCEPTIONS error_message during ON COMMIT processing.
    Runtime Error: MESSAGE_ROLLBACK_ON_COMMIT
  • Cause: It is not possible to catch messages of the type 'A' with the language element CALL FUNCTION ... EXCEPTIONS error_message during an update.
    Runtime error MESSAGE_ROLLBACK_IN_POSTING

Continue

MESSAGE - msg

MESSAGE - text

MESSAGE - message_options