on 11-16-2009 8:26 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.