on 03-09-2009 11:05 AM
Hi Experts,
I have a situation where from a file some data needs to be updated in DB. But if any errors occurs during UPDATE statement, all the updated data needs to be ROLL BACK or if all the data is updated without errors then it needs to be COMMITED. Please let me know how to tackle this requirement.
Thanks and Regards,
Praveen.C.V
Hi Praveen,
The Update statement automatically does the commit if it is success, otherwise it doesn't update the data in the database. From our side no need to handle this situation.
If you want to know what happen in the receiver(Database) side then we have to use the synchronous scenario(BPM ), based on that response we can proceed further.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IDear Praveen,
what do you mean by " it should be rollbacked if update goes in error "
as it is if the update statement goes in error nothing gets updated in the target table..
Edited by: Tarang Shah on Mar 9, 2009 12:12 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tarang,
Thanks for your response.
Suppose we have 100 records in the file. The data is getting updated row by row in the DB by calling a procedure. So if suppose while updating the 56th row, if an error occures due to non availability of PKey then all the previously updated rows need to be rolled back. It sould not commit the updated rows. How we can achive this?
Regards,
Praveen.
hi,
this is pretty easy but you need to code it yourself
create an abap proxy that will receive all of your data (all rows)
then call BAPI one by one and check the return table
at the end loop at return table and if it's all successfull
then commit work it not rollback work
and you're done:)
XI/PI cannot do it on it's own there always must be some functions
on application system side that support this (even with 7.1)
Regards,
Michal Krawczyk
Dear Praveen..
instead of updating the table one by one..
you can create a temporary internal table inside you proecdure and after all the entries are transferred to that internal table you can update your database table using that..
There are also statement like "commit" and "rollback" which can be used in your stored procedure
Hope this helps
User | Count |
---|---|
93 | |
10 | |
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.