cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle marked rows in an ALV table

Former Member
0 Kudos

Hi Experts,

there is an ALV table in my Web Dynpro. It has a functionality to handle one marked row via lead selection. This is the coding to get the marked row:

lr_nd_ma_leist = wd_context->get_child_node( name = wd_this->wdctx_tab_ma_leist ).
lr_el_ma_leist = lr_nd_ma_leist->get_lead_selection( ).
idx = lr_el_ma_leist->get_index( ).

My problem is to handle more than one marked row. I changed the contexts' properties to allow to mark more than one row. But how can I get the number and the index of all the marked rows?

Thanks in advance,

Tan

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

use the method get_element_selected( ) and get_index( ).


data sel type WDR_CONTEXT_ELEMENT_SET.
sel = lo_nd_zdealer->get_selected_elements( INCLUDING_LEAD_SELECTION = abap_true ).
data el type ref to if_wd_context_element.
data indx type  i.

loop at sel into el.
  indx = el->get_index( ).
  endloop.

thanks

sarbjeet singh

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you guys, it's working perfect.

Former Member
0 Kudos

You probably have to get the selected elements from the context node like this

DATA lt_elem_set TYPE wdr_context_element_set.

lt_elem_set = lr_nd_ma_leist->get_selected_elements( )

Edited by: Baskaran Senthivel on Feb 28, 2011 10:14 AM