deleting Lines from Table UI Element
ich have a Problem deleting Lines from a table UI Element.
The Situation is like this:
I have a table ui element. if i click on a line and then on a button
i want to delete the line from the table.
How can i do this ?
Thanks a lot.
Uday Gubbala replied
Using "LeadSelection" you can select only 1 row at a time. You will have to make use of "Selection" for achieving this. First you will have to change the selection mode of the table to multiple & also change the selection property for the related context to 0..n . Use the below coding to get the multiple rows selected by the user into an internal table . You can then loop through this new internal table and delete those corresponding records from the main internal table. Hope that this helps resolve your problem.
METHOD onactioncopy_selected_rows . DATA: wd_node TYPE REF TO if_wd_context_node, wa_temp TYPE REF TO if_wd_context_element, lt_temp TYPE wdr_context_element_set. wd_node = wd_context->get_child_node( name = 'NODE1' ). CALL METHOD wd_node->get_selected_elements RECEIVING set = lt_temp. LOOP AT lt_temp INTO wa_temp. wd_node->remove_element( exporting element = wa_temp ). ENDLOOP.