Skip to Content
Author's profile photo Hasan Rafiq

Navigation/Event handling with messages in CRM Web-UI

Purpose :

To trigger/handle events from messages in CRM Web-UI.

Explanation :

In CRM Web-UI, we can enable messages to appear as links, on the click of which a custom event can be triggered. Eg: On the click of a particular message , you can change status of a transaction or navigate to another page etc.


Steps :

1. In the view controller’s class in tcode : BSP_WD_CMPWB, add an interface : IF_BSP_WD_MESSAGE_HANDLER ( This interface is responsible for handling message events ).


2. We need to subscribe the message’s handler class, this can be done in any method in the controller class : I prefer , DO_INIT_CONTEXT.

DATA : lr_msg       TYPE REF TO cl_bsp_wd_message_service.

   lr_msg ?= cl_bsp_wd_message_service=>get_instance( ).

Subscribe message for handling with the controller class



           iv_message_class  ‘ZCRM_MESSAGES’   ” Messages, Message Class

           iv_message_number ‘006’   ” Messages, Message Number

           iv_subscriber     me  ” Interface for Error Handler


     CATCH cx_bsp_wd_dupl_mess_subscr.    ” Error: Double Registration for a Message


3. In the controller class ( IMPL’s ) method : IF_BSP_WD_MESSAGE_HANDLER~HANDLE_MESSAGE , you can handle the message events like this :


   if is_messageid = ‘ZCRM_MESSAGE’ and is_messagenumber = ‘006’.

     “logic to handle event



Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.