Quantcast
Channel: SCN : Document List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 189

Navigation/Event handling with messages in CRM Web-UI

$
0
0

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.


1.png


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

 

1.png

 

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

       lr_msg->subscribe_message(

         EXPORTING

           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

   ENDTRY.


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


method IF_BSP_WD_MESSAGE_HANDLER~HANDLE_MESSAGE.

   if is_message-id = 'ZCRM_MESSAGE' and is_message-number = '006'.

     "logic to handle event

   endif.

endmethod.


Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>