Skip to Content
Technical Articles
Author's profile photo Swaroop Anasane

PDF using ADS Printing in SAP MII

While below document mentions clearly how to generate a static PDF or PDF using life cycle designer, it somehow misses on highlighting
how exactly you can map the xdp file with xml input(still a great document), also the attachment sample xml and xdp does not open and it would be difficult to look for mapping for a novice like me.

https://www.sap.com/documents/2016/09/864b7d45-8a7c-0010-82c7-eda71af511fa.html (Link 1)

I tried to look for couple of hints across web to see how I can break it through, finally got a solution after referring the basics on xdp from below link.
https://www.w3.org/1999/05/XFA/xfa-template.html

Sharing these links as these may be helpful for people working in SAP area.

The solution goes like this….
1. You have an input xml that should be mapped to xdp file. Assume your input looks like how it’s mentioned in Link 1 with an added tag.

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
<PrintContent>
<invoice >
<id>DOCUMENT_20150306_888</id>
</invoice>

<Quantity>210</Quantity>
</PrintContent>

2. The xdp file I used is the one from below link.
https://help.sap.com/saphelp_crm700_ehp02/helpdata/en/43/82538c0c4458bbe10000000a422035/frameset.htm

So if you see in this xdp file, you would notice it has <field> tags in it that should have <caption> and <Value> tags in it. <Value> tag should be outside <caption> and directly under <field> tag. <Value> tag was actually not available in the sample I copied from above link so I added it.


Under <caption>, you would see one more <value> tag which is used for labeling the field. Notice the case of two tags.
“name” attribute in <field> denotes the node under <PrintContent> of input xml from where the xdp should pick data.
Eg. <field name=”Quantity” ……

With this, ADS printing action would give you a pdf to save in web folder with data from input xml.

3. Next I tried to open this pdf using Runner service(below)
http://:/XMII/Runner?Transaction=pdfGen&OutputParameter=pdfString
&Content-Type=application/pdf
but it was giving an error as “Failed to load pdf” though I could save it in web, export and open successfully.

While looking for some more clue I came across below post and answer from @jeremy.good
https://answers.sap.com/questions/7261463/display-report-in-pdf-wo-save.html

The url I used was missing “&IsBinary=true” parameter, after adding it, the service opened pdf on browser without any issues.

I am no expert in xdp, but trying to fill some gaps here. Hope it helps, do let me know your views in comments.

Assigned Tags

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