on 09-08-2014 1:07 PM
Hi all,
I am trying to capture the selected rows on lead select in ALV.
I have tried with supply function and ON_LEAD_SELECT event of ALV.
When I am trying this I am able to capture only one row but not multiple.
I don't want use any extra actions or buttons to get the selected rows, it must be possible only through any ALV events or using supply function.
BR,
Eshwar
Hi ,
If you tried with ON_SELECT and this is not working, maybe is OK for you in one of the methods WDDOBEFOREACTION, WDMODIFYVIEW OR WDDOAFTERACTION .
Hope this will be OK for you,
Hancila
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use the event ON_SELECT.
Everytime you select a line this event is fired.
It supplies you the OLD_LEAD_SELECTION and the NEW_LEAD_SELECTION.
If the parameter SELECTION_TYPE contains RANGE,
the use has selected a range of lines.
With the statements above form Amy you can get the selected lines.
The problem is,
You never know if the user just wants to select one line or he wants to make a multiple selection on the the first time the event is raised.
Greetings Maarten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eshwar,
In addition to a single lead selection, a context node also keeps track of all selected elements. Take a look at method GET_SELECTED_ELEMENTS of interface IF_WD_CONTEXT_NODE. Note the optional parameter, including_lead_selection.
data lo_nd_node type ref to if_wd_context_node.
data lt_elements type wdr_context_element_set.
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
lt_elements = lo_nd_node->get_selected_elements( including_lead_selection = abap_true ).
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
With multi selection( CTRL + click), the lead select event will not be triggered. You can create a custom button and read the selected rows.
Or, On Lead_select, or each row append the row index/data to internal table and then loop that internal table ans use set_selected_elements or set_lead_selection_index.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eshwar,
I had a similar request:
The solution was something like :
data lt_temp TYPE wdr_context_element_set,
lo_nd = wd_context->get_child_node( ...)
lt_temp = lo_nd->get_selected_elements.
" now get data
If lt_temp is not initial.
loop at lt_temp into ls_temp
ls_temp=>get_static_attributes(importing static_attributes = ls_values).
append ls_values to lt_values.
else.
"error message-> no line selected
endif.
Have fun with this,
Hancila
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.