2010 Aug 26 1:15 PM
Hi
i have a program which executing as a background job for every 3 minuts. but some times the job which is in process is taking a long time like up to 5 minuts and as per job scheduling after 3 minuts of first scheduled job, it is starting another same job. like that sometimes it is going upto 4 to 5 same job is processing.
Is there any solution like : only one of that job should be in the job execution process . but once the job is running the same job should not start. but if it is completed with in 3 minuts the job should be start as scheduled.
Thanks in advance
2010 Aug 27 6:20 AM
HI all
thanks for reply, but my report program is the standard one for which i cannot modify or change. so where can i write the code for running next job. Is it anyway possible through the events.?
2010 Aug 26 1:18 PM
Hi.
All the Jobs are saved in table TBTCP and TBTCO tables and so check with status in the table TBTCP with job name and status
if the status is 'S" that means it is completed then start the next Job.
Prabhudas
2010 Aug 26 1:23 PM
2010 Aug 26 3:04 PM
Hi,
I think there is a way in Job scheduling itself to define the next job only when the current one is complete (irrespective of how the execution takes place).
I recently recd help on this topic.. if you are triggering jobs from a program, you can add the foll code to make the second job (or further progm processing) to wait till the current job is over..
WHILE v_fin IS INITIAL.
CALL FUNCTION 'SHOW_JOBSTATE'
EXPORTING
jobcount = l_jobcount
jobname = l_jobname
IMPORTING
finished = v_fin
EXCEPTIONS
jobcount_missing = 1
jobname_missing = 2
job_notex = 3
OTHERS = 4.
IF sy-subrc <> 0.
ERROR_JOB = '1'.
v_fin = 'X'.
ENDIF.
ENDWHILE.
Hope this helps.. Regards, Liz
2010 Aug 27 6:20 AM
HI all
thanks for reply, but my report program is the standard one for which i cannot modify or change. so where can i write the code for running next job. Is it anyway possible through the events.?
2010 Aug 27 7:14 AM
Just create a small driver report (with same parameters, or using a variant as parameter)
This report contains two part
- 1 - lock an object (any suitable table, report or record)
- 2a - if lock successful, submit standard report with parameters or variant
- 2b - if lock unsuccesful, exit (another/previous instance did not yet release the lock, send an information message which will be available in the job log)
If there are other jobs with the same problem, create a generic program with two parameters program and variant, use the program as lock object and use the same report in each of those job.
Regards,
Raymond