cancel
Showing results for 
Search instead for 
Did you mean: 

Delete UI Messages

former_member193352
Active Contributor
0 Kudos

Hi Experts

I have a scenario where I've to suppess unwanted Warning messages which are displayed while I create a Related Contact on Account Identification Screen in IC_AGENT business role.

I'm using the following piece of code but its not doing any good.



lr_msg_srv = cl_bsp_wd_message_service=>get_instance( ).

*Retrieve the current messages
    lr_msg_srv->collect_messages( iv_message_type = if_genil_message_container=>mt_all
                                       iv_delete_read_messages = abap_true ).
    CALL METHOD lr_msg_srv->get_messages
      EXPORTING
        iv_delete_read_messages = abap_true.

If anybody has experienced and solved such issue, please share.

Thanks in advance

Vishal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the following code:

DATA: lr_global_message TYPE REF TO cl_crm_genil_global_mess_cont.

DATA core TYPE REF TO cl_crm_bol_core.

core = cl_crm_bol_core=>get_instance( ).

lr_global_message = core->get_global_message_cont( ).

lr_global_message->reset( ).

if u want to delete only specific messages, then u can use :

lr_global_message->DELETE_MESSAGES method by supplying IV_MSG_ID and IV_MSG_NUMBER.

I hope this will be helpful to you.

former_member193352
Active Contributor
0 Kudos

Hello Vikas,

Thank you for the response. This code is unable to read the messages and hence unable to delete them. I believe the messages which I want to delete are present at the BOL layer. Hence only class CL_BSP_WD_MESSAGE_SERVICE can read them. Thanks for your response though.

Regards

Vishal

Answers (1)

Answers (1)

former_member193352
Active Contributor
0 Kudos

Resolved by self.

nisha_vinod
Advisor
Advisor
0 Kudos

Hi Vishal

Am facing a similar issue. Can you please explain how you resolved this?

Regards

Nisha

former_member193352
Active Contributor
0 Kudos

Hi Nisha,

You can refer to the following code:


data:  lr_core         TYPE REF TO cl_crm_bol_core,
          lr_mcm         TYPE REF TO cl_crm_genil_mess_cont_manager.

 lr_core = cl_crm_bol_core=>get_instance( ).
 lr_mcm = lr_core->get_message_cont_manager( ).
 lr_mcm->reset( ).

This code will delete all the messages in the global container. You also might like to check note # [1334939|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1334939]

I hope this helps.

Thanks

Vishal