Skip to Content

A Simple Way – How to create a PDF Document with SAP-xMII 11.5

Introduction: Of late, in many real-time business we need PDF documents for many purposes. So creation of a PDF Document is a simple requirement. SAP xMII supports the generation of PDF documents for both the documentation of xMII Business Logic Services transactions and user-defined output reports. But in SAP-xMII there is no sufficient help documentation on how to create this with PDF Actions in Business Logic Services. So I wonder if I could extend my hands to provide some guidelines on this.


Prerequisites: Before starting creation of PDF Document you must have the iText Library for PDF Processing installed in xMII Server. For this, you can refer to

Take a look at the following steps for the purpose

          * ScreenShot of the BLS (Business Logic Service)


         * Before starting of a PDF Document, we should first get some data content to be shown in the PDF Document. In this example, a table containing five columns and four rows with data cells is shown as HTML (See below) The Data Source of this table may be any of Queries (SQL, Tag, XML, Alarm).


         * Now we want to display this table in the PDF Document. Here goes steps (Actions) in Logic Editor

Action 1 (PDF Document) : The PDF Document action is used to create a PDF document based on default document properties. 

  • 1. Right-Click > Configure. A Dialog for PDF Document comes out and some required fields and document properties are configured as follows:



  • 2. Do following configurations

Use the fields Title, Author, Subject, Keywords & Creator for the PDF Properties.

Use ‘A4′ for Page Size

Use Margins (Top, Bottom, Left & Right) with ‘20′

Tick the checkbox ‘Show Page Numbers?’

Tick the checkbox ‘Center on Page’

Use the fields for Header Section

Use the fields for Footer Section


  • 3. Press OK button to save this configurations for the PDF Document.

Action 2 (SQL Query) : SQL Query action is designed to load an XML document in SAP xMII format returned from an SAP xMII SQL Query.

  • 1. Right-Click > Configure. A configuration page comes up as below


  • 2. Set the Query Template by browsing (use the button ‘…’) where the data contents are stored.


  • 3. Press OK button to save this configurations

Action 3 (PDF Table) : The PDF Table action is used to add a table to a PDF document. The contents of the table can be any SAP xMII data set.

  • 1. Right-Click > Configure. A PDF Table Dialog comes up as below


  • 2. Do following configurations

Set the field ‘PDF Doc’ with configured PDF Document (Action 1)

Set the field ‘Table Data Source’ with the results (output) of the configured SQL Query (Action 2)

Set the field ‘Caption’ to display the caption name for the table in the PDF Document

Use ‘Table Properties’ to configure or design the table.


  • 3. Press OK button to save this configurations of the PDF Table.

Action 4 (Image Saver) : The Image Saver action is used to save an image.  The result of this action is that the image is saved to the path provided. In order to save a PDF document, link the PDF document output to the encoded image input of the Image Saver.

  • 1. Right-Click > Configure. A File Path Selection Dialog comes up as below


  • 2. Provide a full path where this PDF Document must be saved. In this example, the PDF document is saved in the location C:\Inetpub\wwwroot\ with the name PDFForSom.pdf. (Always remember to use the extension .pdf since this is a PDF Document)


  • 3. Press OK button to save this file path selection for PDF Document


  • 4. Right-Click > Links. A Link Editor for mapping the links comes up as below


  • 5. Map the property Output of the object PDFDocument (In the Left Side Area) with the property EncodedImage of the object ImageSaver (in the Right Side Area). The mapping link should comes as follows


  • 6. Press Close Link Editor button.


          * After building this BLS, we save this BLS.

          * Hit F5 to execute this BLS, this will generate the required PDF Document and store this document in the mentioned location.

          * Open the document (PDFForSom.pdf in this example) from the location and this comes as below



           * Hope, now you are able to understand how to create a PDF Document and apply the combination of your ideas & hands to meet your requirements with the help of all kinds of PDF Actions. Have a wonderful day!

Be the first to leave a comment
You must be Logged on to comment or reply to a post.