2020 Oct 16 8:18 AM
I wanted to put a validation at item level while creating PO, The error message should display in Pop up like standard errors, I am able to achieve that in Check method of BADI ME_PROCESS_PO_CUST.
The issue is i want to display all error in the Pop up like if multiple items have failed all items should be in the list, But when i display error in CHECK method, control comes out from method and only one error can be displayed at a time, is it possible to display all errors through this method?
2020 Oct 16 2:57 PM
Should I understand that you didn't use the macros of the include mm_messages_mac to handle error messages in the BAdI, or am I mistaken?
Sample on how to handle errors in PROCESS_ITEM
INCLUDE mm_messages_mac.
DATA: ls_item TYPE mepoitem.
* Get data
ls_item = im_item->get_data( ).
* Cleansing time
mmpur_context mmcnt_context_badi.
IF NOT ls_item-id IS INITIAL.
mmpur_remove_msg_by_context ls_item-id mmcnt_context_badi.
ENDIF.
* ...
* Raise an error on field Material
im_item->invalidate( ).
mmpur_metafield mmmfd_matnr.
mmpur_message_forced 'E' 'ZXXX' '123' <item_data>-matnr ' ' ' ' ' '.
2020 Oct 17 10:13 AM
Hi raymond.giuseppi ,
I wanted to change the Service item(s) against Po item , but i am not able to read proper service items with Method GET_DATA .
Please help me out to read and change the service item using get_data , set_data .
Thanks.
Om .
2020 Nov 05 8:44 AM
I used error message without macros like e000(), but even with macros multiple errors are not displayed, control comes out from the method
once you displayed first error
2020 Nov 06 3:35 PM
Strange as macro 'mmpur_message_forced' force the collect.
Could you try to force message handler behavior with following macro :
" message type / dialog / collect
mmpur_message_config 'E' ' ' 'X'. " no display and collect
and some debug (e.g. break-point at start of method CL_MESSAGE_MM=>CREATE)
2020 Nov 10 2:34 PM
Did you try to put your control in methods such as PROCESS_ITEM rather than CHECK?
2023 Nov 15 10:13 AM
You have to set business object (item) for which you output the message:
METHOD if_ex_me_process_po_cust~check.
INCLUDE mm_messages_mac.
...
mmpur_business_obj item_ref. "Reference to the item
mmpur_metafield mmmfd_cust_01. "Field with error
MESSAGE ... INTO dummy.
mmpur_message_forced sy-msgty sy-msgid sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
DATA(lf_failed) = 'X'.
...
IF lf_failed = 'X'.
ch_failed = 'X'.
ENDIF.
ENDMETHOD.