Sunteți pe pagina 1din 14

Template Designer: Create

Automatic PDF Documents for


Attachment or Print Purpose

Applies to:
SAP Customer Relationship Management (SAP CRM) Release 7.0 SP 01, November 2008.
SAP NetWeaver 7.0 including enhancement package 1 Support Package Stack 02, including BI Content
Add-On 04, October 2008. For more information, visit the Content Management homepage.

Summary
Template designer, a tool available in SAP CRM from version 5.2, can be used to create Microsoft Word or
PDF document template which leverage Webservice to create Word or PDF document automatically in a
predefined layout with desired data from a specific transaction. The document can be attached automatically
to any transaction or can be used for print purpose.
Author:

Arkopaul Sarkar

Company: Capgemini Consulting India Pvt. Ltd.


Created on: 15 April 2009

Author Bio
Arkopaul is a Consultant working with Capgemini consulting India Pvt Ltd. He has ample interast in
Service oriented architecture, ADOBE product integration with SAP and CRM.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


1

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Table of Contents
Introduction .........................................................................................................................................................3
System Requirement.......................................................................................................................................3
Webservice .....................................................................................................................................................3
Testing ..............................................................................................................................................................10
Related Content................................................................................................................................................13
Disclaimer and Liability Notice..........................................................................................................................14

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


2

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Introduction
Template Designer is a tool available in SAP CRM from version 5.2. This tool leverages Webservice to
create document template. Document templates can be either a Microsoft Word document or a PDF type
document. The Document template has a predefined layout and the layout is filled by data fetched by
Webservice from CRM system at runtime and the final output is displayed in Adobe Acrobat or MS Word.
The final output can be attached to any object like opportunity, activity or sales contract as attached
document and later used to send as an attachment via e-mail or to simply print as a form.
The scope of this article is to discuss the procedure to create PDF type document template through template
designer.
System Requirement
For Adobe Integration, you require:

Adobe Reader on all clients

Adobe Lifecycle Designer for Designers Machine (included with SAP GUI)

SAP CRM 5.2 or above

Webservice
The data rendered in the document template is fetched by Webservice. Webservice tool is available in CRM
Web UI to create Webservice for a business object in four easily navigable steps. The tool can be found
under Service Professional role and can be accessed from the Service Operations work center. In this article
we cite the transaction business activity, which we will build the document template for. As we need to
display the activity data in the document template, we must have one Webservice for reading the activity
data.
We create the Webservice in the following four steps by Webservice tool.
Dont forget to make the Webservice productive after activating it.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


3

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Process steps
1. Login to your Web UI portal and go to template designer.

2.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


4

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

3. Click on New as marked in the above picture and you will be presented with the following screen.

4. Choose File Type as Adobe XML From File from the drop-down menu.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


5

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

5. Define the Name for your document template and Description.

6. Choose Object Type from F4 help. In this case it is BUS2000126 for Business Activity.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


6

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

7. Choose the Webservice name from F4 help.

8. Now click the button Download Schema and save the XML document in your workstation when
prompted.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


7

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

9. Now open Adobe Livecycle Designer installed in your workstation. Create a new Form layout and
then create a new data connection from File New Data Connection.

10. This will present a wizard where we choose XML Schema as the data source and then in the next
screen select the XML schema file from workstation. Remember this document we downloaded from
template designer. You will notice that the Webservice method is selected automatically as Data
Root Element. If there are multiple methods you can choose your desired one from the drop-down
menu. Dont forget t check the Embed XML Schema checkbox.

11. Upon finishing the wizard a data connection is automatically created in the data view. Now we design
our form as per our design requirement. We also bind the fields, where we need to display activity
data to be displayed in the form, to the corresponding fields in the data connection. We used a
simple Webservice to fetch activity objectID, description, location and priority. You can complex data

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


8

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

and even tables for item data through your Webservice.

12. Now we save the form with property Adobe XML Form File as the Save as type and .xdp as the
Extension in your workstation.
13. Now we go back to the template designer at the point where we left it and click on the Start
Designer button. This will open the Upload template to CRM field where we browse and mention
the path for the .XDP file we saved from Adobe Livecycle Designer and click on the Upload button
beside it to upload the template.

If the upload is successful we get a success message. In the search screen of template designer you
can find your template.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


9

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Testing
Now when our document template is ready for business object type BUS2000126 (Business Activity), we can
try to attach it as document in one activity. You can access the document template by clicking the With
Template in Attachment section of the activity.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


10

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Whenever you will select your document template (in this case Test_docact) the form will open in acrobat
reader (embedded in Internet browser) with all the required data of the particular activity.

You can take a print out of this form from the print functionality of Acrobat Reader or attach it to the activity.
To attach it simply close the browser along with Acrobat Reader. You will get a success message that your
document has been saved successfully and can see the document in the Attachment section of the particular
activity.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


11

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


12

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Related Content
http://help.sap.com/saphelp_crm70/helpdata/EN/c3/769dd7c3ef4e7ea1467c05566c5385/frameset.htm
http://help.sap.com/saphelp_crm70/helpdata/EN/33/e747fbe8ee404f9021deb1972b4166/frameset.htm
http://help.sap.com/saphelp_crm70/helpdata/EN/33/e747fbe8ee404f9021deb1972b4166/frameset.htm
For more information, visit the Content Management homepage.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


13

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Disclaimer and Liability Notice


This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not
supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,
and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or
code sample, including any liability resulting from incompatibility between the content within this document and the materials and
services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this
document.

SAP COMMUNITY NETWORK


2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com


14