A simple report that will compose an email with the information on the selection screen. The content of this email also includes an attachment, which is picked up from a file on the server. A possible way to use this is to have the download tool (elsewhere on AbapcadabrA) produce a file on the server, which is picked up and send out via email with Mail-a-file functionality. 

The setup

You could use this tool to send out anything you need your end user to have in his/her email inbox. Download it here. The coding is straightforward and purpose build for re-use.

Subject and body

Every email has a subject line as well as actual content lines. The subject line can be filled in on the selection screen, or a default subject will read: "Message from SAP sss client nnn" (specifying the system id and the client number).

The body of the email can be composed out of multiple lines and is read from the text pool: use SO10 to create your text and specify the text name in the report selection screen. A body text is not mandatory. At the end of the email, the text line "This email was created in SAP sss client nnn" is added, just to automatically clarify the origin of the email.

.

Note that this setup can also be used without sending the actual attachment. This can be useful if the email should only inform the receiver on whether a file is available or no longer available. Classic case would be an interface that should pick up a file and remove it after processing. This report can be scheduled to send an email stating the file is no longer available (thus the interface ran). How? Just mention the parameter {MESSAGE} in the email subject or body text. {S}: {MESSAGE}  would become "R3P_510: (Text) file was NOT available". 

Also note that when no attachment name is specified, the report assumes the filename of the attachment (without path) should be used. The actual filename can also be composed with variables, to make the setup ready for scheduled use:

The system variables which will be populated at runtime:

  • {S}=system+client
  • {D}=date yyyymmdd
  • {T}=time hhmmss
  • {H}=hour hh
  • {M}=minutes mm
  • {C}=client