cancel
Showing results for 
Search instead for 
Did you mean: 

Delete a particular row in a table

Former Member
0 Kudos

Hi.

How to delete row(s) selected in a table?

To elaborate, i have a table and a delete button in the toolbar.

When user selects a row and presses the delete button, the selected rows should be deleted.

thanks in adv.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Aishi.

You can get the actual selected row via the lead selection. If multiple selection is allowed you can get all selected elements as wdr_context_element_set via the method context_node->get_selected_elements( ).

Then loop the set and remove each element from the node:


data: 
        lt_selected_nodes     type wdr_context_element_set, 
        lr_element        TYPE REF TO if_wd_context_node,
        lr_node             type ref to if_wd_context_node.


lr_node = wd_context->get_child_node( 'YOUR_NODE_NAME' ).
lt_selected_elements = lr_node->get_selected_elements( ).

loop at lt_selected_elements into lr_element.
  lr_node->remove_element( lr_element ).
endllop.

Hope this helps.

Cheers,

Sascha

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

you can get the selected element from your node as well as all the elements

delete the selection from the table of all entries and then bind the adapted table

to the node (one of the options)

grtz

Koen

edit sorry simultanious post

Message was edited by:

Koen Labie