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: 

How and when to use WAIT parameter in BAPI_TRANSACTION_COMMIT? Help!

Former Member
0 Kudos

Hi Experts,

In the BAPI_TRANSACTION_COMMIT function module there is an input parameter "WAIT".

What is the significance or use of WAIT?

How do we use it? What values does it take?

For which case do we use WAIT and for which not?

KIndly help me understand this.

Thanks

Gopal

10 REPLIES 10

former_member184657
Active Contributor
0 Kudos

>

> Hi Experts,

>

>

> What is the significance or use of SEARCH ?

>

> How do we use it? What values does it take?

>

> For which case do we use SEARCH and for which not?

>

> KIndly help me understand this.

>

> Thanks

> Gopal

pk

former_member188685
Active Contributor
0 Kudos

did you read the Function module documentation..?

0 Kudos

Hi Vijay,

Yes I read the FM documentation. But SAP documentation is very bad. They don't explain things properly.

That is why I have asked it in this forum.

If you know the answer kindly help me.

Thanks

Gopal

former_member181995
Active Contributor
0 Kudos

if you are doing some parallel process for chaging and updating both than only we need this parameter.

for example if you are creating PO from BAPI and simultineously you are changing the PO as well than we need to use WAIT parameter.so that let the fisrt Database completly adjust.

Former Member
0 Kudos

Hi ,

sometimes when updationg database tables with a huge number of values , it will take considerable time .

so if u use wait satatement like

wait for 10 secs.

The program will wait for 10 secs and then proceed with the next statement in the program .

This will be used when the updation has an impact on the next statement in the program.

regards,

Ramya

Former Member
0 Kudos

Hi,

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.

When you call BAPIs in your program that change data in the R/3 System, afterwards you must call this method to write the changes to the database.

The default value of this parameter is SPACE. If the parameter contains the value SPACE or it does not contain a value at all, then a simple COMMIT WORK is executed.

If the parameter WAIT contains a value other than SPACE, a COMMIT WORK AND WAIT command is executed.

The result is that the data within a Logical Unit of Work (LUW), changed by one or more BAPIs after the BAPI 'BapiService.TransactionCommit' has been called, is immediately available in the database.

The following values are possible:

' '

The command 'COMMIT WORK' is executed - the program does not wait, until COMMIT WORK is completed. When the database is next accessed directly, all the old data may still be able to be read.

'X'

The command 'COMMIT WORK AND WAIT' is executed - the program waits until the COMMIT WORK is completed. When the database is next accessed, the updated data is read.

reference : function module documentation.

thanx.

Edited by: Dhanashri Pawar on Sep 18, 2008 6:41 AM

0 Kudos

Hi Experts,

What is the best way of using BAPI_TRANSACTION_COMMIT?

Is it always best to use WAIT = 'X' parameter?

Is there any limitation of using WAIT?

Please help!

Thanks

Gopal

0 Kudos

>

> Hi Experts,

>

> What is the best way of using BAPI_TRANSACTION_COMMIT?

>

> Is it always best to use WAIT = 'X' parameter?

>

> Is there any limitation of using WAIT?

>

> Please help!

>

> Thanks

> Gopal

Now my guess you need to search for LUW!!

0 Kudos

Hi,

Its always better to use WAIT = 'X'.

As the program waits until the COMMIT WORK is completed. When the database is next accessed, the updated data is read.

And if we donot pass some value for WAIT then the program does not wait, until COMMIT WORK is completed. When the database is next accessed directly, all the old data may still be able to be read.

So its always better to commit the work as well as roll back the work so that the database update is consistent.

thanx.

0 Kudos

>

> Hi Experts,

>

> What is the best way of using SEARCH ? No best way... only One way.

>

> Is it always best to use SEARCH ? Put the right search parameters

>

> Is there any limitation of using SEARCH ? Nothing that I have heard of so >far

>

> Please help YOURSELF !

>

> Thanks

> Gopal

pk

Edited by: prashanth kishan on Sep 18, 2008 10:37 AM