ABAP Keyword Documentation → ABAP − Reference → Text Repositories → Messages → MESSAGE
MESSAGE - INTO
Other versions:
7.31 | 7.40 | 7.54
Syntax
MESSAGE msg [WITH dobj1 ... dobj4]
INTO text.
Effect
The statement MESSAGE
with the addition INTO assigns the short text of the message to the target field text. The
message type does not matter. The program flow is not interrupted and no
message processing takes place. The following can be specified for text:
- An existing character-like variable.
-
An inline declaration
DATA(var), where a variable of typestringis declared.
The addition INTO cannot be specified when a text
text is displayed and not when an object reference variable is specified in msg.
Example
The short text of a message sent in a function module is assigned to the data object mtext
(declared inline) when handling the exception error_message using the relevant system fields.
IF sy-subrc = 4.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
INTO DATA(mtext)
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.