on 05-08-2013 1:16 PM
Hi all,
everything works fine if I select more than one row in an alv table. But if I sort the alv before by clicking on a column header the get_selected_elements doesn't work any more and lt_selected_elements is empty. What can I do? Any ideas? Here is the code:
DATA:
lo_nd_t_rusmnt_rau TYPE REF TO if_wd_context_node,
lo_selected_element TYPE REF TO if_wd_context_element.
DATA:
lt_selected_elements TYPE wdr_context_element_set.
DATA:
ls_ui_rusmnt_rau TYPE ztpzp_s_ui_rusmnt_rau.
* Initialisation
CLEAR: pet_ui_rusmnt_rau.
* Get selected rows in employee list...
lo_nd_t_rusmnt_rau = wd_context->get_child_node( name = wd_this->wdctx_t_rusmnt_rau ).
lt_selected_elements = lo_nd_t_rusmnt_rau->get_selected_elements( ).
LOOP AT lt_selected_elements INTO lo_selected_element.
lo_selected_element->get_static_attributes( IMPORTING static_attributes = ls_ui_rusmnt_rau ).
APPEND ls_ui_rusmnt_rau TO pet_ui_rusmnt_rau.
ENDLOOP.
The context node has the Cardinality 0..n, Selection also 0..n and the Initialization Lead Selection is empty.
In the wd_init I defined multi_no_lead:
lr_cmdl->if_salv_wd_table_settings~set_selection_mode( cl_wd_table=>e_selection_mode-multi_no_lead ).
Thanks, Susanne
once you sort alv it take control over internal table index created by node we lost.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.