TYPES: BEGIN OF esp1_message_wa_type,
msgid LIKE sy-msgid,
msgty LIKE sy-msgty,
msgno LIKE sy-msgno,
msgv1 LIKE sy-msgv1,
msgv2 LIKE sy-msgv2,
msgv3 LIKE sy-msgv3,
msgv4 LIKE sy-msgv4,
lineno LIKE mesg-zeile,
END OF esp1_message_wa_type.
DATA: lt_message_popup TYPE TABLE OF esp1_message_wa_type.
DATA: lt_bapiret_tab TYPE TABLE OF bapiret2. " BAPIRETTAB
FIELD-SYMBOLS: <fs_bapiret> like LINE OF lt_bapiret_tab.
FIELD-SYMBOLS: <fs_message> like LINE OF lt_message_popup.
LOOP AT lt_bapiret_tab ASSIGNING <fs_bapiret>
WHERE type is NOT INITIAL. " avoid dumb for none relevant message
APPEND INITIAL LINE TO lt_message_popup ASSIGNING <fs_message>.
<fs_message>-msgty = <fs_bapiret>-type .
<fs_message>-msgid = <fs_bapiret>-id .
<fs_message>-msgno = <fs_bapiret>-number .
<fs_message>-msgv1 = <fs_bapiret>-message_v1 .
<fs_message>-msgv2 = <fs_bapiret>-message_v2 .
<fs_message>-msgv3 = <fs_bapiret>-message_v3 .
<fs_message>-msgv4 = <fs_bapiret>-message_v4 .
<fs_message>-lineno = sy-tabix.
ENDLOOP.
IF NOT lt_message_popup[] IS INITIAL.
CALL FUNCTION 'C14Z_MESSAGES_SHOW_AS_POPUP'
TABLES
i_message_tab = lt_message_popup[].
ENDIF.
Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com
Social Plugin