Distributing your company's static reports to end users using the Portable Document Format (PDF) allows you to tap into the flexibility and document management benefits PDF files provide. The author shows you how to create PDF reports using standard BW functionality, which reduces the strain on your system. She also explains how to configure the BW Reporting Agent and install Adobe Acrobat Distiller software.
The Portable Document Format (PDF) is a universal file format developed by Adobe Systems and modeled after the firm’s PostScript page-description language. You can create great-looking static reports in the PDF using standard BW 2.x and 3.x functionality and Adobe Acrobat software.
PDF reports are compatible with most operating systems and printers, and they can be distributed and viewed electronically regardless of the software or platform used to create the original file. Your end users can view and output their PDF reports on screen or to a printer even if they don’t have access to SAPGUI.
Moving to PDF reports does not require a lot of new software because most companies already use the full version of Acrobat to create and manage their documents. Your end users need only Adobe Acrobat Reader to view the static PDF reports.
Offering static BW reports as PDF files that are refreshed regularly reduces the strain on your BW system because individual users are no longer required to run such reports themselves. They also facilitate more efficient electronic document exchange for collaboration and review, and provide increased document integrity and security.
I will explain how to leverage your existing BW and Adobe Acrobat infrastructure to generate PDF reports. I’ve included an example that shows how to configure the BW Reporting Agent to deploy the technology to create a simple yet critical report. I will also show you how to configure the system to use email to distribute the PDF files or to post them directly to your company’s intranet.
Daily Reporting with PDFs
My BW system, as you might guess, is configured to generate PDF documents. Your system, however, may not be. The Acrobat Distiller software must be installed on the BW spool server and your BW system must be able to call Distiller to create PDF reports. Acrobat Distiller takes PostScript data normally used for printing and converts it to a PDF file. This installation is a one-time procedure that your Basis team must perform. You’ll find the installation steps in the sidebar “The PDF Output Device.”
After Distiller is installed, the system is ready to generate PDF reports. I will walk you through how to generate a PDF file for an updated cost center manager list, which is a report that is required by various functional groups within a company to manage costs and control expenses. At my company, this report is refreshed every day at 5 a.m. and posted to one of the finance intranet sites where users can access this information as a PDF document. Here are the steps:
Step 1. Create the query that provides the report data. Let’s assume that you have cost center manager information in your BW system. Your first step, then, is to build a query via the Business Explorer (BEx) to display the information that will be contained in the static daily PDF report.
Step 2. Configure the Reporting Agent to enable Print in Background functionality. Because they are created from the data used to drive printers, generating PDF files is based on print functions. In the Administrator Workbench, which can be accessed via transaction RSA1, select the Reporting Agent button in the left window. Select the Print icon (Figure 1), and navigate to the query you want to generate the results for as a PDF report. Right-click on the query to access the New Setting option.

Figure 1
Use the Print icon in the Reporting Agent and right-click on the appropriate query to begin defining the PDF report
Use the following tabs in the new setting screen to set various report parameters:
- General defines the Description, Technical Name, and the Read Mode of the New Reporting Agent Setting (Figure 2).
- Print settings enable you to design the page and determine how certain data attributes are displayed and printed.
- Print Layout configures the data on the page in columns and rows as well as in headers and footers.

Figure 2
The General tab on the New Reporting Agent Setting screen allows you to establish the Reporting Agent setting name as well as other basic settings
After configuring all three tabs, save and activate the settings by first clicking on the save icon, and then the activate icon. The newly activated Reporting Agent setting now shows up under the Cost Center Managers query with the new setting icon (Figure 3).

Figure 3
The newly activated Reporting Agent setting appears under the Cost Center Managers query with the new setting icon
Step 3. Establish a new scheduling package. Before generating a PDF file, you must create a scheduling package for the new settings. Follow the path Reporting Agent>Print>Scheduling Packages section, and click on the create icon to open the Create Scheduling Package window (Figure 4). Enter the technical name of the settings that you just created and the description. The new package will appear in the Scheduling Packages section of the Print screen in the Reporting Agent (Figure 5). From the Reporting Agent Settings, drag the new settings into the new scheduling package that you just created so you can schedule the print job and create your PDF.

Figure 4
Use the Create Scheduling Package option to create the package for the new reporting agent setting that you created

Figure 5
Report Agent settings now appears in the Scheduling Packages section of the Print screen
Step 4. Select the output device. The output device is called to create the PDF report when the print job is executed. See the sidebar "The PDF Output Dvice" for details about establishing and configuring a PDF output device for your system.
Once it is in place, select the output device by right-clicking on the new scheduling package, and choosing the Maintain Print Parameters option to open the Background Print Parameters screen (Figure 6). From the dropdown list in the Output Device field, make the appropriate choice, which in this example is the ACRO output device.

Figure 6
Set the Background Print Parameters
Your print job can be scheduled to run immediately, after an event, or at some other predetermined time.
Step 5. Maintain the options for the output device command set ID. Next, define the values to be passed to the print variables in the output device command set ID. See the sidebar “Define the Commands to Create and Distribute Your PDF Reports,” for more information on the command set ID shell script and print variables.
Define the values for the print variables via the Properties button on the Background Print Parameters screen (Figure 6). Use the Overview tab of the Spool Request Attributes window to establish general attributes such as time of printing, format, spool request attributes, cover sheet attributes, and output options.
Locate the Cover sheets folder in the Overview tab. The value of the Recipient field in the Cover sheets folder (Figure 7) is passed to the "&R
" variable in the command set ID and the value of the Title field in the Spool Request folder is passed to the &T
variable in the command set. Together these two variables determine the method of distribution for the PDF report.

Figure 7
Use the Cover sheets folder in the Overview tab to set the variables passed to the command set ID for distributing your PDF
If the Recipient field contains FILE (Figure 8), the script in the command set ID expects the full path and file name in the Title field under the Spool Request attributes (Figure 9) where the file needs to be saved. The shell script uses this information to place the PDF file in a specified location, which is how my system posts the PDF report to the company intranet.

Figure 8
If the Recipient field contains FILE, it enables the shell script to place the PDF file in a specific location

Figure 9
With FILE in the Recipient field, the Command ID shell script expects the report file location to be posted to in the Title field
At my company, the PDF report is written to a network file system (NFS) directory mounted on the BW server from another server that hosts an internal Web site containing finance data. The ACRO shell script is programmed to overwrite any existing older files in the same directory location to ensure the latest information is posted to the intranet site. The PDF file becomes instantly available to end users.
If the Recipient field contains DIRECTORY, then the script looks for the full path in the Title field and uses USERNAME-YYYYMMDD.pdf as the filname. This method is used if you want to post the file to an intranet location but do not want to specify a file name. In this case, a default system name based on the specified format of USERNAME-YYYYMMDD.pdf is used. The file name is time stamped so this method prevents older files from being overwritten making different versions of the PDF reports available.
Note
Enabling this setup assumes the directory you want the file posted to is NFS-mounted on the BW server and that the SAP user ID has the required permissions to write to it.
If the Recipient field contains a user’s name (Logon ID), then the report will be emailed to the recipient (Figure 10). You can enter a user-defined title in the Title field and it will be displayed as the subject of the email. This is a convenient way to send static reports to users who only want to access the material occasionally and don’t have the BW front-end or SAPGUI installed on their machines but do have Acrobat Reader. Save your settings for the print parameters by clicking on the ok icon.

Figure 10
If the Recipient field contains a user ID, then the report is sent by email to this user
Note
There is one hitch to the email method: The recipient field only allows a 12-character email ID.
In the example in Figure 9, the user name is the same as the email ID. The shell script adds the mail server to the email address — at my company that’s @adobe.com. The subject is based on the title specified when setting up the Reporting Agent settings, which in this case is Cost Center Manager List.
The system at Adobe uses the “&R
” and &T
print variables to determine the method of distribution for the PDF report, but you can use others. Again, refer to the sidebar "Define the Commands to Create and Distribute Your PDF Reports" for more on what print variables are supported.
Step 6. Schedule the job to create the PDF report. The final step is to schedule the job that creates your PDF report. First, right-click on the scheduling package and select Schedule from the menu (Figure 11). The default job name is created beginning with an RA followed by the technical name of the Reporting Agent setting. In this example, you would use the newly created setting name for job RAZPRINTCCMGR. I’ve used that name in the example in Figure 12, which shows the Job Overview screen that you can access to track the status of the job via transaction code SM37. Note that Figure 12 shows the time we use at Adobe, where the job is set up to run at a predetermined time every day — 5:00 a.m.

Figure 11
Schedule the print job in Reporting Agent to create your PDF report

Figure 12
Use transaction SM37 to access the Job Overview screen, which displays the status of the job
Congratulations! You have successfully created and distributed a PDF report based on the settings defined in the Reporting Agent.
The PDF Output Device
Before you can begin generating PDF reports in BW, your system needs to be configured to work with Acrobat Distiller Server software. Distiller must be installed on your BW spool server, and the system set to convert Adobe PostScript files to PDF files over the network.
Enlist your Basis team to create a PDF output device, which uses a script to call Acrobat Distiller and create the PDF files. When a SAP spool request is sent to the PDF output device, it generates a PostScript file, which is passed to the command script to create a PDF file using Adobe Acrobat Distiller. The PDF output device, which outputs PDF files exclusively, uses the same data stream that drives PostScript printers and is maintained along with your system’s other output devices.
Note
Newer versions of Acrobat Distiller provide better security features that can be included using the distill command in the scripts.
The version of the Distiller software must be compliant with the SAP server and its operating system. The version of Distiller dictates what the correct command syntax is for calling the Distiller. If you’re using Microsoft Windows servers, for example, you’ll need the Windows version of the Distiller, and you must write a batch program to call Distiller.
Adobe Systems uses Sun Unix servers, running the Solaris OS for SAP, so the firm has the Unix Solaris version of Acrobat Distiller. The output device in the system is named ACRO and it calls Distiller via a Unix shell script.
Creating a PDF Output Device
You need to access the Spool Administration screens in BW to create and configure the output device. Follow the path Tools>CCMS>Spool>Spool Administration or use transaction code SPAD to access the screen. In the Initial Screen (Figure 1), select the Device/servers tab and click on Output devices, which leads to a list of existing output devices (Figure 2).

Figure 1
Use the Spool Administration screen to create an output device for Distiller

Figure 2
The output device for generating PDF files is listed along with the rest of your output devices
Use the change icon to evoke the change mode, then select the create icon to create a new output device. On the Spool Administration: Create Output Device screen, enter its name in the Output Device field. I used ACRO
in the example shown in Figure 3. On the DeviceAttributes tab, populate the Device Type field with the POST2 value from the drop-down list (Figure 4).

Figure 2
The output device for generating PDF files is listed along with the rest of your output devices

Figure 3
List of device types defined by default in the SAP BW system

Figure 4
The Spool Server identifies the server where the output device resides
The Basis team usually sets up the spool server at the time of system installation. A typical R/3 or BW landscape has one default spool server for each environment. Select the spool server in BW from the drop-down list in the Spool Server field. Select the value Standard Printer from the drop-down list in the Device Class field, which enables the reports to be created in a PostScript format. Save and activate these settings by first selecting the save icon and then the activate icon.
Note
Use POST2 for the Device Type. The POSTSCPT setting is obsolete and no longer used.
After you’ve saved the Spool Administration settings, selecting ACRO as the output device in the Reporting Agent: Background Print Parameters window (see Figure 6 in the main article) causes a PostScript file to be created.
The PostScript file is converted into a PDF file by Distiller. My system uses logic in the shell script pdfmail.csh to perform this processing. Properly defining the command set ID print variable allows the script to covert the PostScript file into a PDF document by calling the Acrobat Distiller. The command set ID also is used to distribute the finished PDF. (See the sidebar, “Define the Commands to Create and Distribute Your PDF Reports,” for more details.)
Define the Commands to Create and Distribute Your PDF Reports
A command set must be defined so that the shell script can call Distiller and convert the PostScript file into a PDF file. It also determines the distribution method of the report. (See step 5 in the main article.)
To create a customer-defined command set, select the Access Method tab (Figure 1) and follow the Edit>Command Set path. In the Command Set ID field, enter a one-character reference to create a new command set, which is D in the example. Maintain the settings by double-clicking in the Command Set ID field, and access the fields used to define the command set (Figure 2).

Figure 1
Use the Spool Administration screen to create an output device for Distiller

Figure 2
The output device for generating PDF files is listed along with the rest of your output devices
The Description field explains what task the command set actually performs, and makes it more readily identifiable. The command to process the PostScript file is defined in the Command to transfer print data field, which contains the shell scrip and print variables. In this example, the Command to transfer print data is populated with: /usr/intf/AW1003/0236/bin/pdfmail.csh &F &o "&R" &T
.
In this example, &F
identifies the PostScript file name and path of the spool file. When print output is sent to a device, the data is converted to the format specified by the device type of the output device. It is stored in a temporary file in a configured spool directory on the spool server. The generated file path name is the value passed to the &F
variable.
The owner of the print job, i.e. the user running the transaction, is the value passed to the &o
variable, while the "&R
" identifies the recipient. The value of the Recipient field on the Background Print Parameters Screen - Spool Request Attributes section in the Reporting Agent is passed to the "&R
" variable. It is enclosed within quotation marks so the value can be blank.
The value of the code sheet title field on the Background Print Parameters Screen - Spool Request Attributes section in the Reporting Agent is passed to the &T variable. The variable value of &T
along with "&R
" determines if the PDF report will be posted to an intranet site or file location, or sent via email to a user.
The “Setting Parameters” section of the SAP Printing Guide in the SAP Library provides a list of variables for the command set. In BW, follow the menu path: SAP Library>mySAP Technology Components>SAP Web Application Server>Computing Center Management Systems>SAP Printing Guide>Setting Parameters.
Heena Sood
Heena Sood is a senior business systems analyst for information services at Adobe Systems, Inc.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.