on 05-17-2007 4:17 AM
Hi,
I am new to webdynpro.I am using a table control in my view and I have selected the selection mode as multi(For selecting more than 1 row)and I have updated the cardinality also.It is working fine and it is allowing to select more than 1 row.But actually I need to retrieve the selected rows and i have to put into some other table.but when i use the get_selected_elements() ,it is always having only one row.
Could anybody tell me whether lead selection can be done for 1 row only? is this a limitation in webdynpro or not?
Regards,
Rohini.M
Hi Rohini,
I think you have used the wizard code and before calling the method get_selected_elements() are you calling get_element() for the node?
The following lines of sample code may help:
DATA lo_nd_spfli TYPE REF TO if_wd_context_node.
DATA lo_el_spfli TYPE REF TO if_wd_context_element.
data: lv_WDR_CONTEXT_ELEMENT_SET type WDR_CONTEXT_ELEMENT_SET.
DATA ls_spfli TYPE wd_this->element_spfli.
* navigate from <CONTEXT> to <SPFLI> via lead selection
lo_nd_spfli = wd_context->get_child_node( name = wd_this->wdctx_spfli ).
lv_WDR_CONTEXT_ELEMENT_SET = lo_nd_spfli->GET_SELECTED_ELEMENTS( ).
If still this does not work then pass the parameter INCLUDING_LEAD_SELECTION as abap_true to the method call. In my scenario without passing this parameters all the records are coming, but if the code does not work then try with passing this parameter.
Best regards,
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi suresh,
Thanks for your quick reply.I have used the same code as given by you.
Actually I have created an action(GetSelected) and bound to the property OnLeadSelect.Then in that action I have called the get_selected_elements and all
other code.
I can select the first row by clicking and then other rows by pressing ctrl button.
So When i try to debug by putting a breakpoint in that action,when i select a row by clicking,then it is going to that action.(I think that's why it is always having 1 value)
If I need to retrieve all my selected row values,where should I put my code.
Also I tried passing the parameter "including_lead_selection = ABAP_true".But still
same situation exists.
Thanks and Regards,
Rohini.M
Hi Rohini,
OnLeadSelection event this code does not work since the secound record we select is not the lead selection since only one record can have lead selection. Hence if you observe if we have the breakpoint in leadselection method and when we select the 2 row by pressing CNTRL key leadselection method will not be called. This is the expected behavior.
In order to get the selected records we can write the same logic in some button and we can get all the selected records.
Hope this helps.
Best regards,
Suresh
Message was edited by:
Suresh Honnappanavar
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.