on 10-15-2009 11:23 AM
Hi,
Please tell me how to delete a record from the UI table in web dynpro abap on click of a button.
Plz reply.
Thanks & Regards,
Raji.
hi,
Get the content of Table into a intenal table. Ex : Use this method GET_STATIC_ATTRIBUTES_TABLE of if_wd_context_node.
Get the index of row seleted which is to be deleted. Ex. Use this mehod GET_LEAD_SELECTION_INDEX of if_wd_context_node.
Delet the row from internal table. <Delete statement>
Bind the internal table again with the node. < Use method bind_table of if_wd_context_node.>
Refer this Sample Code :
data i1 type I.
lo_nd_po->get_static_attributes_table( itab ).
i1 = lo_nd_po->get_lead_selection_index( ).
delete itab index i1.
lo_nd_po->bind_table( itab ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raji,
to delete the record for the table.
the user will first select the record to be deleted and then clicks the button to delete record.
So on the action of that button you can read the selected record using get_static_atributes.
like...
lo_el_prf_exp_cer_detail->get_static_attributes(
IMPORTING
static_attributes = ls_prf_exp_cer_detail ).
so ls_prf_exp_cer_detail holds the record to be deleted.
so the record can be deleted from DB or temp accordingly to your requirement.
Regards,
Priya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the on action of that button , write code to delete
following sample code wud help u to get the index of the line which u want to delete from ur table
DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
lo_el_cn_table TYPE REF TO if_wd_context_element ,
ls_cn_table TYPE wd_this->element_cn_table.
* navigate from <CONTEXT> to <CN_TABLE> via lead selection
lo_nd_cn_table = wd_context->get_child_node(
name = wd_this->wdctx_cn_table ).
** get element via lead selection
lo_el_cn_table = lo_nd_cn_table->get_lead_selection( ).
lo_el_cn_table->get_static_attributes( IMPORTING
static_attributes = wa_table ).
data lv type I.
DESCRIBE TABLE itab LINES lv.
delete itab where INDEX = // ur specified index
I hope it wud help u
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.