2005 Sep 09 5:26 PM
Hello folks,
I am developing a program which runs every 15 min and create 150 batch jobs.
I need to know whether there is a FM or table or any other way to find out how many batch jobs are still running (created by my program)before next cycle of my program execution.
I need this because I have a restriction on the max no of jobs my program can create ata given time.
To be more clear, lets think my program created 150 batch jobs in the first run.
My program will run again after 15 min to create again 150 jobs. Lets suppose only 90 jobs which are created during the 1st run are finished then I can create only 90 jobs during the 2nd run because I can schedule 150 batch jobs only at a given time.
So I need a way to find out how many batch jobs are still running or finished.
Hope I made my requirement clear. Need more info please let me know.
Thanks
2005 Sep 09 6:32 PM
Hi Naren,
You can use the function module SHOW_JOBSTATE. You can get the values to pass to this using this select.
select jobname jobcount from tbtco
into (v_jobname,v_jobid)
where jobname = v_billing_job_name
and sdldate = prundt.
CALL FUNCTION 'SHOW_JOBSTATE'
EXPORTING
JOBCOUNT = v_jobid
JOBNAME = v_jobname
IMPORTING
ABORTED = v_aborted
FINISHED = v_finished
* PRELIMINARY = v_preliminary
* READY = v_ready
* RUNNING = v_running
* SCHEDULED = v_scheduled
* EXCEPTIONS
* JOBCOUNT_MISSING = 1
* JOBNAME_MISSING = 2
* JOB_NOTEX = 3
* OTHERS = 4
endselect.
I added some more comments to your previous post. Please have a look at that.
Srinivas
2005 Sep 09 5:29 PM
2005 Sep 09 5:38 PM
2005 Sep 09 7:47 PM
Rich,
I am assuming that there are 4 servers with 10 background processes each. Am I missing something??
Thanks,
Naren
2005 Sep 09 8:01 PM
2005 Sep 09 6:08 PM
You can use the function BP_JOB_SELECT, this function return the jobs you have selected (It's functions used by SM37).
Max
Message was edited by: max bianchi
2005 Sep 09 6:32 PM
Hi Naren,
You can use the function module SHOW_JOBSTATE. You can get the values to pass to this using this select.
select jobname jobcount from tbtco
into (v_jobname,v_jobid)
where jobname = v_billing_job_name
and sdldate = prundt.
CALL FUNCTION 'SHOW_JOBSTATE'
EXPORTING
JOBCOUNT = v_jobid
JOBNAME = v_jobname
IMPORTING
ABORTED = v_aborted
FINISHED = v_finished
* PRELIMINARY = v_preliminary
* READY = v_ready
* RUNNING = v_running
* SCHEDULED = v_scheduled
* EXCEPTIONS
* JOBCOUNT_MISSING = 1
* JOBNAME_MISSING = 2
* JOB_NOTEX = 3
* OTHERS = 4
endselect.
I added some more comments to your previous post. Please have a look at that.
Srinivas