DevOps and System Administration Discussions
Dive into SAP DevOps and system administration. Join discussions to collaborate on optimizing workflows, share knowledge, and leverage resources effectively.
cancel
Showing results for 
Search instead for 
Did you mean: 

Send Spool of background job via email - How to avoid sending email when there is no spool

6,994

I use the "Spool list recipient" functionnality in SM36 to send the result of a standard report by email. This report is executed via a background job running at a given frequency.

As explained here : https://wiki.scn.sap.com/wiki/display/TechTSG/Send+Spool+list+of+background+job+to+SAP+inbox

The issue is that quite often, the result of the report is empty. So no spool is generated. But the email is still sent.

Therefore the users receive most of the time emails without attachment. And sometimes there is an attachment. It's bothering them and they don't look at the emails anymore.

=> How can I avoid that emails are sent if no spool is generated?

Thanks in advance

3 REPLIES 3

0 Kudos
4,746

Anyone could help me?

Thanks in advance

jmodaal
Active Contributor
0 Kudos
4,746

Hello,

I guess for suppressing empty emails you have to do this in an (own developed) ABAP program.

Switch off the "Spool list recipient" stuff in the job definition and add the own developed ABAP program after the step that (possibly) creates the spool list which has to be sent. If there is none, the own developed ABAP program would not find a spool list to be sent and does nothing.

I attached an ABAP that does the job. It's quite old and not adjusted to "modern" ABAP, but it still should work.

0 Kudos
4,746

A blank email will be triggered when there no output data if you add email id in "Email Notification" .

It can be avoided if you add the email id only in "Spool list recipient " .