2010 Apr 19 4:14 PM
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!
2010 Apr 19 4:19 PM
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
2010 Apr 19 4:26 PM
2010 Apr 19 4:34 PM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |