/scripts/ahub.form.attachments.js
0

ABAP Command to finish reports own job

May 31, 2017 at 01:52 PM

155

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Rob Dielemans May 31, 2017 at 02:39 PM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Evgeny Gubenko May 31, 2017 at 02:51 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

'1) get job name and job count from TBTCO table'

I would suggest call of FM GET_JOB_RUNTIME_INFO.

0
Raymond Giuseppi
Jun 01, 2017 at 09:52 AM
0

Check if the old trick of 'LEAVE TO CURRENT TRANSACTION.' works for your SAP version?

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content