2007 Dec 18 8:19 AM
Hi,
I was asked to send an email whenever a background job fails. Could anyone please let me know if there is any possibility in doing this?
SS
2007 Dec 18 8:29 AM
Hi SS,
first of all, you should SELECT FROM table tbtco, which gives you the job executions, eventually restricting by date. Then, for each record there, call function BP_JOBLOG_READ. This will yield aninternal table. LOOP at this itab and evaluate field MSGTYPE = 'E' or 'A', for example.
This will identify the failed jobs. Finally, call function SO_NEW_DOCUMENT_SEND_API1 to send a mail message with the information that you have found for the failed job.
I hope this helps. Best regards,
Alvaro