In CRM webclient UI there is a reuse assignment block “Attachment” which are available for most of CRM application.
There is a button “With Template” which allows you to create word document whose content will automatically be filled by the web service created by you via web service tool in CRM. This document explains how to archive this step by step and illustrate the technical detail behind it.
This feature is especially useful if you need to fulfill the scenario to create lots of documents for business transaction like Sales order and the document content consists of both static text and dynamic values like Order ID, Order description etc. Then you just need to create a single document template with all static text, and those dynamic values could be filled by web service in the runtime.
In this document I will create such word document for Product as example. The logic is exactly the same if you could like to create web service enabled document for others such as Sales Order, Service order, Opportunities etc.
(1) Create your own web service which will be consumed by your word document. As Arjun Pawar has already written an excellent document All about Web services – Web Service Tool, I will not repeat the detailed creation steps, but just include the productive web service I created:
There are some important attributes which we can write down for later usage: a. I specify BOR type BUS1178 for my web service b. The Genil component PROD is assigned to my web service together with its root node “Product” c. I have only enabled “Read” operation for my web service d. There is one function group automatically generated: /CRMOST/JERRY_PROD_WS_FCT. We will discuss it later.
(2) Download the word plugin “SAP Data Panel” from service market place. This wiki could guide you how to download and install in your computer. If you encounter any problems, feel free to contact me.
After successful installation, create a new word document and you will see a new menu “SAP”:
It should appear in Active Application Add-ins in your Word option.
(3) Create a new word template. Work center “Service Operation”,
Fill all mandatory fields like below and click “Start Designer” button:
click Open in new popup:
Then a new empty word document is opened. In the right part, the “SAP Data Panel” Addin will display all fields available in root node Product of Genil component PROD as a tree, the root node is named “JerryProdWs”, which is just the web service we created in step1. Now you can edit this word template by adding the static part like header, footer, field label. Just select the field in the SAP Data Panel, drag it into the left part and drop.
This is the final version of my word document. If you put the mouse over the dynamic fields which are dragged from SAP Data Panel, it will be marked with a grey rectangle as a hint that it is dynamic.
Once click, the technical name will be displayed on top of it.
Now since I already finish the template edit, I could directly close the word application.
(4) Go to Product application, click “With Template” button:
in popup choose the template created in previous step:
Then the word application is automatically launched with all dynamic data filled as expected:
Close the word application and then this document will be saved and appear in the attachment assignment block:
Automatically generated Artifacts after web service creation
In step1 after web service creation we write down the function group name /CRMOST/JERRY_PROD_WS_FCT.
In fact there are other artifacts automatically generated by system which are necessary for web service runtime processing: You will find the function group in package $WS_BOL_GEN ( all function group for other web service are also put here ) Since I have only enabled Read Operation during web service creation step, so within this generated function group there is only one generated function module which will delegate the web service call to the method GET_OBJECTS of Genil implementation class CL_CRM_PRODIL of genil component PROD.
also the generated DDIC structure for web service input & output parameter:
Query table VEPFUNCST with VEPNAME = my web service name, I can find one generated simple transformation:
we can view its content via tcode STRANS:
How to debug the web service call
In case your word document content is not correctly filled by web service, you have to configure out whether it is caused by any issue of the web service provider implementation itself ( in my example it is CL_CRM_PRODIL method GET_OBJECTS ) , or there is another possiblity that the data is correctly returned by the service provider, but lost or conrupt during web service framework processing for example output parameter mapping. You can debug to find the root cause.
The entry point is the Office integration handler class CL_OI_HANDLER to handle with the http request:
You can set breakpoint on the generated read function module to check whether the call is successfully delegated to the service provider – Genil component implementation class’ GET_OBJECTS method:
Then check whether the response returned by service provider is correctly processed by framework via transformation:
Enhance the value assignment via BAdI Implementation
Sometimes the standard processing of Web service framework might not work exactly as what you expect. Take product application for example, Suppose you drag the field UPNAME into word document, and through debugging you can confirm that its content is correctly returned by Genil implementation class, but discarded by framework in method clear_attributes in line 49:
Since the Product application marks field UPNAME as HIDDEN field, so it will be cleared in the final web service output structure:
However if your business scenario does need all hidden fields to be also filled, you can create a BAdI implementation based on enhancement spot CRM_WST_RT_ENHANCEMENT. Specify your web service name as Filter value for SERVICE_NAME.
The BAdI implementation is called AFTER framework processing, so now you have the chance to fill any empty fields all by yourself, since all relevant context are available in changing parameter OUTBOUND.
For a detailed step by step how to do this, please read this document How to enhance a web service response structure in word template integration.
Create the attachment as PDF format
see this document for detail.
Further reference
(1) consulting note 2023246 – Table not showing correct data in attachment created with template
(2) consulting note 2047113 – How to check whether a field in word template is filled correctly by web service
(3) consulting note 2047259 – Trouble shooting guide about word document merge with web service
(4) consulting note 2048272 – A simulation tool to check document template merge issue
(5) consulting note 2055197 – If you would like to know how a word template is merged with data from xml file, you can find technical detail in this document Understand how the word template is merged with xml data stream.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关推荐
在SAP CRM(客户关系管理)系统中,同步问题往往是由于不同组件间的通信故障或配置错误导致的。本文将深入探讨两个具体的问题及其解决方案,帮助用户理解和处理SAP CRM中的同步异常。 首先,我们遇到的第一个问题是...
尽管SAP CRM 和 ECC 在某些功能上有重叠,例如CRM 的 SALES 功能类似于ECC 的 SD(Sales and Distribution),以及CRM 的 SERVICES 与ECC 的 CS(Customer Service)相似,但两者的设计理念和技术实现方式存在明显...
【SAP CRM 2007 IDES】是一款专门针对SAP客户关系管理(CRM)2007版本的集成开发和教育环境(IDES)。IDES全称为Integrated Development and Education System,它为开发者和学习者提供了完整的SAP CRM系统,以便...
《SAP-CRM-系统用户界面操作指导手册》旨在为用户提供一个全面的操作指南,帮助他们熟悉SAP CRM Web客户端的用户界面及其各项功能。 #### 二、SAP CRM Web 客户端用户界面概览 ##### 2.1 用户界面结构 SAP CRM Web...
SAP CRM系统介绍SAP CRM系统介绍SAP CRM系统介绍SAP CRM系统介绍SAP CRM系统介绍
三、移动智能:SAP CRM支持移动智能,允许企业员工随时随地访问客户信息、管理客户关系和进行销售活动。 四、数据分析与挖掘:SAP CRM提供了数据分析与挖掘功能,帮助企业分析客户行为、预测销售趋势和优化销售策略...
### SAP CRM管理方案介绍 ...综上所述,SAP CRM是一个综合性的客户关系管理系统,不仅能够帮助企业提高市场营销、销售和服务的效率,还能通过智能分析等功能为企业提供决策支持,从而在激烈的市场竞争中获得优势。
标题"SAP CRM Tables 1"指的是关于SAP客户关系管理(CRM)系统中的数据库表的讨论,这通常...深入理解这些知识将帮助IT专业人员更好地实施和维护SAP CRM系统,提升工作效率,并为企业的业务决策提供更准确的数据支持。
SAP CRM 2007 IDES
### SAP CRM IPC增强知识点详解 #### 一、SAP CRM IPC增强概述 SAP CRM (Customer Relationship Management) 是一个全面的解决方案,旨在帮助企业管理和优化与客户之间的互动过程。IPC(Interactive Pricing ...
SAP Web Service 基础教程 SAP Web Service 是一种基于 SOAP 协议和 WSDL 语言的 Web 服务实现方案,在 SAP 系统中,开发和消费 SOAP 方式的 Web Service 十分方便。本教程将详细介绍 SAP Web Service 的基础知识...
Web_Service与SAP_ECC系统服务发布与调用 在 SAP ECC 系统中,Web Service 是一种基于 XML 的通信协议,能够让不同的系统之间进行数据交换和集成。Web Service 是一种平台无关、语言无关的技术,可以让不同的系统、...
6. **分析与报表**:掌握SAP CRM的分析和报表工具,如Business Intelligence(BI)和Web Intelligence,通过实时数据洞察客户需求,支持决策制定。 7. **集成与定制**:理解SAP CRM如何与SAP ERP、BW(Business ...
它针对的是CRM2007版本,并提供了一系列步骤帮助用户优化计算机性能与SAP Web使用体验。 ### 网络通信设置——DNS绑定顺序 #### 改变DNS绑定顺序 DNS(域名系统)绑定顺序是指计算机连接到网络时,DNS服务器的...
SAP公司全套CRM解决方案覆盖了销售、市场营销、售后服务、客户分析、客服中心、电子商务、社交CRM及移动手机等各个方面。客户可按当前业务所需选择的相关功能,应用程序可在6-8周内迅速部署并投入使用。新的SAP CRM...
Web Dynpro是SAP推荐的Web应用开发技术,它将逐渐取代BSP(Business Server Pages),为CRM等应用提供更加先进的用户界面设计。 总的来说,SAP CRM是企业提升客户体验、优化业务流程和增强竞争力的重要工具。通过其...