如何在SAP CRM里创建和消费Web service
Created by Wang, Jerry, last modified on Dec 19, 2014
The following steps demonstrates how to expose a function module as a web service in CRM.
- create a FM to return product description by given product ID.
Just use the following source code:
SELECT SINGLE A~short_text INTO rv_text FROM COMM_PRSHTEXT AS A
INNER JOIN comm_product AS B ON B~product_id = iv_prod_id AND B~product_guid = A~product_guid.
Make sure the FM is marked as "Remote enabled".

- start the web service creation wizard:

Just follow the wizard to finish creation. Choose the appropriate authentication approach according to your use case.

- Once creation is finished, you would find your service definition as below:

click tab WSDL, write down your WSDL link:

- tcode SOAMANAGER, click Web Service Configuration

you can find your service definition created just now:

click the hyperlink and create a new service:

Make sure you use SSL.

Otherwise, you will meet with the following error code in the runtime. This is simply because web service via HTTP protocal is set as forbidden in Suite landscape and all such communication will be redirected, as set up in SMICM.

click Finish button.

Now your web service is ready for consumer. click this icon:

write down this link for later usage:

How to consume web service in CRM
tcode SE80, create a new service consumer:

Choose external WSDL:

choose the url got from "how to create web service in CRM", step3

activate your consumer proxy and write down the ABAP class name.

- go back to SOAMANAGER, find the consumer proxy created in step2:

create a new logical point:


- Make sure you specify URL got from web service creation last step. If you just use the URL got from SE80 in tab "WSDL", you will meet with below error.

choose HTTPS:

- consume the web service in ABAP report:
data: lr_proxy TYPE REF TO CO_ZPRODUCTDESCRIPTION4,
input TYPE ZGET_PROD_DESCRIPTION,
output TYPE ZGET_PROD_DESCRIPTION_RESPONSE.
input-iv_prod_id = 'ARNO_TEST004'.
CREATE OBJECT lr_proxy
EXPORTING
LOGICAL_PORT_NAME = 'ZLP_JERRY1'.
CALL METHOD lr_proxy->ZGET_PROD_DESCRIPTION
EXPORTING
input = input
IMPORTING
output = output.
Now we get the web service execution result:


How to consume public web service in CRM
The steps to consume the public web service is almost exactly the same as consuming SAP internal web service.
Use the public web service http://www.webservicex.com/FinanceService.asmx?WSDL as example.
First it is necessary to verify whether this web service is working correctly for the time being - test it in soapUI:

Just test the consumer proxy class in class builder:

Specify request input just the same as in SoapUI:

Execution result is the same as what we get in SoapUI:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

如何在SAP CRM里创建和消费Web service的更多相关文章
- 如何在SAP C4C里使用ABSL消费第三方Restful API
首先我们得有一个可以正常工作的Restful API: 然后在Cloud for Customer的Cloud Application Studio里创建Restful API的模型,把第一步可以正常 ...
- SAP CRM里Lead通过工作流自动创建Opportunity的原理讲解
(1) 在SAP CRM里创建一个Lead后,会观察到有一个Opportunity自动生成,这是通过什么后台逻辑实现的呢? 检查前台日志或者后台事务码SLG1,发现有很多属于用户WF-BATCH的日志 ...
- Visual Studio 2010中创建ASP.Net Web Service
转自:http://blog.csdn.net/xinyaping/article/details/7331375 很多人在论坛里说,在Visual Studio 2010中不能创建“ASP.Net ...
- (转)在 Visual Studio 2010 中创建 ASP.Net Web Service
很多人在论坛里说,在Visual Studio 2010中不能创建“ASP.Net Web Service”这种project了,下面跟帖者云云,有的说这是因为微软已经将Web Service整合进W ...
- 【转载】在 Visual Studio 2012 中创建 ASP.Net Web Service
在 Visual Studio 2012 中创建 ASP.Net Web Service,步骤非常简单.如下: 第一步:创建一个“ASP.Net Empty Web Application”项目 创建 ...
- 使用nodejs代码在SAP C4C里创建Individual customer
需求:使用nodejs代码在SAP Cloud for Customer里创建Individual customer实例. 代码: var createAndBind = require('../je ...
- 使用nodejs消费SAP Cloud for Customer上的Web service
Jerry在公众号文章C4C和微信集成系列教程里曾经使用nodejs去消费C4C提供的标准webservice. 看一个具体例子:C4C里Individual Customers可以维护Social ...
- 在 Visual Studio 2010 中创建 ASP.Net Web Service
第一步:创建一个“ASP.Net Empty Web Application”项目 第二步:在项目中添加“Web Service”新项目 第一步之后,Visual Studio 2010会创建一个仅含 ...
- 如何在SAP CRM WebClient UI里创建HANA Live Report
1. 使用业务角色ANALYTICSPRO登录WebClient UI: 2. 点击新建按钮: 为新建的报表分配一个HANA Live Query: 指定Query的参数: 上图WebClient U ...
随机推荐
- [转] 利用CORS实现跨域请求
[From] http://newhtml.net/using-cors/ 跨域请求一直是网页编程中的一个难题,在过去,绝大多数人都倾向于使用JSONP来解决这一问题.不过现在,我们可以考虑一下W3C ...
- Selenium => Debugging “Element is not clickable at point” error
[From] http://stackoverflow.com/questions/11908249/debugging-element-is-not-clickable-at-point-error ...
- Python入门笔记——(1)数字与表达式
一.算术运算 整除:// 取余:% 乘方:** (a ** b = pow(a, b)) 十六进制表示:0x...,八进制表示0... round(x [, n]):对x从小数点第n位取四舍五入结果, ...
- maven-javadoc-plugin
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javad ...
- Java 不可变对象
不可变对象(immutable objects):一旦对象被创建,它们的状态就不能被改变(包括基本数据类型的值不能改变,引用类型的变量不能指向其他的对象,引用类型指向的对象的状态也不能改变),每次对他 ...
- Html练习 | 小影志首页练习
<!DOCTYPE html> <head> <title>小影志首页练习</title> <style> /*应用全页字体*/ .pg-f ...
- 成功配置TOMCAT的LOG4J日志系统,格式:HTML+每天以YYYY-MM-DD.LOG命名的日志文件
关于log4j.properties文件在web项目中放的位置,找过很多,最后实践结果是: 一.web项目 二.放在src的目录里面,然后项目生成后会自动在\WEB-INF\classes文件里有份l ...
- 第十五章:集成JPUSH
如果不想自己搭建push server,则可以借助于第三方的api来实现push的功能,本文主要介绍ionic如何集成jpush. 具体步骤如下: 创建ionic应用:ionic_jpush. 申请j ...
- git代码管理工具-SourceTree 使用介绍
一.SourceTree 简单说明 SourceTree 是git 代码管理的可视化工具,可省去操作命令行的一个图形化工具,下载地址:https://www.sourcetreeapp.com/ 二. ...
- HRBUST 1161——Leyni——————【线段树单点更新,区间查询】
Leyni Time Limit: 3000 MS Memory Limit: 65536 KB 64-bit integer IO format: %lld , %llu Java class na ...