08-14-2007 12:36 PM
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
08-14-2007 12:45 PM
Hi,
In SM50 if you look at the status then you might get the Waiting program
Regards
Sudheer
08-14-2007 12:57 PM
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
01-03-2014 12:15 PM
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
01-03-2014 2:14 PM
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.
01-07-2014 1:53 PM
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
01-10-2020 1:17 AM
There is an elegant solution.
This code simulates a wait up but is visible in SM50. Very simple and efficient.
method set_waiting.
data: l_1 type timestampl,
l_2 type timestampl,
l_3 type timestampl.
data: l_v1 type p decimals 3,
l_v2 type p decimals 3.
get time stamp field l_1.
do.
l_v1 = l_v2 / 5.
get time stamp field l_2.
l_3 = l_2 - l_1.
if l_3 > i_seconds.
exit.
endif.
enddo.
write l_3.
endmethod.