Search code examples
commitabapopensql

Commit for one table


Is it possible to execute a commit only for a selected table?

The problem I have is that I do not know if there are more tables updated by the process, so that I want to prevent to update them with my commit!

It is mass processing and just at the end of the process it will call the commit (logically).

So is there a way update one special table instead of all?

Case: A mass processing Run, like the one with which I work, is updated on its very end.

Our/My code is just a BAdI implementation with several functions. To get specific data it is necessary to make a request to another system, this request cannot let any footsteps in the history log, so it is strictly necessary to roll back the request for not persisting it in the System.

This request is used for work item entries. So if I process 1 amount of data sets and generate a work item, this work item will be registered to get thrown after the Run. On the processing of the 2º amount of data sets and make the request to the other system, I have to rollback it but the work item entry of the first amount of data sets will be deleted (roll backed).

Could it be possible to make a those updates with a direct commit? -> No.

Can't I simply manage the tables to get updated with internal tables and update them at the end of the run? -> No, because those classes don't belong to us.

Why I don't simple make the rollback on the end of the run? -> those classes don't belong to us, and otherwise the whole massprocessing-structure has to be changed.


Solution

  • As a programmer you have control and should know what is being updated. If you structure your code into LUW's then you can control what tables are being updated and at what point you catch an error that will still allow the appropriate rollback. So the answer specifically about the commit statement was given above but as a programmer you can group your statements to accomplish the same.

    Later.....