5 Replies Latest reply: Jan 7, 2014 2:53 PM by Darryl Griffiths RSS

wait up to n seconds

Currently Being Moderated

Hi folks,

 

question regarding the abap wait-statement. If I say WAIT UP TO 5 SECONDS, the process is not occupied and then magically re-awakes after the specified 5 seconds.

 

During this time - do I have some chance to find the waiting program? Background is that I had an endless loop which I could not stop since it appeared for about half a second every 5 seconds in SM50, which was too short for me to stop or debug it.

 

Any hints appreciated. Cheers, Nils

  • Re: wait up to n seconds
    Sudheer Junnuthula
    Currently Being Moderated

    Hi,

    In SM50 if you look at the status then you might get the Waiting program

     

     

     

    Regards

    Sudheer

    • Re: wait up to n seconds
      Currently Being Moderated

      Nope, no entry in SM50 at all. As soon as the wait is over, process shows up in SM50.

       

      The idea of the wait is to not block a process, so this is fine with me. I just need some other way to find out that someone is waiting somewhere.

       

      Cheers,

      Nils

  • Re: wait up to n seconds
    Darryl Griffiths
    Currently Being Moderated

    For anyone else finding this thread, you can't see the waiting program because it is rolled out of the work process until the specified time has elapsed.

    The "WAIT UP TO n SECONDS." statement causes the time spent waiting to be accumulated on the "ROLL WAIT TIME" statistic on the records shown in STAD.

     

    Happy new year.

     

    Darryl

  • Re: wait up to n seconds
    Clemens Li
    Currently Being Moderated

    Hi Nils,

     

    WAIT interrrupts the process and issues an operating system SLEEP which makes the process invisible. If it's a batch job, you can cancel it. If it's online, use SM04, soubleclick the user and delete the user session.

     

    And: Be aware that a SLEEP closes database cursors and works as an implicit commit. Any INSERTs,  UPDATEs and DELETEs are commited to the database and can not be rolled back.


    Regards


    Clemens.

    • Re: wait up to n seconds
      Darryl Griffiths
      Currently Being Moderated

      There is no operating system sleep involved.

      The WP is available to perform other work after roll-out of the user's context.

      See note 1063061.

       

      If it's a batch job, it doesn't roll-out as there is no GUI Time in batch jobs.

      If it's a batch job with RFC, it just sits and waits for the RFC (stopped: RFC).

       

      Darryl

Actions