cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass parameters by event between two sessions

Former Member
0 Kudos

Hi,

   I have two Web Dynpro components, which can't work in one session. And click session1's button1 to open seesion2 by URL, and this URL contains a parameter EVENT_ID. This event is registered(using class  cl_wd_notification_service) in session1 when you click button1.

  And there's a button,called button2, in session2. Click session2's button2, we can prepare some useful data(USEFUL_DATA) here, and then call function  cl_wd_notification_service=>update_event_status( event_id = EVENT_ID) to update the event's status.

  After that it can trigger the registered event in session1, and go to the handle method. I want to get the session2's USEFUL_DATA in session1's event handle method.

How can I set my USEFUL_DATA as parameter to the event?

Here's the code:

----------Code in session1's button1 click handle method--------------------

   DATA lo_view     TYPE REF TO if_wd_view_controller.

   DATA lo_service  TYPE REF TO if_wd_notification_service.

   DATA lv_event_id TYPE wdr_notification_id.

   lo_view ?= wd_this->wd_get_api( ).

   lo_service = cl_wd_notification_service=>get_service(

       view_controller      = lo_view ).

   lv_event_id = lo_service->register_new_event(

     action   = 'REFRESH_STATUS' ).

   wd_comp_controller->as_event_id = lv_event_id.

   wd_comp_controller->launch_app( ).


----------parameter I can get in session1's event handle method--------------------


WDEVENT : CL_WD_CUSTOM_EVENT


----------Code in session2's button2 click handle method--------------------

   DATA useful_data TYPE string.

   useful_data = 'data have to pass by event in two sessions'.

   cl_wd_notification_service=>update_event_status(

    EXPORTING

      event_id = wd_comp_controller->as_event_id       "EVENT_ID

      event_status = cl_wd_notification_service=>c_status_done ).




Thanks!

Lulu

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

You can use shared memory object to achieve this. Check this document for reference:

hope this helps,

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

  

    Thank you so much, I applied your solution in my application and it does work.

Thanks again,

Lulu

Answers (1)

Answers (1)

former_member222068
Active Participant
0 Kudos

Hi Lulu,

This link would help you to share data between two different sessions.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2003a78c-88e5-3010-b0b7-f6b2f62f9...

Thanks & Regards,

Sankar Gelivi