on 03-10-2009 5:00 AM
Hi,
I have created this simpleaction to capture a selected row using ALV and here is the code I used
to do that.
Get access to the desired context node
wd_node = wd_context->get_child_node( name = 'SELECT_NAMETAB' ).
Get the lead selection of the ALV
lr_element = wd_node->get_lead_selection( ).
call delete_sname_complete function module
Z_WDT_NAME_MODEL=>delete_sname_complete( EXPORTING element = lr_element ).
this the empty method to delete the actual data from the database
method DELETE_SNAME_COMPLETE.
***
***
endmethod.
what is the correct syntax to delete a selected row when I pass the parameter
lr_element?
This is more of ABAP general question,
You can implement your own logic to delete a record from the database.. if it is custom table, you can use Delete command, if it is standard table then call the related BAPI if provided.
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the replays guys,
it was a lot simpler than I thought.
All what I have to do is write a delete a statement after get_lead_select
And it removed the selected row from the database
Thanks,
Abdul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
After you get the selected row index and its context element.
Use the REMOVE_ELEMENT of the if_wd-context_node to delete a row from the table.
But this deletes the record in the context only.
As per Abhi's reply you can delete the same from the database table.
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abdul,
Please refer the code given by Uday in the thread: .
After removing the selected line, just read the node to get all the values in an internal table and then use ABAP modify statement to modify the database table according to the data present in the internal table.
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
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.