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

Commit work and wait.

Former Member
0 Likes
1,686

Hello,

I have a function that does the following.

1) Call Trans XD01.

2) Get the customer number from the BDC message table.

3) Call Trans XD02 to link this new customer to an

existing sold-to.

The problem we are having is that the newly created customer is not being recognised in the XD02 step (very occasionally in production only).

I suspect that this is because the updates have not been applied yet, so I am thinking of adding a "COMMIT WORK AND WAIT" between step 1) and 2).

Now my question is, will "COMMIT WORK AND WAIT" wait for updates from the XD01 call transaction to be applied?

I am concerned that it wont, since the call transaction does an implicit "COMMIT WORK" thus concluding that LUW and my subsequent "COMMIT WORK AND WAIT" will not apply to these updates as well.

Thanks for your help.

Denis.

Message was edited by: Denis Wright

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
892

I'm not sure if the COMMIT WORK AND WAIT statement will help you if the updates are pushed to an update task. In your "call tranasaction XD01", set your UPDATE flag to "L" for local. Use the COMMIT WORK AND WAIT. If you still are having the problem, try putting a 2-3 second delay in between the transactions.

Regards,

Rich Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
893

I'm not sure if the COMMIT WORK AND WAIT statement will help you if the updates are pushed to an update task. In your "call tranasaction XD01", set your UPDATE flag to "L" for local. Use the COMMIT WORK AND WAIT. If you still are having the problem, try putting a 2-3 second delay in between the transactions.

Regards,

Rich Heilman

Read only

0 Likes
892

With UPDATE mode 'L' COMMIT AND WAIT is redundant. Also, you need not introducing any artificial delays. If you do CALL TRANSACTION with UPDATE mode 'L' it is garanteed that all updates will be finished and commited by the return to your ptogram as all the processing takes place in the same (local) task.

Read only

0 Likes
892

Thanks all, that looks very useful.

I have never used local updates. Are there any negative impacts?

Denis.

Read only

0 Likes
892

Asynchronous updates were invented to improve system response - they let user to enter another piece of data when the application server in the background updates underlying RDBMS. If your process consists of sequence of interdependent transactions (say, you are to create sales order, then outbound delivery for that order, etc.) then local update mode is the preferrable option.

Read only

0 Likes
892

Hi all,

We've a reqt to call txn 'IW52' and skip the first screen. I'm passing the notification no. through SET parameter. I make changes in the partner address.

After control comes back to the calling program, if I fire a select query on IHPA table for ADRNR, it doesnt get updated in the DB table immediately. I need to use the Address no. further for processing. I cannot use the update 'L' option out here because its not a BDC, but a simple CALL transaction.

First, I tried COMMIT WORK AND WAIT. Then also it did'nt update the DB.

Then I tried the option WAIT UP TO 1 SECONDS. Finally the DB table was getting updated. But I'm concerned if this will pose any performance issues going forward. Is there any other method which is more effective?

Thanks in advance,

Regards

Deepthi.

Read only

Former Member
0 Likes
892

Hello,

instead of using update mode 'L', you can use also mode 'S'. Here you can be sure that it is possible by the time you get the number to call the next tcode, because data was written to DB before.

Hope this helps,

Hans-Jürgen