on 10-26-2010 8:46 AM
Hi,
I'm new to SAP.
In my Application View when im clicking delete button by selecting the row the value is deleted only in view but not in table when I'm refreshing the view again I'm getting the record which i deleted can anyone assist me how to delete from table through view
here by im ataching the code which i have implemented for Delete Button
METHOD onactionremove .
DATA lo_nd_main TYPE REF TO if_wd_context_node.
DATA lo_el_main TYPE REF TO if_wd_context_element.
DATA ls_main TYPE wd_this->element_main.
lo_nd_main = wd_context->get_child_node( name = wd_this->wdctx_main ).
* @TODO handle not set lead selection
IF lo_nd_main IS NOT INITIAL.
* get element via lead selection
lo_el_main = lo_nd_main->get_element( ).
* @TODO handle not set lead selection
IF lo_el_main IS NOT INITIAL.
lo_nd_main->remove_element( lo_el_main ).
ENDIF.
ENDIF.
ENDMETHOD.
Hi Madhu
DATA lo_nd_main TYPE REF TO if_wd_context_node.
DATA lo_el_main TYPE REF TO if_wd_context_element.
DATA lt_itab type if_main=>elements_main.
DATA ls_main type if_main=>element_main.
lo_nd_main = wd_context->get_child_node( name = wd_this->wdctx_main ).
lo_el_main = lo_nd_main->get_element( ).
lo_el_main->get_static_attributes(
IMPORTING
static_attributes = ls_main ).
lo_nd_main->get_static_attributes_table(
importing
table = lt_tab ).
DELETE it_tab where <key> eq ls_main-<key value>.
lo_nd_main1->bind_table( it_tab[] ).
Try to check with this code
Thanks
Tulasi Palnati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Madhu,
In the attached code, you are just deleting from the view. When you delete from the view, you should also write code for deleting from the database table.
Refer the below link for that.
[Deleting from Database Table|http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb3aef358411d1829f0000e829fbfe/content.htm]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.