2021 Sep 29 8:26 AM
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
2021 Oct 03 12:01 AM
2021 Oct 05 10:29 AM
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.
2023 Jul 27 5:43 PM
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 " .