avatar image
Former Member

ABAP Command to finish reports own job

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • May 31, 2017 at 02: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.

    Add comment
    10|10000 characters needed characters exceeded

  • May 31, 2017 at 02: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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 01, 2017 at 09:52 AM

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

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content