FUNCTION ZN4N_PI_MESSAGE_DATA_GETLIST.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IM_MESSAGE_LIST) TYPE SXMSMGUIDT
*" EXPORTING
*" VALUE(EX_MESSAGE_DATA_LIST) TYPE SXI_MESSAGE_DATA_LIST
*" EXCEPTIONS
*" NOT_AUTHORIZED
*"----------------------------------------------------------------------
data: lv_guid type SXMSMGUID,
ls_msgguid TYPE sxmsmguid,
IM_PIPELINE_LIST TYPE SXMS_TAB_SXMSPID,
lv_init_date type D,
lv_init_time type T,
lv_exe_date type D,
lv_exe_time type T,
lv_msg type SXI_MESSAGE_DATA
.

LOOP AT IM_MESSAGE_LIST INTO lv_guid.
* ls_msgguid = lv_guid.
clear IM_PIPELINE_LIST.

CALL FUNCTION 'SXMB_GET_MESSAGE_DATA'
EXPORTING
IM_MESSAGE_LIST = IM_MESSAGE_LIST
IM_PIPELINE_LIST = IM_PIPELINE_LIST
IMPORTING
EX_MESSAGE_DATA_LIST = EX_MESSAGE_DATA_LIST
EXCEPTIONS
NOT_AUTHORIZED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

clear lv_msg.
loop at EX_MESSAGE_DATA_LIST into lv_msg.
CONVERT TIME STAMP lv_msg-INITTIMEST TIME ZONE sy-zonlo
INTO DATE lv_init_date TIME lv_init_time.

CONVERT TIME STAMP lv_msg-EXETIMEST TIME ZONE sy-zonlo
INTO DATE lv_exe_date TIME lv_exe_time.

* APPEND ls_msgguid TO rt_msgguid.
ENDLOOP.
ENDLOOP.

ENDFUNCTION.