ABAP - Keyword Documentation →  ABAP - Reference →  Text Repositories →  Messages →  MESSAGE → 

MESSAGE - INTO

Quick Reference

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:

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.

CALL FUNCTION... EXCEPTIONS error_message = 4.
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.