Hi everyone,
I would like to ask for your help regarding the CL_MESSAGE_HANDLER_MM method. I am using it in the interface CLOSE in the BADI ME_PROCESS_PO_CUST. I am trying to get the list of errors during ME59N processing. Using my code below, I am able to get the errors but not the Purchase Requisition document numbers associated to the errors. Can anyone give me suggestions on what to do? Thanks in advance.
CALL METHOD cl_message_handler_mm=>get_handler
IMPORTING
ex_handler = l_msg_handler.
CALL METHOD l_msg_handler->getlist
EXPORTING
* IM_EVENT_TYPE =
* IM_OBJECT =
im_null_object_valid = mmpur_no
im_include_child_objects = mmpur_no
im_sequence = 1
IMPORTING
ex_events = lt_event_list
ex_evnt = lt_evnt.
LOOP AT lt_event_list INTO wa_event_list.
l_event = wa_event_list-event_obj .
CALL METHOD l_event->to_string
IMPORTING
ex_string = l_msg_txt
ex_signature = l_signature.
* This part here does not give the correct PR # (BANFN) because the LT_EVENT_LIST contains the list of all the errors whereas WA_MEPOITEM is the current line item being read.
wa_err-banfn = wa_mepoitem-banfn.
wa_err-bnfpo = wa_mepoitem-bnfpo.
wa_err-ebeln = wa_mepoitem-ebeln.
wa_err-ebelp = wa_mepoitem-ebelp.
wa_err-mess = l_signature.
wa_err-text = l_msg_txt.
APPEND wa_err TO lt_err.
CLEAR wa_err.
ENDLOOP.
Aileen