cancel
Showing results for 
Search instead for 
Did you mean: 

Lead selected row indexes in Webdynpro ALV

former_member450029
Participant
0 Kudos

Hi All,

How to get all the lead selected row indexes in Webdynpro ALV.

For suppose, I select 1,3 and 4 rows in ALV I should get all the corresponding Row Indexes.

Best Regards,

Eshwar

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Use get_selected_elements( ) of context node to get the selected records.

Code:


DATA: lr_node TYPE REF TO if_wd_context_node,

       lr_elem TYPE REF TO if_wd_context_element,

lt_elem LIKE STANDARD TABLE OF lr_elem.

lr_node = wd_context->get_child_node( name = 'NODE_NAME' ).

lt_elem = lr_node->get_selected_elements( ).

To get the index loop over lt_elem and then use get_index( ) method


Loop at lt_elem into lr_elem.

lv_index = lr_elem->get_index( ).

* to get row data

call method lr_elem->get_static_attribute

IMPORTING

static_attributes = ls_node.

hope this helps,

Regards,

Kiran

Answers (3)

Answers (3)

former_member450029
Participant
0 Kudos

Hi,

How can I get the column name in ALV webdynrpo.

And the first thing is.. Is it possible to select a column in webdynpro ALV ?

If column gets selected I need to capture the column name if some action is done.

Regards,

Eshwar

harsha_jalakam
Active Contributor
0 Kudos

Hi Eshwar,

Please check the following code for getting the selected rows.

DATA :   lt_sel_elem  TYPE wdr_context_element_set.

DATA lo_node TYPE REF TO if_wd_context_node.

lo_node = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

  CALL METHOD lo_node->get_selected_elements

    RECEIVING

      set = lt_sel_elem.

Regards,

Harsha

Former Member
0 Kudos

Hi,

I think this example explains the steps quite well. Pls have a look at

http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/wdp-table-row.htm

Br,

Tim