How can I pass parameters in event?
Say, I have a SAVE button in 3 different views. All will do more or less the same task and so they all call a common module.
But I need to pass some flag or variables from each view to do view-specific task.
How to pass data with each event?
Thanks in adv.
Request clarification before answering.
All ideas from Koen, Rich and Anuj will work.
To address the question literally as asked, pass a parameter in event,
this is also possible. This can make sense under some circumstances.
You can set a button, so that the action called then receives this parameter.
for example Used when multiple buttons should call same action.
how....
CL_WD_BUTTON->map_on_action( parameters = plist )
you need to get the button element from view first..
then use the map on action method to add your parameters.
These will be passed to the action when the button is pressed.
Of course Koen's recommendation is easier, and suits 90% + situations.
So try the easier way first.
Cheers
Phil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's the thing I was looking for Phil.
I can address this issue by declaring global attributes, but i wanted to know how to pass parameters in event per se!
One reason why I asked this question:
See example WDT_TABLE. In VIEW_2, in the MY_BOOKING_TABLE, there is an action ON_CHANGE_FLIGHT which is assigned to onLeadSelect event.
In the event handler method, they have one more parameter NEW_ROW_ELEMENT.
Now where does this NEW_ROW_ELEMENT come from?
Can you tell me this also please?
Thanks again.
Hi Expets. Any reply to my query?
I post it again:
See example WDT_TABLE. In VIEW_2, in the MY_BOOKING_TABLE, there is an action ON_CHANGE_FLIGHT which is assigned to onLeadSelect event.
In the event handler method, they have one more parameter NEW_ROW_ELEMENT.
Now where does this NEW_ROW_ELEMENT come from?
Also, one thing I wanted to confirm. Is the context element from where the evvent was fired (for eg on_enter) always passed along with the event? i.e. can I just import contextt element too, and assume it shall be pointing to the element from where the event was fired?
Thanks.
Hi Aishi
When you try to assign an action to onSelect property of a Table control,
try to use the create option available against onSelect Property where you
enter the Action name and there is a check box available, if you check it
all the parameters are automatically passed by the framework.
Regards
Abhimanyu L
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.