cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete an item in the table

Former Member
0 Kudos

hi all ,

Is anyone there to give me an idea , how to delete the item in the table , by selecting the row. , for the what i have to do , is there any documentation to follow , guide me itys really urgent.

Accepted Solutions (0)

Answers (2)

Answers (2)

Madhu2004
Active Contributor
0 Kudos

Hai Madhu,

It is pretty simple.

First u define a button. and in onAction Event of the button write the following code.

process is as follows:

1)get the node

2)get the element

3)using the method remove_element() ,remove the element.

<u><b>The Sample Code is as follows</b></u>

DATA:

node_flighttab TYPE REF TO if_wd_context_node,

elem_flighttab TYPE REF TO if_wd_context_element.

node_flighttab = wd_context->get_child_node( 'FLIGHTTAB' ).

  • get element via lead selection

elem_flighttab = node_flighttab->get_element( ).

node_flighttab->remove_element( element = elem_flighttab ).

Follow the above code ,it will definately help you.

Former Member
0 Kudos

Hi Madhu.

If you have selected a row in a table you can get the selected element via the

lead selection of the bound context node.

just get the corresponding context node and the selected element, then call

remove element on this node:


DATA:
    lr_node                        TYPE REF TO if_wd_context_node,
    lr_selected_element      TYPE REF TO if_wd_context_element.

  lr_node = wd_context->get_child_node( NAME_OF_NODE ).
  lr_selected_element = lr_node->get_element( ).
  lr_node->remove_element( selected_element ).

The get_element() returns the actual selected (lead selection) element.

Hope this helps.

Cheers,

Sascha