12-21-2007 5:13 PM
Hi,
I need to run a program through job.I created a job using JOB_OPEN
And submitted the job name and job count to the required program
And closed the job using JOB_CLOSE.
My problem is the job getting scheduled but not released/ processed automatically by the specified time I need to release it manually through SM37.
My code.
JOB_OPEN
SUBMIT VIA job_name and job count
l_time = sy-uzeit + 60.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = l_jobcount
jobname = l_jobname
SDLSTRTDT = sy-datum
SDLSTRTTM = l_time
STRTIMMED = 'X'
IMPORTING
job_was_released = l_released
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
After the above code execution SY-SUBRC is 8 and And the L_released is having balnk.If I pass start immediately the the job processed immediately. And the L_released is having X.
Please help me .
12-21-2007 5:23 PM
12-21-2007 7:50 PM
If you are trying to set up the job to start at some point in the future - use the SDLSTRTDT and SDLSTRTTM, but do not set the STRTIMMED to 'X'. You can either schedule it for the future (with the sy-datum and sy-uzeit+60 you desginated) or you can set it to begin immediately. But I don't believe you can do both.
In your code example, your are setting both the "start immediately" plus giving it a future date and time.
Give that a try and see if it helps.
-Mark
12-22-2007 6:15 AM
Hello mark,
Sorry ..Actually in my code i have commented start immediately. i forgot to remove that line from the post.
As you said we can give either specified time or start immediately.
in my case start immediately works fine but in the specifed time the job is not getting released.
Thanks!!!
Siva.