Application Development and Automation 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: 
Read only

Commit Work Question

Former Member
0 Likes
821

I have a question for all of the guru's out there. I am updating multiple files in my Mobile Asset Process, but at some point I want to do a commit, but I only want to do the commit for one file not all of them. Is there a way to do that?

Thanks

Mike

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
775

OK - do the commit after one file and then a rollback at the end.

Rob

7 REPLIES 7
Read only

Former Member
0 Likes
775

Do a commit after each file.

Rob

Read only

Former Member
0 Likes
775

Hi,

Use COMMIT WORK statement after each file...Is that what you are looking for..

Thanks,

Naren

Read only

0 Likes
775

No, that isn't what we are looking for, just the ability to do a Commit Work for one file. We may have to do it after each file, but that is not the goal at this time.

Thanks

Mike

Read only

0 Likes
775

No, that isn't what we are looking for, just the ability to do a Commit Work for one file. We may have to do it after each file, but that is not the goal at this time.

Thanks

Mike

Read only

Former Member
0 Likes
776

OK - do the commit after one file and then a rollback at the end.

Rob

Read only

Clemenss
Active Contributor
0 Likes
775

Michael,

hope this will answer your question:

In database update processes, two things happen:

- the objects to be updated are locked

- database changes are written to the database rollback segment

Every work process or transaction runs in it's own logical unit of work (LUW).

At end of this LUW, an implicit COMMIT WORK occurs committing the rollback segment to the database. From now on, database changes become visible for all processes and users. Also all functions called with the addition IN UPDATE TASK are released for processing in an update process. An explicit COMMIT WORK at the end of active program will do the same and additionally start all FORMs called with the addition ON UPDATE.

In your case: A COMMIT WORK will commit <b>all</b> database requests as described above: There is no way to to 'selected' COMMIT.

If you process too many objects, either the database rollback segment or the lock table will overflow.

In terms of performance, it is better to wait for commit as long as possible because every commit means heavy processing for ABAP and database.

It is good practice to do a COMMIT after a certain number of objects. Some prefer 100; my personal experience says 1000 is fine.

ROLLBACK works the same way but it will clear the whole rollback segment making all changes undone. If you encounter an error after say 900 uncommited objects and a rollback is necessary, you have to start again right from the beginning.

Hope this helps you to find the best way.

Regards,

Clemens

Read only

Former Member
0 Likes
775

It wasn't the answer I was looking for but it was very helpful.

Thanks

Mike