如何在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.

  1. 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".

  1. start the web service creation wizard:

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

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

click tab WSDL, write down your WSDL link:

  1. 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

  1. tcode SE80, create a new service consumer:

  2. 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.

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

create a new logical point:

  1. 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:

  1. 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的原创文章,请关注公众号"汪子熙":

原文地址:https://www.cnblogs.com/sap-jerry/p/10053310.html

时间: 2024-08-01 08:55:08

如何在SAP CRM里创建和消费Web service的相关文章

在 Visual Studio 2010 中创建 ASP.Net Web Service

第一步:创建一个“ASP.Net Empty Web Application”项目 第二步:在项目中添加“Web Service”新项目 第一步之后,Visual Studio 2010会创建一个仅含一个站点配制文件(Web.config)的空站点,其余的什么也没有. 我们在Visual Studio 2010的Solution Explorer中,选中当前的这个project,添加新项目(右键菜单:Add --> New Item),选择“Web Service”这种类型: 看到这里读者应该就

如何在SAP CRM WebClient UI里创建HANA Live Report

1. 使用业务角色ANALYTICSPRO登录WebClient UI: 2. 点击新建按钮: 为新建的报表分配一个HANA Live Query: 指定Query的参数: 上图WebClient UI选择的参数都定义在HANA studio里: 给报表添加属性: 添加measure: 之后报表即可在WebClient UI里成功渲染: 并且也能在CRM Fiori的Customer Report应用里看到该report. 如果想获得更多关于上图提到的Fiori应用,请查看我的公众号文章 SAP

如何在Marketing Cloud里创建extension field扩展字段

首先在Marketing Cloud里找到创建扩展字段的tile入口,搜索关键字extension: 这会进入Fiori应用"Custom fields",能看到系统里所有创建好的extension field.点击+加号按钮新建一个: 维护这个扩展字段的技术信息,比如标签,类型,长度等等. 创建好之后点击按钮Publish,确保字段处于publish状态. 接下来需要为特定的UI enable这个字段的显示.在标签页UIs and Reports里,在对应的UI记录后点击按钮&quo

如何阻止SAP CRM订单创建好之后,自动被置为传输状态这一行为

AG9 Service order创建好之后,要自动通过middleware传其他系统去,这个behavior我们现在记录下来了么?知道怎么disable不? Transaction的status profile上可以配这么一个东西: 但是我们现在的ZSRV上没有配任何status profile- line 325的function module会负责通过outbound queue往外发, 只有当line 321的IF里的三个条件同时满足才会进入: 条件1: IV_NO_BDOC_SEND

如何在Hybris commerce里创建一个media对象

进入backoffice的Media中心, 首先新建一个文件夹,用于存放即将创建的media对象: 取名为jerryimage: 然后创建一个新的media对象,取名jerryproductimage: 上传图片: 选择这个media对象存放的文件夹: 从staged catalog同步到online catalog: 同步成功: 要获取更多Jerry的原创文章,请关注公众号"汪子熙": 原文地址:https://www.cnblogs.com/sap-jerry/p/11791282

SAP CRM WebClient UI和Fiori UI混搭并存

SAP CRM里有个功能可以创建HANA live report,消费HANA Studio里创建的模型. 最后创建好的report长这个样子: 具体创建步骤可以参考我的博客Step by Step to create HANA live report in Webclient UI 这些report肉眼上看去显示在WebClient UI里,而WebClient UI似乎不能这么灵活的显示这些风格特异的图标.这是怎么实现的呢? 红色方框里的UI区域实际上是一个UI5应用: Webclient

使用JAX-RS创建RESTful Web Service

http://blog.csdn.net/withiter/article/details/7349795 本章介绍REST架构.RESTful web service和JAX-RS(Java API for RESTful Web Service,JSR 311).JAX-RS的参考实现Jersey实现了对JSR 311中定义的注解的支持,使得使用Java编程语言开发RESTful web service变得简单.如果是使用GalssFish服务器,可以使用Update Tool安装Jerse

使用Spring创建满足RESTful规范的Web Service

原文:http://spring.io/guides/gs/rest-service/ 这个指南讨论如何使用Spring的RESTful web service来创建一个"hello world"程序. 示例功能简介 使用以下方式的HTTP GET请求来访问这个Service: http://localhost:8080/greeting 使用下面greeting的JSON描述来响应这个请求: {"id":1,"content":"He

sharepoint 2010 创建自定义的ASP.NET Web Service (上)

项目背景 根据客户需求在SharePoint 2010 中创建自定义的ASP.NET Web Service可以分为3种方式(我所知道的).废话少说,下面一一列举: 创建方式 MSDN 官方博客自己的一个创建ASP.NET Web Service.http://msdn.microsoft.com/zh-cn/library/ms464040(v=office.14).aspx 但是它不推荐这种方式. 通过创建类库项目,使类库项目包装webservice. MSDN推荐使用的方式,通过WCF创建