Skip to Content
author's profile photo Former Member
Former Member

Cancel Background job if validation fails in the program

Hi,

I am developing an ABAP program. The sequence is as follows.

It reads a file, peforms a series of validations again some custom tables and finally updates the custom table for this program. The program is scheduled to run everyday in the background

The requirment is I have to make the background cancel when there is some problem in the validation part. I tested using error message. It seems ok.

Can you please suggest if there is a better way to cancel the background job when the validation is not correct (example invalid vendor number).

Thank you,

Vidya

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 20, 2007 at 04:18 PM

    The simplest way is to do it with the ERROR message.

    Like

    MESSAGE E378(00) with 'validation failed'.

    Or you can call this FM:

    IF l_Error is not initial.

    CALL FUNCTION 'BP_JOB_ABORT'

    EXPORTING

    jobcount = p_jobc " << job count

    jobname = p_jobn. " << job number

    ENDIF.

    but to use this FM you first have to schedule a job through program to know the job count & number and it will take some more effort.

    So, better to use the Error message.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.