cancel
Showing results for 
Search instead for 
Did you mean: 

Lead selecting a row by default while inserting a row in table

Former Member
0 Kudos

Hi all,

Am using the table UI element in my WD component. while inserting a row into the table I want that newly inserted row to be lead selected by default.

In my insert method am using append statement to insering a row and am binding the internal table.

Pls suggest some method to lead select the row by default while inserting and where can i use the method???

Thanks in Advance,

Nalla B.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Let the name of the context node which holds the table data be NODE. Then add the following code after inserting a new entry.

* Data declaration for context node
DATA lo_nd_node TYPE REF TO if_wd_context_node.

lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).

*  Highliting the selected button
lo_nd_node->set_lead_selection_index(
index = sy-index ).

This will select the entered row.

Regards,

Sayan


Former Member
0 Kudos

Thanks sayan.

It worked.

Answers (1)

Answers (1)

chengalarayulu
Active Contributor
0 Kudos

Hi Balu,

1. store the count of elements globally while initial binding of the node.

2. When you click on insert just add 1 to the count.

3. set the lead selection i.e. node->set_lead_selection_index( <incremented count> ).

4. now newly added row is set to lead selection.

hope this would resolve.