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: 

ABAP Command to finish reports own job

Former Member
0 Kudos

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.

4 REPLIES 4

former_member186746
Active Contributor

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.

former_member400468
Active Participant
0 Kudos

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

0 Kudos

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

I would suggest call of FM GET_JOB_RUNTIME_INFO.

raymond_giuseppi
Active Contributor
0 Kudos

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