11-25-2004 11:51 AM
Is there any way in a report running in background to catch a job abort request for the report's job or that the system is being stopped? This would allow for an elegant exit. Thanks.
11-25-2004 11:57 AM
Hi Ralph,,
TA SM37
-> Job - Capture: active job
or TA SM 50
-> Program/session - Program - Debugging
Andreas
11-25-2004 8:59 PM
Hi Ralph
You may make use of the function module <b>'SHOW_JOBSTATE'</b> (or something sounds like that).
*--Serdar
11-30-2004 11:42 AM
Thanks, but apparantly I didn't make myself clear enough. I wish to know, if I can check for a job abort or system shutdown event in the background program itself, let's say in its main loop. The report is designed to run like a daemon in background.
11-30-2004 12:41 PM
Hello Ralph,
If I have understood your requirement correctly, then I'm afraid what you want cannot be accomplished.
Let us say, for example, that the application server has suddenly begun to shutdown , say due to power failure. How can an event like this ever communicate with a background job?
I know you would say that you did not mean a case like this, but System Shutdown , Job Abort etc., are all pre-emptive. I do not think you will be able to determine that within your program. The fcat that a program continues to be running is in itself a proof that no such an event has occurred.
Even if you were to be able to check for a particular condition in your code, let us say , for every 10 seconds, the system shutdown event might occur just immediately after the execution of the logic. And you will not be able to have the "graceful" exit any more.
Hope I have understood your problem correctly and if yes, my explanation has been satisfactory.
Regards,
Anand Mandalika
12-06-2004 3:10 PM