Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

REMOVE MESSAGE USING MMPUR_REMOVE_MESSAGES_BY_ID

0 Kudos
672

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

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos
553

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.

0 Kudos
553

thanks for you anwser,

I will try using mmpur_remove_msg_by_context ls_header-id mmcnt_context_badi to remove message.