Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it ok to have two (or more) commits in one report?

former_member246634
Active Participant
0 Kudos

I've got a question about 2 (or even more) commits in report.

Here's my situation:

I am calling BAPI, that modifies database table, e.g. BKPF. Later on I need that new data, so right after calling BAPI I use BAPI_TRANSACTION_COMMIT. Then I use that new data to modify my Z dbtab, so after that I use COMMIT WORK statement.

As I am aware commit statement puts a temporary lock on table which is currently used, so no one else can use it.

Is it ok to use many commits in one program? Or are there any "good behaviours" about using commits?

Also second question. Does MODIFY dbtab FROM wa statement include any commits? I had a situation, when after using that statement on my Z table (without any commits after) it actually modified content of my table.

Thanks for all your answers.

Bartlomiej

1 ACCEPTED SOLUTION

former_member205488
Active Participant
0 Kudos

Hello Bartlomiej!


It is OK to use several commits in one report in common. In particular it depends on business context. If your changes should be performed only together - you should place it in one LUW and use one commit. If the changes may be performed separately or partially - you may use several commits.


MODIFY dbtab FROM wa statement doesn't include any commits itself. I suppose the content of the table in your case was modified as a result of implicit commit.


2 REPLIES 2

former_member182915
Active Contributor
0 Kudos

Hi Techies,

In your case 2time calling commit is required after bapi perform we have to do commit other wise database will not update from buffer . second one to update custom table is also justified, some time with commit after modify statement work but it have a chance of failure.

If I am in wrong way , Please guide.


former_member205488
Active Participant
0 Kudos

Hello Bartlomiej!


It is OK to use several commits in one report in common. In particular it depends on business context. If your changes should be performed only together - you should place it in one LUW and use one commit. If the changes may be performed separately or partially - you may use several commits.


MODIFY dbtab FROM wa statement doesn't include any commits itself. I suppose the content of the table in your case was modified as a result of implicit commit.