2023 May 10 1:36 AM
Hi,
In me21n transaction I uesed 'mmpur_remove_messages_by_id' to removed message from message log、but the other messages of this item are also removed together.
is there any other way to remove the message in the log(addon message )?
mmpur_business_obj_id ls_po_item-id.
mmpur_remove_messages_by_id ls_po_item-id
please help me if u have any idea
Regards,
CHENGCHENG
2023 May 10 1:02 PM
When you raise message set context and object id, you will then be able to remove every error for this object id and context.
* item
mmpur_context mmcnt_context_badi.
ls_item = im_item->get_data( ).
IF NOT ls_item-id IS INITIAL AND im_item->is_valid( ) EQ mmpur_yes.
mmpur_remove_msg_by_context ls_item-id mmcnt_context_badi.
ENDIF.
* header
mmpur_context mmcnt_context_badi.
ls_header = im_header->get_data( ).
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.
NB: Here I used mmcnt_context_badi, you could use your own values such as 901, 902, etc.
2023 May 11 6:30 AM
thanks for you anwser,
I will try using mmpur_remove_msg_by_context ls_header-id mmcnt_context_badi to remove message.