cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify which button is clicked in an action

Former Member
0 Kudos

Hi,

I am just checking whether it is possible to build calculator or not in webdynpro for abap.

I have some buttons and i have associated same action for all the buttons and in that action i would like to know which button is clicked.

Please let me know the code for that

Thanks

Bala Duvvuri

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Bala,

Its possible. Just go to the action handler for the button & read the attribute ID of the WDEVENT which is passed by the framework. This id will contain the id of the button which triggered the event. Consider the code fragment below:

method ONACTIONACTION .
    DATA:  lv_button_name type string.
    lv_button_name = wdevent->get_string( name = 'ID' ).
endmethod.

At the end of execution lv_button_name will have the ID of the button which triggered the event.

Regards,

Uday

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Please go through these links on the same for the possiblity for developing a calculator -

Regards,

Lekha.

Former Member
0 Kudos

Use WDEVENT which is used to capture the UI element events that you have created on the View.

data l_button_name type string.

l_button_name = wdevent->get_string( name = 'ID' ).

case l_button_name.

when u2018button1u2019.

<Code>

when ' button2'.

<Code>

endcase

using above , u will able to fetch the Button ID.