cancel
Showing results for 
Search instead for 
Did you mean: 

Set lead selection

0 Kudos

Hi,

I have a table control in my UI and a button say ADD.

On action of ADD im appending an empty line to the table and i want to set this newly added line as the lead selection.

How can i do this?

Regards,

Victoria Wilma

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

Use Set lead selection index method .

lo_nd->set_lead_selection_index( '5' ).

Sample code :

DATA lo_nd_cn_popin TYPE REF TO if_wd_context_node.

DATA itab TYPE wd_this->elements_cn_popin.

DATA last_row type I.

lo_nd_cn_popin = wd_context->get_child_node( name = wd_this->wdctx_cn_popin ).

lo_nd_cn_popin->get_static_attributes_table( IMPORTING table = itab ).

describe table itab lines last_row.

last_Row = last_row + 1.

lo_nd_cn_popin->set_lead_selection_index( last_row )

Edited by: Saurav Mago on Nov 16, 2009 2:00 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

use set_lead_selection_index for the node to set the lead selection to a particular index


DATA lo_nd_cn_processarea TYPE REF TO if_wd_context_node.
DATA itab TYPE wd_this->elements_cn_processarea.

* navigate from <CONTEXT> to <CN_PROCESSAREA> via lead selection
  lo_nd_cn_processarea = wd_context->get_child_node(
  name = wd_this->wdctx_cn_processarea ).

lo_nd_cn_popin->get_static_attributes_table( IMPORTING table = itab ).

  lo_nd_cn_processarea->set_lead_selection_index( 1 ).

here I am setting it to 1 ,

for ur specific case , u first use get_static_attributes_table to get the data of ur table control into the internal table

thn u can set it to any other index , say i , as Saurav pointed using DESCRIBE ABAP statement

this statement gives the total no of rows in ur internal table

It wud help u solve ur query

rgds,

amit

Former Member
0 Kudos

Hi,

You can either use the SET_FIRST_VIISBLE row property or set_lead_selection of the if_wD_context_node..

Create a context attrbute for ROW and bind to this property...FIRSTVISIBLEROW

Now, on ADD handler you can set this attributes value..

Regards,

Lekha.