Skip to Content

Adding time delay before a user desicion step

Hi Experts,

I have an urgent requirement, i will really appreciate your help.

If a transaction is opened in edit mode in UI and at that time workflow (approval) at back end is trying to update its status then it

is unable to do so.

So I want to add some time delay before this update activity in a loop so that this loop run untill the transaction does not come in

noneditable mode.

Please suggest me how this functionality can be achieved.

Thanks & Regards,

Kapil Kumar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Feb 21, 2013 at 03:14 PM


    Please confirm on how the WF is trying to update.

    If its through user decision, you can use the "Requested Start" option available in the task.

    Let me know if this helps.



    Add a comment
    10|10000 characters needed characters exceeded

    • Kapil,

      yes, if you are able to check if the transaction is locked, then you may have to loop and check for loop.

      Of course, you have to give a deadline there also.

      I had a same requirement and I did the same thing. But, after some time (I guess a minute), if the t-code was still locked, I have put in some code to send a mail notification to the concerned team (notifying that the t-code is locked).

      Hope this helps.



  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2013 at 05:17 PM

    You can always set "earliest start time" to be current time + 5 minutes (instead of a loop). In general, tasks that update the DB check whether a lock can be obtained. If not, they throw a temp exception which will cause the workflow engine to re-try the task again after a few minutes. You can specify the number of tries. Then, after an X number of tries, a permanent error is thrown and the workflow admin is notified so that he/she can run the task manually using SWPR.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 21, 2013 at 10:47 PM


    Don't use arbitrary time delays, use temporary exceptions. One of the best features of workflow!



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Kapil, Occurs to me that 3-4 minutes seems rather small? Users can sit in transactions for ages - especially if they have wandered off for a coffee break. Also 3 retries is just the default - you can adjust the number of retries through the settings in the workflow step (miscellaneous tab I think... but you please check this). There's a point at which if it's still locked you have a bigger problem, and might need to take alternative action.

      But it sounds like your loop until condition is better than I had assumed from previous steps.


      BTW I would also suggest you explicitly test for what happens if they delete the record you are looking for while you are still waiting for it to be unlocked - as I'm guessing from your description that would cause your loop condition to fail. So you need to think about how you handle that - perhaps a terminating header event at the workflow header level.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.