如何在SAP ABAP系统里创建和消费Web Service-阿里云开发者社区

开发者社区> jerrywangsap> 正文

如何在SAP ABAP系统里创建和消费Web Service

简介: 如何在SAP ABAP系统里创建和消费Web Service
+关注继续查看

This document could be used as guide for beginners to learn and use ABAP web service.


How to create web service provider in ABAP system

The following steps demonstrates how to expose a function module as a web service provider in SAP CRM system.


(1) create a new function module to return product description by given input product ID.

Signature and source code of function module:


image.png

Make sure the FM is marked as “Remote enabled”.


image.png


(2) start the web service creation wizard:


image.png


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


image.png


(3) Once creation is finished, you would find your service definition as below:


image.png


click tab WSDL, write down your WSDL link:


image.png


(4) use tcode SOAMANAGER, click Web Service Configuration


image.png


you can find your service definition created just now:


image.png


click the hyperlink and create a new service:


image.png


For security reasons choose radio box “SSL”.


image.png


click Finish button:


image.png


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


image.png


write down this link for later usage.


image.png


How to consume web service in ABAP system

(1) tcode SE80, create a new service consumer:


image.png


(2) Choose external WSDL:


image.png


choose the url got from last step of chapter “How to create web service provider in ABAP system”:


image.png


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


image.png


(3) go back to SOAMANAGER, find the consumer proxy created in step2:


image.png


create a new logical port:


image.png



(4) Make sure you specify URL got from the last step of web service creation chapter. If you just use the URL got from SE80 in tab “WSDL”, you will meet withbelow error.


image.png


(5) consume the web service in ABAP report:

you can find the data type for input and output parameters in SE80:


image.png

Now we execute the report and get the web service execution result as expected:


image.png


The product description in UI:


image.png


How to trace the web service execution

Use tcode SRT_UTIL, add a new configuration for your user which triggers the web service call:


image.png


Set the Functional Trace to “High”. You could also enable Performance and Payload trace if necessary.

Click Save Configuration button to persist the change.


image.png


Execute the report which triggers the web service call. After it finishes, click tab “Functional Trace” and click refresh button, you should see several records for execution trace.


image.png


Double click and select the row with type “Response”, where you could find the product description value returned by service provider.



image.png


版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
如何创建SAP C4C Product list并用OData服务消费
SAP Cloud for Customer里的product list创建:
5 0
如何在Kubernetes里创建一个Nginx service
Jerry之前的文章如何在Kubernetes里创建一个Nginx应用,已经使用kubectl命令行创建了Pod,但是在kubernetes中,Pod的IP地址会随着Pod的重启而变化,因此用Pod的IP地址来访问我们部署的nginx应用不太合适。
1971 0
如何在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.
1335 0
创建新的SAP CRM product search scenario - 如何在SAP CRM里实现自定义的产品搜索场景
创建新的SAP CRM product search scenario - 如何在SAP CRM里实现自定义的产品搜索场景
9 0
+关注
2628
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载