Application Development 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: 

Catching job abort/system stop in batch report

Former Member
0 Kudos

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.

5 REPLIES 5

andreas_mann3
Active Contributor
0 Kudos

Hi Ralph,,

TA SM37

-> Job - Capture: active job

or TA SM 50

-> Program/session - Program - Debugging

Andreas

ssimsekler
Active Contributor
0 Kudos

Hi Ralph

You may make use of the function module <b>'SHOW_JOBSTATE'</b> (or something sounds like that).

*--Serdar

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

Yes, you understood my problem correctly. Thank you.