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: 

COMMIT WORK AND WAIT

Former Member
0 Kudos

Hi,

Can any one explain me the difference between COMMIT WORK and COMMIT WORK AND WAIT?

Actually I am trying to Use:

{ CALL TRANSACTION XD01 USING BDCDATA

MODE 'N'

UPDATE 'S'

MESSAGES INTO MESSTAB. }

This Statement I want to use only Customer Data to Validate. Once the validation happens, I want to Roll back all changes using

BAPI_TRANSACTION_ROLLBACK. Is it possible to Roll Back? Does it validate Customer data rather than Create Customer.

Please give me any other pointers, If possible?

Regards,

J.

6 REPLIES 6

former_member585865
Contributor
0 Kudos

Hi Sekhar,

Commit work----


> when you use commit work it will hit the database and store immediately.

commit work and wait----


> this statement will hit the database and wait sometime to process the second record in an loop.

if you want to validate the customer you can use validations before the BDC process and filter if you want to use roll back then check the sy-subrc after your call transaction if it fails then you can rollback.

former_member556412
Active Participant
0 Kudos

The statement COMMIT WORK completes the current SAP-LUW and opens a new one, storing all change requests for the current SAP LUW in the process.

and if you specify the AND WAIT addition to Commit work the program until the update work process has executed it (asynchronous updating).

uwe_schieferstein
Active Contributor
0 Kudos

Hello Sekhar

Irrespective of whether the update mode is Sychronous or Asynchronous the customer will not be created if any of the validations fails so there is no need for any ROLLBACK WORK.

Regards

Uwe

Former Member
0 Kudos

commit work ( asynchronous updating )

commit work and wait ( synchronous )

Former Member
0 Kudos

Hi

The data are usually saved by processes running in update task or background, these processes are raised at the end of a transaction (or LUW, Logical Unit of Work)) by COMMIT WORK statament.

If it uses the addition WAIT, the program waits for the end of all processes, if it doesn't use ti, the program goes on without to wait for them.

So:

- commit work is asynchronous process, because the program runs while the saving process are running too,

- commit work and wait is synchronous process, because the programs runs after the saving process are over.

Try to check the SAP HELP for LUW, here u can find out all informations u need

If you want to check some validation, it's better to create a BI simulation without to save, but to exit from trx only: that works if the validation is not triggered as soon as the data is saved

Max

shaik_sajid
Active Contributor

commit work -> all records get updated into the table one by one (if there are more than 1 record or more than 1 table)

commit work and wait -> system waits untill all the records are updated to the tables and then it moves to the next statement.

i think u r updating data using BDC.So if there is any error then it will rollback automatically.

Regards

Sajid