MESSAGE 사용법.
REPORT 선언문에 MESSAGE-ID를 선언
MESSAGE [type][nnn].
MESSAGE s001.
REPORT ZBLOG MESSAGE-ID ZCL_MSG_DEMO.
MESSAGE i000.
MESSAGE ID sy-msgid
TYPE sy-msgty
NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msg4
DISPLAY LIKE dtype.
REPORT ZTEST.
START-OF-SELECTION.
MESSAGE ID 'ZMESSAGE' TYPE 'I' NUMBER '002' WITH 'Eat' 'Drink' 'Rest'.
MESSAGE i002(ZMESSAGE) WITH 'Eat' 'Drink' 'Rest'.
결과
WITH과 함께 place holder 최대 4개까지 사용 가능.
Display Type은 A, E, I, S, W
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
INTO DATA(mtext)
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
MESSAGE ID 'ZCL_MSG_DEMO' TYPE 'I' NUMBER '000'
INTO DATA(mtext)
WITH 'Eat' 'Drink' 'Rest'.
cl_demo_output=>display( mtext ).
MESSAGE <message> TYPE <message type>.
MESSAGE 'This is an Error message' TYPE 'E'.