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: 

WAIT up to command while using FM

0 Kudos
428

We are using an FM .Based on the update operation done by the FM , we are supposed to do some more operation POST operation .

But by the time it reaches the next line , it does not update the required database table .

If we add WAIT UPTO 0.2 seconds it works .

SET UPDATE LOCAL TASK is also not working .

Is it a good programming practice to add wait up to 0.2 seconds in middle of program .

Or is there a better option like ENQUEUE SLEEP

2 REPLIES 2

DominikTylczyn
SAP Champion
SAP Champion
378

In my opinion all wait steps are bad practice as they try to make asynchronous updates synchronous. Surely sometimes there is no other way. You would need to share more details about what you are trying to acomplish, so the community can help you better.

Sandra_Rossi
Active Contributor
378

Yep, bad practice. Also, maybe one day "WAIT UP TO '0.2' SECONDS" might not work at random moment just because of slow system.

If you run a SQL trace with ABAP stack, you can understand what caused the update and you will find a solution (provided that you understand how ABAP runtime works - Refer to ABAP documentation for these details).