cancel
Showing results for 
Search instead for 
Did you mean: 

Commit after BAPI function module

Former Member
0 Kudos

Hi ABAP guru's,

I have a doubt that whether can we use directly COMMIT WORK statement after executing bapi function module or else we should only use "bapi_transaction_commit" instead of 'commit work' statement.

for example:

Call 'BAPI_REPMANCONF1_CREATE_MTS '

....

.....

if return-type<>E.

COMMIT WORK. ( OR ) "BAPI_TRANSACTION_COMMT'

  • is there any exception for using 'commit work' statement directly.

ENDIF.

thanks&regards,

kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

BAPI_TRANSACTION_COMMIT calls commit work internally.

if you give wait = 'X', it is equivalent to

COMMIT WORK and WAIT. so there s no difference

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Ravi,

You can use Commit Work as because , Bapi_transaction_commit uses the same internally

Reward if Useful.

Regards,

Chitra

Former Member
0 Kudos

Hi,

Both are same..you can either call BAPI_TRANSACTION_COMMIT or use COMMIT WORK statement..

Inside the bapi_transaction_commit it uses the COMMIT WORK statement..

Thanks

Naren

Former Member
0 Kudos

Hi

If the update to BUT000 is after the commit to the BAPI, you may have to do a separate commit for that later update unless an action or event occurs that causes an implicit database commit.

You may need to execute

COMMIT WORK.

or call function module DB_COMMIT.

Keep in mind that a database commit closes all open database cursors, which would affect an open select loops or OPEN CURSOR statements.

<b>Reward if usefull</b>

Former Member
0 Kudos

hi ravi,

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.

i hope this clears your doubt.

plz reward if useful.

Former Member
0 Kudos

Hi Mr:Kumar,

This BAPI have some additional advantage than simple <b>Commit Work</b>. They are listed below.

1. It will refresh the buffers.

2. It will excecute external commit.This method executes a COMMIT WORK command. It is required for transactions developed externally to the R/3 System that change data in the R/3 System via BAPI calls.

3.It will WAIT for some time before commit, provided you make import parameter WAIT as X

Hope this will clear your doubts

rewards if find useful!

Regards,

Antony Thomas