‎2011 Sep 19 10:24 AM
Hello,
I've developped a ABAP program which is running in background (per job) every single hour.
I was wondering if there is a way to check whether the program is still active before starting the program the next time.
I actually save the state of the execution in a SAP table. But this solution has one big disadvantage. In case of SAP goes down
for whatever reason (backup, crash,...), the table entry is not resetted and the program doesn't start again, cause table entry indicates that it's still active.
Does someone has an idea on how to check the job queue status within ABAP?
Thx in advance
‎2011 Sep 19 10:35 AM
Hi ,
when you create the background job you can put in a condition in the steps.
To execute only after a specified job is executed completely.
‎2011 Sep 19 11:14 AM
Hi,
Instead of checking job status in Ztable , you can check with FM BP_JOB_READ to know the status.
This will have the status even if the job terminated.
Regards,
Ravi
‎2011 Sep 19 11:45 AM
Hi ,
You can check with
FUNCTION MODULE "TH_WPINFO"
regards
Deepak.
‎2011 Sep 19 12:07 PM
You can get the background job info in table TBTCO ( Job Status Overview Table ). Check the status of the
earlier job by passing jobname and get its running status.
Thanks,
Pawan
‎2011 Sep 19 9:11 PM
Try using standard SAP locking concept for this purpose, e.g. lock object ES_PROG. Set the lock at the start of the program, if this fails, then the report is still running and you can exit there. Locks are being released implicitely at the end of program execution, and as well when the system is being restarted.
Thomas