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

Wait for commit to finish

MauricioMiao
Contributor
0 Likes
1,902

Hello,

I am calling a standard function that update some tables and at the end execute a commit work without the wait clause, but right after the execution of the standard function I need to perform some operations that needs all the tables to be updated, so unfortunatelly I needed commit work and wait inside the standard function.

As I cannot change the standard function I tried to use table VBHDR to check when the update process finish but I noticed in my system this table is not trustfull as there are lots of garbage there with field VBRC = 1.

So my question is how can I wait for the commit work to finish in this situation?

Regards,

Mauricio

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
1,636

So why not do a COMMIT WORK AND WAIT, (or BAPI_TRANSACTION_COMMIT) after calling the standard function module, yourself?

9 REPLIES 9
Read only

Former Member
0 Likes
1,636

well this a random approach but u can try this.

use WAIT UP TO n seconds give the vales as some 120 or 180 seconds.

but u cant be sure if its stable all the time.

Or u can try and call the function with the addition IN UPDATE TASK

кu03B1ятu03B9к

Edited by: kartik tarla on Jan 5, 2009 6:41 PM

Read only

0 Likes
1,636

Hi,

Thanks for the answer but I know the wait up to solution but do not like it, I would like to know if there is another one.

Thanks,

Mauricio

Read only

0 Likes
1,636

Did u try the addition IN UPDATE TASK to ur call function

Read only

0 Likes
1,636

Hi,

I am not sure about what you suggested but If you said to wrap up my logic in a function and call it in update task it will not work because I will still need to wait for the first commit work to finish.

And also I cannot call it in update task because I need to return the error messages to XI (PI) and that cannot be done in update task.

Regards,

Mauricio

Read only

0 Likes
1,636

I am not asking u to call ur logic in update task but call the standard function in update task which executes before ur logic is called.

Read only

0 Likes
1,636

That is not possible because I need to abort my logic in case the standard function return an error.

Regards,

Mauricio

Read only

Sm1tje
Active Contributor
0 Likes
1,637

So why not do a COMMIT WORK AND WAIT, (or BAPI_TRANSACTION_COMMIT) after calling the standard function module, yourself?

Read only

0 Likes
1,636

Hi Michy,

Because the standard function already executed the commit work command, so the process was already sent to update, it will make no difference if I call again commit work and wait.

Regards

Mauricio

Read only

1,636

Hi Michy,

Because the standard function already executed the commit work command, so the process was already sent to update, it will make no difference if I call again commit work and wait.

Regards

Mauricio