SAP ABAP 彈框顯示多條訊息
阿新 • • 發佈:2022-04-19
REPORT ZWYB_010. TYPE-POOLS: ESP1 . *"定義訊息型別 *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 . TYPES : ESP1_MESSAGE_TAB_TYPE TYPE ESP1_MESSAGE_WA_TYPE OCCURS 20 . DATA :IT_ERROR_MESSAGE TYPE ESP1_MESSAGE_TAB_TYPE WITH HEADER LINE . DATA :V_LINENO TYPE MESG-ZEILE . CLEAR :V_LINENO . *V_LINENO = V_LINENO + 1 .*IT_ERROR_MESSAGE-LINENO = V_LINENO . IT_ERROR_MESSAGE-MSGID = 'ZLM_MSG' . IT_ERROR_MESSAGE-MSGTY = 'E' . IT_ERROR_MESSAGE-MSGNO = '000' . IT_ERROR_MESSAGE-MSGV1 = '測試測試測試測試測試測試測試測試測試測試測試測試' . APPEND IT_ERROR_MESSAGE . * *V_LINENO = V_LINENO + 1 . *IT_ERROR_MESSAGE-LINENO = V_LINENO . IT_ERROR_MESSAGE-MSGID = 'ZLM_MSG' . IT_ERROR_MESSAGE-MSGTY = 'W' . IT_ERROR_MESSAGE-MSGNO = '000' . IT_ERROR_MESSAGE-MSGV1 = '測試測試測試測試' . APPEND IT_ERROR_MESSAGE . *V_LINENO = V_LINENO + 1 . *IT_ERROR_MESSAGE-LINENO = V_LINENO . IT_ERROR_MESSAGE-MSGID = 'ZLM_MSG' . IT_ERROR_MESSAGE-MSGTY = 'S' . IT_ERROR_MESSAGE-MSGNO = '000' . IT_ERROR_MESSAGE-MSGV1 = '測試測試測試測試測試測試試' . APPEND IT_ERROR_MESSAGE . *V_LINENO = V_LINENO + 1 . *IT_ERROR_MESSAGE-LINENO = V_LINENO . IT_ERROR_MESSAGE-MSGID = 'ZLM_MSG' . IT_ERROR_MESSAGE-MSGTY = 'E' . IT_ERROR_MESSAGE-MSGNO = '000' . IT_ERROR_MESSAGE-MSGV1 = '測試測試測試' . APPEND IT_ERROR_MESSAGE . CALL FUNCTION 'C14Z_MESSAGES_SHOW_AS_POPUP' TABLES I_MESSAGE_TAB = IT_ERROR_MESSAGE.