on 10-28-2013 5:35 PM
Hi all gurus,
I'm working on a (standard) ABAP WD Table in a Web Dynpro Component's view.
Its default selection method is set to Multi with Lead Selection; I want to switch it to MultiNoLead.
I was able to do it dynamically adding this sketch of code in WDDOMODIFYVIEW's post-exit, in "first time" condition:
* change to multiNoLead
CALL METHOD l_table->set_selection_mode
EXPORTING
value = '08'. "multiNoLead
CALL METHOD l_table->set_on_select
EXPORTING
value = 'ADD_TO_SELECTION'.
So, now the table selection mode is set to Multi- No Lead, and the method ONACTIONADD_TO_SELECTION is triggered any time user selects a row.
The problem is that ONACTIONADD_TO_SELECTION has the input object, WDEVENT, which is empty.
The previous, standard ONACTION_ONLEADSELECT had some useful parameters I used to:
- determine the previous lead selection;
- determine the CURRENT lead selection.
Now, on my new method, I just need to know what's the row (element) which has been selected (or deselected).
I don't know however how to define such parameters and bind them dynamically. Can anyone help me out/suggest some wiki/howto?
P.S. I can't simply use GET_SELECTED_ELEMENTS as this would return *all* the selected elements and not only the current one.
Hi Matteo,
You can use context change log for this purpose. Activate context log before the view is displayed. And you can get the changes by calling the method GET_CONTEXT_CHANGE_LOG() of the interface IF_WD_CONTEXT. This method will return a table with a line type WDR_CONTEXT_CHANGE
Check if there is any type 'S' record in the table (field CHANGE_KIND).
Thanks,
Ajay Bose
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matteo,
Do the following in the controller wddoinit method to activate context log:
DATA: lo_context TYPE REF TO if_wd_context.
lo_context = wd_context->get_context( ).
lo_context->enable_context_change_log( ).
Once the context change log is turned on, it will begin tracking changes behind the scenes. At any point along the way, we can view the contents of the change log by invoking the method
GET_CONTEXT_CHANGE_LOG() of the IF_WD_CONTEXT interface. This method will return a table with a line type WDR_CONTEXT_CHANGE as I had mentioned.
Finally once you leave the view, call
lo_context->reset_context_change_log( ) to reset the context log.
Thanks,
Ajay Bose
Hi ,
Get selected elements by method GET_SELECTED_ELEMENTS and store as attribute. So compare past and present values to get which rows are selected or deselected.
Regards,
Sreenivas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this Help : http://help.sap.com/saphelp_nw73/helpdata/en/f9/64c0410c2dcc17e10000000a155106/content.htm
In this the example shown for link to action events, similarly you can use for Table event handler.
Hope this helps u.,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.