cancel
Showing results for 
Search instead for 
Did you mean: 

table with a button column to perfrom acton info req?

Former Member
0 Kudos

Hi,

I am working with a display of a table with records in it,& in last column there button FORWARD,which performs the desired action for the row selected.

now my problem is that,forward button is enabled against each records,& only if the selected record row is processed for perform action it do that,but as my all buttons are enabled,if the user pressed the button against the let says 3 row,it don't do any action,so i want that if user does so,he press any button on the not selected row,his selected row should be moved to this particular row & ask to perform the action.

pls tel how to do this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

1. First get the index of the row in which button is pressed.

2. Set the lead selection of Table to that particular row.

To get index of row in which button is pressed :

data: lr_element type ref to if_wd_context_element.

DATA ls_cn_popin TYPE wd_this->element_cn_popin.

lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

data lv type I.

lv = lr_element->GET_INDEX( ).

To set the lead selection of row :

DATA lo_nd_cn_popin TYPE REF TO if_wd_context_node.

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

lo_nd_cn_popin->set_lead_selection_index( lv ).

After this you can prompt the user asking whether to perform action or not.

I hope this is what you were looking for.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Do you want to disable all tbuttons for rest of the rows and enable only for selected one...Is that so...

If this is the case, create a ENABLE (wdy_boolean) inside the node to which the table is bound.

Now,

When ever you get the data for first time - then lead selection is 1 right...

loop at lt_table into ls_table

if sy-tabix eq 1.
ls_table-enable = space.  "enable
else.
ls_table-enable = 'X '.  "Disable
endif.
modify lt_table from ls_table index sy-tabix.
endloop.

Bind the table to node.

You might have implemented the onLeadselction for that table right -

In this event also, based on lead selection index repeat the above code.

Regards,

Lekha.

Edited by: Lekha on Oct 29, 2009 11:18 AM