Skip to Content

Delete UI Messages

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
        iv_delete_read_messages = abap_true.

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

Thanks in advance


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 12, 2011 at 05:58 AM


    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.



  • Apr 13, 2011 at 06:18 AM

    Resolved by self.

    Add comment
    10|10000 characters needed characters exceeded