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

Automatic commit work after class method?

Former Member
0 Likes
2,919

Hi guys,

after calling a class method, is there an automatic commit work? Or do I have to insert a commit work into the class method?

At which points, a commit work is automatically called?

Regards,

Basti

5 REPLIES 5
Read only

JJosh
Active Participant
0 Likes
1,715

Hi Basti,

When you execute a commit, all the updates that are executed in the same LUW get committed/executed.

Whether to add commit or not, depends on your requirement.

BR/Josh

Read only

Former Member
0 Likes
1,715

Hi Basti,

Could you please elaborate your requirement and what you are trying to achieve.

If I am not wrong you are trying to achieve functionality as described in below link.

Let us know if it answers your question.

Cheers

VJ

Read only

Former Member
0 Likes
1,715

When calling a function module, at the end of it there is an automatic commit work if I'm right.

I wanted to know, if there is the same behavior for class methods.

Read only

0 Likes
1,715

Implicit Commit work will not called after class method and in case of normal FM, But when RFC called then it will be called.

To know when and all implicit commit work called refer help sap

Implicit_commit_work

Read only

0 Likes
1,715

Hi,

there is so much confusion about commit, commit work and rollback:

1. At the end of LUW and at every interruption (screen display including message issued, RFC calls,...)  an implicit database commit occurs.

2. COMMIT WORK will trigger all update task processes that have been registered before (call function in update task, perform on commit). Most BAPI functions use perform on commit. An implicit database commit ist not a COMMIT WORK.

3. Rollback work will delete all pending update tasks inclusing all database updates not yet commited.

4. Only the 'Master'of any process should rule the COMMIT WORK because COMMIT WORK means that ALL pending update tasks are executed. So only the caller on top of the hierarchy should issue the COMMIT WORK because a later ROLLBACK is not possible - ROLLBACK only works if not y<et committed.

These rules work independent of programming feature used - nothing different in oo.

Regards

Clemens