cancel
Showing results for 
Search instead for 
Did you mean: 

How to get lead selectced lines?

Former Member
0 Kudos

Hi evryone,

Do you konw how to read the lines selected in a ALV table in WDA, if the line is one I know how to do, but if the lines are more than one but not all...what can I do to read only the selected lines?

thank you..

Accepted Solutions (0)

Answers (3)

Answers (3)

baskaran00
Active Participant
0 Kudos

Hi Fabiocoppi,

May be below code sample will be helpful for you...

DATA: lc_index TYPE I VALUE 0,

lo_node TYPE REF TO if_wd_context_node,

lo_element TYPE REF TO if_wd_context_element.

DATA : it_sets type WDR_CONTEXT_ELEMENT_SET,

wa_sets like LINE OF it_sets.

CALL METHOD LO_NODE->GET_SELECTED_ELEMENTS

EXPORTING

INCLUDING_LEAD_SELECTION = ABAP_TRUE

RECEIVING

SET = it_sets.

loop at it_sets into wa_sets.

CALL METHOD WA_SETS->GET_INDEX( RECEIVING MY_INDEX = lc_index ).

lo_element = lo_node->get_element( index = lc_index ).

endloop.

Thanks...

Former Member
0 Kudos

Interesting login name ( Router ) :).

Manas Dua

Former Member
0 Kudos

Hi,

If you have changed the cardinality of selction of node to 1..N or 0..N then for node there is a method

called as get_selected_elements, try using this.

if_wd_context_node, method get_selected_elements

Also while configuring your ALV you have to call method

lr_table_settings->set_selection_mode( EXPORTING value = '04' ).

where '04' stands for multi.

Regards

Manas Dua

Edited by: Manas Dua on Mar 15, 2010 10:23 PM

p330068
Active Contributor
0 Kudos

Hi Fabiocoppi ,

Please check this : /people/thomas.szcs/blog/2006/07/24/basic-concepts--selection-vs-leadselection

Regards,

Arun