Skip to Content
avatar image
Former Member

COMMIT WORK AND WAIT

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Jun 30, 2009 at 11:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 30, 2009 at 08:33 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 30, 2009 at 08:35 AM

    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).

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 30, 2009 at 08:35 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 30, 2009 at 08:36 AM

    commit work ( asynchronous updating )

    commit work and wait ( synchronous )

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 30, 2009 at 08:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded