on 10-13-2008 7:28 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.