Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Sending email when background job fails

Former Member
0 Kudos
193

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

1 REPLY 1

Former Member
0 Kudos
74

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