05-31-2017 2:52 PM
Hello,
I have a Batch Job that is running several reports as steps. I want to be able to terminate the current Job in the first step when certain conditions apply.
I know I can achieve that using Error-Messages. However the Job will be displayed as "aborted" then, which is not wanted.
Is there an ABAP FM where I can safely "finish" the Job which is currently executing the Report, so that all further Job-Steps won't be running and the whole Jobs' Status is not "aborted"?
Thank you.
05-31-2017 3:39 PM
so, you want to stop a job consisting of several steps, or in other words Abort the process but you do not want to have the status aborted, even though that is exactly what has happened?
What you want is to have several jobs with successor jobs, then you can simply unschedule the successor.
05-31-2017 3:51 PM
Hi!
You can pass the flag to the memory in the first step and read it in the following steps and leave processing if it's not set.
Also you can analyze job log:
1) get job name and job count from TBTCO table
2) Call FM BP_JOBLOG_READ. The FM will return current log, so you can set the message in the first step and check it in the following steps
Or schedule the following steps from the first step into another job
Hope it's helpful
Evgeny
06-01-2017 12:21 PM
'1) get job name and job count from TBTCO table'
I would suggest call of FM GET_JOB_RUNTIME_INFO.
06-01-2017 10:52 AM
Check if the old trick of 'LEAVE TO CURRENT TRANSACTION.' works for your SAP version?