on 12-30-2011 8:48 AM
Hi Abap Gururs,
when i will delete one row from view, automatically one new row should add in same view.
kindly tell how to do?
Hi sanasrinivas ,
Thank you for the reply. You got my issue. can i get the code for this.
Thanks,
Sagarika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
check this
This code will delete the selected records in table and will create the new rows.
node1 is the node name which binded to datasource of table.
data count type i.
data pos type i value 1.
lo_nd_node1 type ref to if_Wd_context_node.
lo_nd_ele1 type reft to if_Wd_context_element.
*** for single record
wa_node type WD_THIS->ELEMENT_node1.
count = lo_nd_itab1->get_element_count( ).
do count times.
*** for deleting selected records
if lo_nd_node1->is_selected( index = pos) = abap_true.
lo_nd_nod1->remove_element( index = pos ).
** for adding new record
lo_nd_node1->bind_structure( new_item = wa_node1
set_initial_elements = ABAP_FALSE ).
endif.
pos = pos+1.
enddo
Check in if_wd_context_node interface, there are 4 methods to add the records.
Regards
Srinvias
Edited by: sanasrinivas on Dec 30, 2011 10:33 AM
yes, u r right,
but if we select a second row in table and replace the second row contents with blank row... its quite inconvenience for user.
because seeing blank rows in middle of data, doesnt look good.
And am not sure about my reason, because, bind_structure will append the row in last, i think. let me check
Regards
Srinivas
Edited by: sanasrinivas on Dec 30, 2011 12:01 PM
Edited by: sanasrinivas on Dec 30, 2011 12:01 PM
Thanks so much Sanasrinivas.
This code resolved my problem.
Regards,
Sagarika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you talking about deleting row and adding new row in table?
in your button action code, i hope you will use remove_element( ) method to delete the row.
after the deletion code,
then bind the blank work area to Node. so that new row will be added.
Next time: Be precise about question, so that it will be easy to help
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.