Skip to Content
Salient features of this Scenario:
    •An XML file is given as input to XI.
    •The mapping is done using the user-defined java program.
    •The output file is obtained in the form of a pdf.

The scenario involves creating the input and output Data Types, Message Types and Message Interfaces. The difference from a simple file to file scenario arises in the message mapping where a pre defined java code is used.This java function does the process of converting the xml file to Pdf.

For this java code to work, we need to import some jar files into the imported archives.


The jar files required to run the java code along with the java program are kept in the imported archives.

The two jar files are:-
Pdfxml – The java program..

In the message mapping, the user-defined java function is used to map the input and output message types.


The user defined function has been illustrated below –


After this the interface mapping and the configurations follow as usual!!

This is one of the simplest ways i found in doing this scenario! Do tell me if there are any other methods!

Cheers 🙂

To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Bhavik Devisha
    Hi Divya,

    From your content i understood that you are directly converting XML data into PDF file instead of just mapping. Is it right?

    may be i wrong. But if its true then, we can use the same code in any other application also for converting XML file to PDF file.

  2. Datta saru
    I got compilation error. I added both itext-1.4.1.jar and dom4j-1.6.1.jar in D:/usr/sap../server0/bin
    Good Blog for java mapping !!!
    Thanks a lot
  3. ganesh jonna
    I cannot find XmlToPdf.class in dom4j-1.6.1.jar,
    but it was there in itext-1.4.1.jar. This file contains XmlToPdf.class, i got the java file for the same using JavaDecompiler. In that java file there is no constructor with 2 string args. Actually in the program u specified it is like:
    XmlTpPdf x=new XmlToPdf(“source”,”dest”);
    I cannot able to find this in my java source file.
    Thats why am getting error in IR saying Activation cancelled…no Constructor for
    XmlToPdf x =new XmlToPdf(“src”,”dest”);
    Help me

Leave a Reply