Application Development and Automation 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: 
Read only

JOB_CLOSE (exception: invalid_startdate)

Former Member
0 Likes
878

Hi,

I'm trying to run two jobs. One after the other. For this i do the following:

JOB_OPEN (with: jobname)

JOB_SUBMIT (with:authcknam, jobcount, jobname, language, report and variant)

JOB_CLOSE (with: jobcount, jobname and strtimmed = X)

JOB_OPEN (with: jobname)

SUBMIT program x...

JOB_CLOSE (with jobcount , jobname, predjob_checkstat = X, pred_jobcount and pred_jobname)

But the second time that i call fonction JOB_CLOSE, it return code sy-subrc = 2. (invalid_startdate).

This happened only in the quality environment (In the developing environment works ok).

Thank for your help!

Hi,

I'm trying to run two jobs. One after the other. For this i do the following:

JOB_OPEN (with: jobname)

JOB_SUBMIT (with:authcknam, jobcount, jobname, language, report and variant)

JOB_CLOSE (with: jobcount, jobname and strtimmed = X)

JOB_OPEN (with: jobname)

SUBMIT program x...

JOB_CLOSE (with jobcount , jobname, predjob_checkstat = X, pred_jobcount and pred_jobname)

But the second time that i call fonction JOB_CLOSE, it return code sy-subrc = 2. (invalid_startdate).

This happened only in the quality environment (In the developing environment works ok).

Thank for your help!

3 REPLIES 3
Read only

Former Member
0 Likes
671

Moderator message - Welcome to SCN.

It's telling you that the predecessor job has not finished. Try giving the second job a different name.

On second thought, I'm not sure that's correct.

Rob

Edited by: Rob Burbank on Apr 19, 2010 11:26 AM

Read only

0 Likes
671

Thank Rob, but both jobs have diferent names.

Read only

Former Member
0 Likes
671

Hi,

Run the second job after completion of first job.So,get the status of first job with the following code.

CALL FUNCTION 'SHOW_JOBSTATE'

EXPORTING

jobcount = l_jobnumber

jobname = l_jobname

IMPORTING

aborted = l_aborted

finished = l_finished

EXCEPTIONS

jobcount_missing = 1

jobname_missing = 2

job_notex = 3

OTHERS = 4.

IF l_aborted = 'X'(106) OR l_finished = 'X'(106).

<Write the code to run second job>

ELSE.

WAIT UP TO 5 SECONDS.

ENDIF.

Thanks.

Ramya.