‎2010 Jun 01 1:49 PM
Hi,
I try to use following function:
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = u_f_jobcount
jobname = u_f_jobname
predjob_checkstat = 'X'
pred_jobcount = pred_jobcount
pred_jobname = pred_jobname
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9.
But I alway get the exception invalid startdate although I want to start the job after the first job (pred_jobcount and red_jobname) is finished. Is there more parameters which I have to use when I want to start the second job after the first job?
‎2010 Jun 01 3:00 PM
Look at SAP's sample at [cheduling a Job: Full-Control Method|http://help.sap.com/SAPHELP_NW70/helpdata/EN/fa/096ce5543b11d1898e0000e8322d00/frameset.htm] like [Sample Program: Wait for Predecessor Job with JOB_CLOSE|http://help.sap.com/SAPHELP_NW70/helpdata/EN/fa/096db5543b11d1898e0000e8322d00/frameset.htm] your syntax is correct, so check your values for predecessor job.
Regards,
Raymond
‎2010 Jun 01 3:00 PM
Look at SAP's sample at [cheduling a Job: Full-Control Method|http://help.sap.com/SAPHELP_NW70/helpdata/EN/fa/096ce5543b11d1898e0000e8322d00/frameset.htm] like [Sample Program: Wait for Predecessor Job with JOB_CLOSE|http://help.sap.com/SAPHELP_NW70/helpdata/EN/fa/096db5543b11d1898e0000e8322d00/frameset.htm] your syntax is correct, so check your values for predecessor job.
Regards,
Raymond
‎2010 Jun 01 3:06 PM
Hi Raymond,
thank you for your answer, I have checked my values and debug the function, What I found is that I have an entry in table TBTCO for my pred_jobname and pred_jobcount, the only difference is that my status in TBTCO is F but in the function he want P or S, but I don't know how he set the status.
‎2010 Jun 01 3:16 PM
I have found the solutions, thank you raymond for the link:
Important: If you specify a predecessor job directly in your
program (not interactively chosen), then be sure that the
predecessor job has the status Scheduled or Released when
you schedule the successor job. Otherwise, the successor
scheduling will fail. That is, a job that is active or
already completed cannot be specified as a predecessor job.
you have to be sure that the pred_job is not already completed.
‎2010 Jun 01 3:24 PM