cancel
Showing results for 
Search instead for 
Did you mean: 

Action and buttons ?

Former Member
0 Kudos

Hello,

Can I assign same acction to two different buttons and inside the event get to know from which button the action is fired ?

Regards,

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks guys, will try this out....

uday_gubbala2
Active Contributor
0 Kudos

Hi Shah,

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

Former Member
0 Kudos

Hello ,

This can be acheived by using the method

DATA: lv_element_id type string .

WDEVENT->GET_STRING ( EXPORTING NAME = 'ID'

IMPORTING

value = lv_element_id . )

both button will have the diffferent id .

Regards

Vivek

PS: please provide the points if answer is helpful .

Former Member
0 Kudos

WDEVENT is an importing parameter inside the ACTION Handler .

Former Member
0 Kudos

Hi Shah,

you cann't create same action to two different buttons.it will give error saying that "There is already an action named ACTION".So it is not possible.