0

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.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • Please try to find out what the term referential integrity means, and then please give a good reason why you apparently are willing to break it. – vwegert May 24 '14 at 13:42
  • @DientesDeCheto Dientes de un cheto, esto suena argentino ;-) – Jagger Jun 03 '14 at 09:43
  • It seems that the logging of this external call in your BAdI is out of your control at all, therefore I do not think you can achieve what you want here. As far as I understand the logging is not in your BAdI but rather in the method/function module for this external call. Without modifying this piece of logic, it will not be possible to get rid of this log. The other question, why do you want to get rid of this trace at all? If something important happened then it should be logged in a normal situation. – Jagger Jun 03 '14 at 09:50

2 Answers2

0

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.....

SAP Pro
  • 397
  • 2
  • 8
  • Usefull advice, but not in my case. To understand better the Problem I actualized my entry! Please consider it for your actual answer. – DientesDeCheto May 27 '14 at 12:52
-1

AFAIK the moment commit is called, all the DML preceding that commit statement and after the last commit is committed to database. So if after your commit there are more commits then they are not influenced by your commit neither your commit can influence theirs unless ofcourse there is a condition of rollback.

Shailendra
  • 8,874
  • 2
  • 28
  • 37
  • So it means, if I execute my commit, all the DB Changes done before are updated... a further rollback wont affect my commit (the way i know). So no way to make a single update with corresponding commit! – DientesDeCheto May 24 '14 at 11:31
  • For e.g., in case of oracle have a look at http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/sqloperations.htm#i7105 – Shailendra May 24 '14 at 14:08