cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Button

Former Member
0 Kudos

Hi Experts,

I have the following requirement: In a normal table, when Delete button(button is placed on that row) is clicked , that particular record should be deleted.

Any hints in this regard.

Thanks in Advance,

Mirza.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Try the following sample coding in ur component according to ur application.

Write the Following the Coding inside ur Delete Method.

DATA lo_nd_sflight TYPE REF TO if_wd_context_node.
  DATA lo_el_sflight TYPE REF TO if_wd_context_element.
  DATA lt_sflight TYPE wd_this->elements_sflight.
  DATA ls_sflight TYPE wd_this->element_sflight.

  DATA lr_element TYPE REF TO if_wd_context_element.

  DATA lv_index TYPE i.

* navigate from <CONTEXT> to <SFLIGHT> via lead selection
  lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

  lo_nd_sflight->get_static_attributes_table(
    IMPORTING
      table = lt_sflight ).

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

  lv_index = lr_element->get_index( ).

  DELETE lt_sflight INDEX lv_index.

  lo_nd_sflight->bind_table( lt_sflight ).

Regards,

Padmam.

Former Member
0 Kudos

Hi Mirza,

Get the index of the selected row using the genereted code of code wizrd when you read the context of table and you will also get the seleted data into structure then get the table data into internal table using like

node_tab->GET_STATIC_ATTRIBUTES_TABLE

importing

table = it_tab.

delete it_tab from stru index v_index.

Former Member
0 Kudos

Hi,

Try to create a button for the delete. as you get the lead selection record then try to delete the record and modify the internal table then again bind this resulted table to the context for the upadted records.

Write this code in the action handler of the button for deletion of record.

Regards

Lekha