A simple report that will compose an email with the information on the selection screen. The content of this email also includes multiple attachments, which are picked up from files on the server.
The total number of files is limited to 20 and the total file size is limited to 1Mb. Both limits can be adjusted easily (in the last 10 lines of coding).
The selection screen
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", just to automatically clarify the origin of the email.
Files to be selected are defined with a path (server path) and a file pattern (e.g. The actual filename pattern 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