Application Development 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: 

Job not released in the given specified time(Job_close)

0 Kudos

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….

3 REPLIES 3

Former Member
0 Kudos

Did you try this FM to submit the job

JOB_SUBMIT

Pavan

Former Member
0 Kudos

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

0 Kudos

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.