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: 

Failed Background jobs info to be generated periodically and to be emailed

former_member188019
Active Participant
0 Kudos

Hi all,

this is wrt, Failed Background jobs info needs to be circulated periodically(daily) to a distribution list.

manually i can get this info using sm37 transaction,

here i entered username=myusername and in the jobstatus i ticked canceled checkbox, and job start condition date range i selected yesterday to today.

But i want to get this info in automated manner, periodically(daily) and to be sent via email.

i thought of scheduling SM37 itself as a background job(in sm36 transaction), but in sm37 transaction, i cannot save any variants.

is there any better way to get the "Failed Background jobs info" periodically and to be sent via email.

thanks in advance.

Madhu_1980

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

I'd also think this calls for a simple custom development (we've done that here many years ago, mabye there is something in the standard by now?). Read the failed jobs, maybe read job log as well, send as email to the scheduler of the job and maybe some general distribution list that takes care of the SAP installation.

Use classes CL_BCS instead of above function module though.

Thomas

3 REPLIES 3

Former Member
0 Kudos

All the information in sap is stored in some backend tables. Just debug and find the tables which you require (TBTCO - Job Status Overview Table, TBTCD - Job Log Directory)

Create a program and extract the information from those tables (for eg. cancelled jobs) and use function SO_NEW_DOCUMENT_ATT_SEND_API1 to send email to sap or any other external inbox.

Schedule the program periodically.

ThomasZloch
Active Contributor
0 Kudos

I'd also think this calls for a simple custom development (we've done that here many years ago, mabye there is something in the standard by now?). Read the failed jobs, maybe read job log as well, send as email to the scheduler of the job and maybe some general distribution list that takes care of the SAP installation.

Use classes CL_BCS instead of above function module though.

Thomas

Former Member
0 Kudos

a small addition to what has been said above

TBTCO-STATUS = "A" will get the list of canceled jobs.

we filter by user name and job name select-options, and send an email with various information.