SAP MESSAGE ABAP Statements

Get Example source ABAP code based on a different SAP table
  


Standard SAP Help for MESSAGE

MESSAGE

Short Reference
• MESSAGE ABAP Statement


ABAP Syntax MESSAGE { msg |
text } [ message_options].

What does it do? 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 NameMeaning sy-msgidContains the message-class after sending a message, and the value '00' after sending any text. sy-msgnoContains the message number after sending a message, and the value '001' after sending any text. sy-msgtyContains the identifier of the message type with which the message or the text was sent. sy-msgv1 to sy-msgv4Contain the content of the data objects specified after the addition WITH after sending a message (in order). After sending any text, they contain the first 200 characters of the data object text.

Latest 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.



Runtime Exceptions
Non-catchable Exceptions
Reason for error:
Message type unknown
Runtime error:
MESSAGE_TYPE_UNKNOWN
Reason for error:
Deliberate raising of a termination with short dump
Runtime error:
MESSAGE_TYPE_X
Runtime error:
MESSAGE_TYPE_X_TEXT
Reason for error:
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
Reason for error:
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

Return to menu