05-15-2007 2:36 PM
I have a requirement:
I want to process something (Send a mail to the user) once a job is finished / cancelled / Errored.
I think one way of doing this is create a new step in the job and process it depending on the status of earlier step (But I doubt whether this can be achieved).
Is there a way of doing conditional exceution of any step (i.e The execution of a step depends on the success/ failure of earlier steps)
Is there a better way of achieving this?
Thanks
Amit Jain
05-15-2007 2:42 PM
Hi.
While creating the job itself u have the option called "mail receipient"..why dont u use that??
Y do u want to go for another step...
Or
u can create 2 jobs...scond job is to send mail ,and this second job should be triggered once the firt job is over...(For ths econd job ,starting condition would be completion of first job)...
Cheers,
Ravi
05-15-2007 2:42 PM
Hi.
While creating the job itself u have the option called "mail receipient"..why dont u use that??
Y do u want to go for another step...
Or
u can create 2 jobs...scond job is to send mail ,and this second job should be triggered once the firt job is over...(For ths econd job ,starting condition would be completion of first job)...
Cheers,
Ravi
05-15-2007 2:48 PM
Hi,
You can add a Step to that job, for that spet create a new report program in that Program write the select statment from Background job tables and look at the status, then give the output, even you can write QAIT statment in the second report to wait for some amount of time
background tables are
TBTCO Job Status Overview Table
TBTCP Background Job Step Overview
TBTCR Batch scheduler execution time
TBTCS Background Processing: Time Schedule Table
TBTCA Subsequent relationship in batch job sched
TBTCB Preceding relationship in batch job schedu
Regards
Sudheer
05-16-2007 7:53 AM
Thanks for your replies,
To be specific.. I have 30 jobs and if any of the 30 job errors (Status: Cancelled), a mail needs to be sent.
Some options I think of is:
1> create 30 new jobs which depends on the status of original 30 jobs and my job triggers only if the corresponding original job errors (Is there a way to accomplish this and how?)
2> Create an additional step in each 30 original job. This step should execute (which sends an email) if and only if any of the above steps has errored.
Can this be accomplished and how?
Thanks
Amit Jain
07-12-2007 8:32 AM
But our new step wont get executed unless the earlier steps were executed successfully.
If the step 1 failed, then the control wont got to my step(which might be 2 ) and our logic wont get executed.
06-14-2007 12:49 PM
I have accomplished this using an Oracle dbms_job and a stored procedure to interrogate the background tables identified previously. In principle, the same approach can be used to create an ABAP to do the same. It is a very simple solution.
This process runs every N hours and will email to a designated distribution list a listing of all jobs that have a canceled status. Also, an exception mechanism is provided which allows you to ignore certain jobs.
I chose to do it via the Oracle method due to some peculiarities in our processing environment
07-12-2007 8:34 AM
David,
Can you please elaborate on how to schedule Oracle DBMS job and get this job done?