cancel
Showing results for 
Search instead for 
Did you mean: 

Roll back and Commit operation in PI ?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

former_member206760
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

MichalKrawczyk
Active Contributor
0 Kudos

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

former_member206760
Active Contributor
0 Kudos

Dear Praveen ,

you are using which data base?

former_member206760
Active Contributor
0 Kudos

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