Often I’ve wanted some sort of notification that my long running batch job has completed so I can go take a look at the spool for it. To solve this problem, I’ve collected the steps and notes required to create a Output Device that creates and emails a PDF file to a user.
First, you must have SAPConnect previously configured. You can find info on this by visiting this link: http://help.sap.com/saphelp_nw04/helpdata/en/af/73563c1e734f0fe10000000a114084/content.htm
Secondly, you’ll need PDF printing support. Use can use SAP Note 317851 to implement the device types to use PDF. If you already have PDF output types in your system, you can skip this step.
The following procedure basically follows SAP Note 311037 to print via email, but to a PDF printer.
To create a PDF email printer:
- Navigate to Transaction SPAD
- Configuration -> Output Devices
- Output Devices -> Create
- First, you’ll want to set the name. PFD1 is a fairly standard name that I’ll use in this example.
- For the Device Type, you’ll need to select a PDF printer. Select “PDF1 : PDF ISO Latin-1 4.6D+” if you have it available.
- Next you’ll need to select the correct Spool server. This depends on your landscape, but for this example it resides on our Central Instance.
- It’s important to fill in the location and Message so that non-technical users will understand what this printer does.
Location: Virtual Printer
Message: This printer emails a pdf file as an attachment.
8. Save your new printer and you should now be able to test!
It’s important to fill in the Location and Description so you don’t confuse end users that are expecting to get a save as dialog for a PDF.
You want to select access type M. This method uses SAPConnect to send the email.
Once you have everything set up, you can hit the print button from anywhere in the system and specify your printer name (PDF1) and you’ll be prompted for an email address.
If you don’t receive an email, you’ll need to check SAPconnect. To see the message queue, use Transaction SOST.
Now you will be able to specify this printer when creating a batch job and you’ll get an email when the job completes with the job spool attached.