cancel
Showing results for 
Search instead for 
Did you mean: 

Delete record from standard table

Former Member
0 Kudos

Hi Experts,

I have a normal table with Delete button on each row. When it is clicked, that particular row should be deleted from the internal table which is bound to the context and that record also has to be deleted from the standard table as well.

A detailed reply would be appreciated.

Thanks in Advance,

Mirza.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mirza,

Write the below code in your onAction method of delete button.

DATA: lo_nd_flights TYPE REF TO if_wd_context_node,

lo_el_flights TYPE REF TO if_wd_context_element,

ls_flights TYPE if_main=>element_flights,

it_flights type if_main=>elements_flights.

  • navigate from <CONTEXT> to <FLIGHTS> via lead selection

lo_nd_flights = wd_context->get_child_node( name = wd_this->wdctx_flights ).

  • get element via lead selection

lo_el_flights = lo_nd_flights->get_element( ).

  • get all declared attributes

lo_el_flights->get_static_attributes(

IMPORTING

static_attributes = ls_flights ).

CALL METHOD LO_EL_FLIGHTS->GET_INDEX

RECEIVING

MY_INDEX = v_index.

*get the data from table

CALL METHOD

NODE_FLIGHTS->GET_STATIC_ATTRIBUTES_TABLE

IMPORTING

TABLE = it_flights.

*delete record from internal table

delete table it_flights from ls_flights index v_index.

*Delete record from table

delete zflight from ls_flights.