cancel
Showing results for 
Search instead for 
Did you mean: 

Event parameter mapping for Webdynpro ABAP

sreenivas_pachva
Participant
0 Kudos

Hi Webdynpro Guys,

How to do the coding for Event parameter mapping for User interface elements in a view of Webdynpro ABAP ?

I have gone through SAP Help document for parameter mapping.. I got quiet understand within that doc, but not much.So I couldn't able get to define same action method( one Event handler ) for Different UI elements in a same view of Webdynpro component.

Could you please share info with example regarding that one ...?

Thanks in advance.

Best Regards:

------------------

Sreenivas Pachva

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sreenivas,

You can retrieve the UI element ID from the WDEVENT import  parameter of the associated action method( one Event handler ).

For example if you have associated action 'GO' with 3 different UI elements then to identify which UI element has triggered this action you can use the below code snippet..

METHOD onactiongo .

* Data declaration

  DATA lv_id TYPE string.

* Retrieve the UI element ID which has triggered the action

  CALL METHOD wdevent->get_string

    EXPORTING

      name  = 'ID'

    RECEIVING

      value = lv_id.

NB : 'wdevent' is the import parameter of the action handler

ENDMETHOD.

Hope this helps.

Regards,

Sonia

former_member213957
Participant
0 Kudos

Hi Sonia,

Then how to pass/store the parameter id/value under wdevent importing parameters.

Can we pass the values of event as well as read n the webdynpro-runtime ?

regards,

Kishorekumar SVS

Former Member
0 Kudos

Hi Kishore,

Sorry for the late reply.

Please refer the below link for your query.

http://help.sap.com/saphelp_erp60_sp/helpdata/en/f9/64c0410c2dcc17e10000000a155106/content.htm

Regards,
Sonia

aferngas
Active Participant
0 Kudos

Hi Sreenivas,

Yes, you can use the same event handler for different actions of UI elements. The custom parameters desired for an event must be defined for each UI element in WDDOMODIFYVIEW. To map the parameters you should use a specific method of UI element for each permitted action.

In example, if you take a radiobutton (if_wd_radiobutton) in your view you can use the method "map_on_select" and define which context data would receive in event handler for select event of radiobutton. This parameters will arrive to WDEVENT parameter (common of all handlers) as a type of CL_WD_CUSTOM_EVENT.

Regards,

Alex