cancel
Showing results for 
Search instead for 
Did you mean: 

Alv Table Lead selection

Former Member
0 Kudos

Hi all,

I have a alv table which display the list of PR, Now i want set the lead selection for the alv table. so that when i select one row and click on button it navigates to another view.

can any one suggest me how to set a lead selection in alv table?

Thanks all

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi vani,

Try following steps,

1. Double click on your table in the layout TAB, there you can see the Events under the Property.. In that there will be a event called on leadselect.

2. Write / create a event by giving your own name and then double click on that.It will navigate to methods tab. There you can write the code to call your view.. refer following code.

DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
         lo_el_cn_table TYPE REF TO if_wd_context_element ,
         ls_cn_table    TYPE wd_this->element_cn_table.
 
*   navigate from <CONTEXT> to <CN_TABLE> via lead selection
  lo_nd_cn_table = wd_context->get_child_node(
                   name = wd_this->wdctx_cn_table ).
**    get element via lead selection
  lo_el_cn_table = lo_nd_cn_table->get_lead_selection(  ).
  lo_el_cn_table->get_static_attributes( IMPORTING
             static_attributes = wa_table ).

Hope this will help.

Regards,

Renuka S.

former_member199125
Active Contributor
0 Kudos

hi

Set the lead selection property for node( which you binded to data node of alv controller )., then automatically table will display with lead selection row.

Regards

srinivas

former_member199125
Active Contributor
0 Kudos

hi

Set the lead selection property for node( which you binded to data node of alv controller )., then automatically table will display with lead selection row.

Regards

srinivas

saravanan_narayanan
Active Contributor
0 Kudos

Hello Vani,

Simple solution would be to set the lead selection of the context node that is passed to the ALV table. Once you set the lead selection for the context node, it will be automatically reflected in the ALV table.

BR, Saravanan

Former Member
0 Kudos

Hi,

For the node in context if you check on Initialization Lead Selection then first row will be selected automatically as lead selected.

After table is displayed if you select an element ,that particular index will be set as lead selected one for the node.

ln_xxx = wd_context->get_child_node( name = xxx ).

lm_xxx is of type IF_WD_CONTEXT_NODE.And the interface has several methods for setting index like

MOVE_FIRST,MOVE_LAST,MOVE_NEXT,MOVE_PREVIOUS.SET_LEAD_SELECTION_INDEX with which you can set the lead selection programatically.

ln_xxx->SET_LEAD_SELECTION_INDEX ( index = 5).

Regards

karthiheyan M