on 01-09-2008 5:28 AM
Hi,
There is one table control in my WDA application.
If the user selects one row and click the delete row button ,
the row should be deleted from the table control.Give me some sample code to do this.
Regards,
Charumathi.B
Hi Charumathi ,
inside the action of your delete button using
code wizard read the node thats binded to the tablectrl into a work area wa_tabll (just read the lead selected one) .. now.
using the code wizard read the whole itab from that node to itab.
now delete wa_tabll from itab.
then bind the itab back to node.. thats all
Regards
Sarath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sample code:
DATA lo_nd_node_details TYPE REF TO if_wd_context_node.
DATA lo_el_node_details TYPE REF TO if_wd_context_element.
DATA ls_node_details TYPE wd_this->element_node_details.
DATA check TYPE abap_bool.
lo_nd_node_details = wd_context->get_child_node( name = wd_this->wdctx_node_details ).
lo_el_node_details = lo_nd_node_details->get_lead_selection( ).
check = lo_nd_node_details->remove_element( lo_el_node_details ).
Regards,
Rakesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
get the selected row .
in the delete action code
get all the table rows in a internal table and delete the selected row using your own logic.
again bind the internal table with the UI element.
i think this will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi charumathi....
you can get the selected row by lead selection.
read the node.
consider the record to be deleted is in index 5 and you are having 6 records in it.
then:
delete itab index 5.
now bind it again to the node.
--regards,
alex b justin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
write this code in the event handler method of the table onSelect Event.
data: lr_node type ref to if_wd_context_node.
data: lr_element type ref to if_wd_Context_element.
lr_node = wd_context->get_child_node( '<node_name>' ).
this statement will return the selected row element
lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
lr_node->remove_element( element = lr_element ).
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.