2015 Jan 07 5:56 PM
Hi All,
I have added one message ME(024) in the BADI Method Process_header. It is for vendor flag deletion validation. The error message is displaying Properly if the vendor deletion flag is set. But however while saving PO, other error messages are showing and the error that I wrote in the method is not appearing.
I don't know what might be the issue? Can anyone tell me what is the issue? Do i need to write the message anywhere?
2015 Jan 07 11:42 PM
Refer to the sample implementation.
Class: CL_EXM_IM_ME_PROCESS_PO_CUST
Method: IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM
Don't forget to include
INCLUDE mm_messages_mac. "useful macros for message handling
2015 Jan 08 1:05 AM
Should try using like this
MMPUR_BUSINESS_OBJ_ID WL_MEPOHEADER-ID.
MMPUR_MESSAGE_FORCED 'E' 'Zxxxxxx '999'VG_MESSAGE
2015 Jan 08 4:32 AM
2015 Jan 13 3:52 PM
How did you raise the errioir, did you use standard macros ?
Sample :
method if_ex_me_process_po_cust~process_header .
* standard include for messages
include mm_messages_mac.
* Local data
data: ls_header type mepoheader,
etc.
* Get current values
ls_header = im_header->get_data( ).
* Well should not be required, but...
check me->trtyp ne 'A'. " instance attribute saved in if_ex_me_process_po_cust_open
* Clear own messages of previous call
mmpur_context mmcnt_context_badi.
if not ls_header-id is initial and im_header->is_valid( ) eq mmpur_yes.
mmpur_remove_msg_by_context ls_header-id mmcnt_context_badi.
endif.
* A single check
if ls_header-flag = 'X'.
mmpur_metafield mmmfd_vendor.
mmpur_metafield_add mmmfd_doc_typ.
mmpur_message_forced 'E' 'ZFSM' '413' ls_header-lifnr ls_header-bsart ' ' ' '.
im_header->invalidate( ).
exit.
endif.
* to be continued.
endmethod.
Regards,
Raymond