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.

Former Member
0 Likes
947

Hi guys,

How does "commit work" works? When do we use commit work? Thanks a lot!

Rgds,

mark

7 REPLIES 7
Read only

dhruv_shah3
Active Contributor
0 Likes
903

Hi,

COMMIT WORK

This is the standard form, which specifies asynchronous processing. Your program does not wait for the requested functions to finish processing.

COMMIT WORK AND WAIT

This form specifies synchronous processing. The commit statement waits for the requested functions to finish processing. Control returns to your program after all high priority (V1) function modules have run successfully.

The AND WAIT form is convenient for switching old programs to synchronous processing without having to re-write the code. Functionally, using AND WAIT for update-task updates is just the same as dialog-task updates with PERFORM ON COMMIT.

HTH

Regards,

Dhruv Shah

Read only

Former Member
0 Likes
903

hi,

A database LUW (DB Logical Unit of Work) is an inseparable sequence of database operations that

takes the database from one consistent state to another.

Database LUWs are either completely executed by the database system, or not at all.

Database LUWs close with a database commit. It is only in the commit that the changes are firmly

written in the database. Until the commit occurs, you can undo your changes using a database rollback.

Implicit database commits are triggered when:

A dialog step is completed

An error dialog occurs

You call a function module in another work process (RFC).

The SAP LUW can span several dialog steps and contains consistency checks, which are processed as closely as possible to the user action, so that the user can be informed of the error status. Since the user processing time of a screen is generally much longer than a dialog step of the application server, an SAP LUW requires a much larger time frame than a database LUW.

Using an SAP LUW to represent a business process in the R/3 System involves both user dialogs and a database dialog. The purpose of a transaction is to make sure that the data exchanged between program and user in the user dialogs is processed on an all-or-nothing basis in the database. This means that all of the changes from the SAP LUW must be processed in a single database LUW.

Usually an SAP LUW is processed in more than one DB LUW.

The aim when programming a transaction is to bundle the segments of the database dialog in a DB

LUW.

You should aim to process the database dialogs as late as possible within the database LUW, and to

keep the database locks set for as short a time as possible.

After the database update, trigger an explicit database commit using the COMMIT WORK statement.

Hope this helps, Do reward.

Read only

Former Member
0 Likes
903

condition 1:

when u are using the insert statement for updating table then we need to use the insert statement inside the loop and endloop for not to dump the code and after endloop write the COMMIT WORK statement to explicitly commit the data to hit the database.

Read only

0 Likes
903

Hi,

I uses the BAPI_PROCORDCONF_CREATE_HDR.

During the debug mode, the processing are correct but when I run it without the debug mode, there is one process that it cant execute. WHen will I use the commit work statement? Thanks!

Read only

0 Likes
903

Hi,

Commit work is used when you code directly in ABAP and make changes in the database and

want to commit the database.

BAPI_TRANSACTION_COMMIT is used when you make changes to the SAP database by calling

a BAPI from outside SAP and want to commit the database. When you use a BAPI, you can not

directly use commit work, instead you are allowed to use only

BAPI_TRANSACTION_COMMIT.

Regards,

Chandu

Read only

0 Likes
903

HI,

Thanks a lot!

My problem now is that during the debug mode, it does update in the COGI transaction however during the normal processing it does not update in COGI.

Do I have to introduce a WAIT statement before I commit work? Thanks!

Read only

0 Likes
903

Hi,

Click on the following link,you can get full details.

http://abapprogramming.blogspot.com/search?q=bapi+commit

Regards,

Chandu