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

if first job is completed , next job has to run

hi pals,

This is requirement of my client.

if first job is not completed successfully, next job has not to run. we may use

FM .

<b>JOB_CLOSE</b>

<b>import paratmeter : PRED_JOBCOUNT = 'X' .</b>

but it seems ,it is not working.

please suggest me.

Thanks in advance.

T.Balaji.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2005 at 04:25 AM

    Hi Balaji.

    The next job which is supposed to run should have the settings in SM36 -> Define job.

    i.e. : it should be stated there that this job should run after "JOB1" has finished.

    Also check the status-dependent flag.

    Now, in code, you have to pass values of PRED_JOBCOUNT, PRED_JOBNAME, and PREDJOB_CHECKSTAT.

    Hope it solves.

    Regards.

    Samant

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi samant ,

      Thank you for your quick response. infact , earlier itself, we tried with this one ,it is not working .

      say some clear suggestion, with some example

      <b>Please execute with 2 jobs using function modules</b>

      we are not using SM36, SM37. We want to use Function modules.

      Thank you lot.

      balaji.<u></u>

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2005 at 04:26 AM

    if you are creating your jobs via SM36, you should be able to to create the second job using 'After Job' option with the 'Start Status Dependent' checkbox switched on. This way the second job will not start unless the first job finishes successfully.

    Hope this helps ...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2005 at 11:03 AM

    Hi,

    you can check state of your job with table regarding-status-code

    Andreas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2005 at 03:05 PM

    If I understood you correctly, you <b>don't</b> want to run the next job if the previous one failed. If that is the case, why can't you define one job and have multiple steps? The logic is as follows:

    Create the job using JOB_OPEN.

    Create the steps one after the other using JOB_SUBMIT.

    After all the steps are inserted, close the job using JOB_CLOSE.

    If this is not an option, and you want to create multiple jobs and want to wait until the first one is successfully completed, then you need to create a wait logic in your program, to wait until the job status of the first job is complete or aborted or cancelled. You can get the status of the job using BP_JOB_CHECKSTATE.

    Regards,

    Srinivas

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You need not code for wait logic in your program. Suppose you have JOB1 & JOB2 . Define JOB1 using the three Function modules JOB_OPEN .. JOB_SUBMIT.. JOB_CLOSE. For JOB2 pass predecessor job as JOB1 in the parameter PRED_JOBNAME and also pass an "X" in the parameter PREDJOB_CHECKSTAT in the function JOB_CLOSE.

      Your JOB2 will only start after JOB1 has succesfully completed . The will be taken care by background job processing daemon .

      Cheers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2005 at 10:24 AM

    Hi Balaji,

    you might want to check out the new Job Scheduling capabilities of SAP NetWeaver. You can find more information about this on SAP Service Marketplace under quick-link job-scheduling (http://service.sap.com/job-scheduling).

    Kind regards,

    Edwin Esser

    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.