首页 > SAP > FIORI > 在SAP中配置连接外部的ODATA数据源
2019
08-28

在SAP中配置连接外部的ODATA数据源

此例子在SAP建立一个外部的ODATA数据源,数据源为services.odata.org的http://services.odata.org/V2/(S(readwrite))/OData/OData.svc/

由于services.odata.org,的服务器现在默认连接的ODATA版本是V3(打开services.odata.org点击第个数据时去的是V3),而SAP当前系统支持的是V2版本,所以在在SM59定义连接时把”Path Prefix”设置成“/V2”而在/IWBEP/OCI_SRV_GEN定义Service Namespace 时就只输入(S(readwrite))/OData/OData.svc/就行了,,不然就会报错,

“Error while fetching the source metadata”

“Message no. /IWBEP/CM_OCI029”

How to consume external OData services in SAP Netweaver Gateway

Hello everyone, in this SAP Netweaver Gateway tutorial, we will learn how to consume external OData services in SAP Netweaver Gateway.External OData services means the service which are from 3rd party systems (or) Non-SAP systems. With OData Services Consumption and Integration (OSCI) SAP has provided the provision of consuming external services. So lets get started.

1.Supported System Version

SAP NetWeaver Gateway 2.0 SP6 or higher / SAP NetWeaver 7.40 SP2 or higher

2.Business Scenario

1.In this demo example we are going to consume Northwind OData service from

在SAP中配置连接外部的ODATA数据源 - 第1张  | 优通SAP
2. Enter the RFC Destination name and Target Host name like below and hit Save 在SAP中配置连接外部的ODATA数据源 - 第2张  | 优通SAP

在SAP中配置连接外部的ODATA数据源 - 第3张  | 优通SAP

3. Test the connection by clicking on Connection Test button in the application toolbar.You should be able to connect to the server and should see the HTTP Response code as 200 like below.

在SAP中配置连接外部的ODATA数据源 - 第4张  | 优通SAP
4. Create a System Alias for the above created RFC destination. Go to SPRO→ SAP Reference IMG and Navigate to this path : SAP Netweaver → Gateway → ODATA Channel → Configuration → Connection Settings → SAP Netweaver Gateway to SAP System → Manage SAP System Aliases.

在SAP中配置连接外部的ODATA数据源 - 第5张  | 优通SAP

5. Enter SAP System Alias name, Description, RFC Destination and Software Version. Select Local GW and For Local App check-box as well. Click on Save 在SAP中配置连接外部的ODATA数据源 - 第6张  | 优通SAP to save the entries.

在SAP中配置连接外部的ODATA数据源 - 第7张  | 优通SAP
6. Go to transaction/IWBEP/OCI_SRV_GEN-OData Service(GW) Generator for External Data Services.Enter

内容中的V3/(S(kx0cnehrreuujitfl4wuvnhn))/OData/OData.svc/http://services.odata.org中的第个可写ODATA源。也可修改为地址中的另外两个数据源。

HTTP Destination = ODATA_ORG
Service Namespace = (S(kx0cnehrreuujitfl4wuvnhn))/OData/
Service Name = OData.svc
Model Provider Class = ZCL_NORTHWIND_MPC
Data Provider Class = ZCL_NORTHWIND_DPC
Model Name = ZNORTHWIND_MDL
Service Name = ZNORTHWIND_SRV

在SAP中配置连接外部的ODATA数据源 - 第8张  | 优通SAP

7. After entering above information hit Execute button to generate the service.After successfully service generation you should see the below screen.

在SAP中配置连接外部的ODATA数据源 - 第9张  | 优通SAP
8. Our next step is to activate and register service.Go to /IWFND/MAINT_SERVICE – Activate and Maintain Services. Hit 在SAP中配置连接外部的ODATA数据源 - 第10张  | 优通SAP button to add our service.

[adsenseyu1]

9. In the below screen enter System Alias = NORTHWIND and hit Get Services button.We will get a list of services, select our service and hit Add Selected Services button.

在SAP中配置连接外部的ODATA数据源 - 第11张  | 优通SAP
10. In the Add Service popup window, check the details and hit OK button.

在SAP中配置连接外部的ODATA数据源 - 第12张  | 优通SAP
11. We have successfully registered the service,now its time to test the service.Go to transaction /IWFND/GW_CLIENT – Gateway Client. Enter the service name and execute.

在SAP中配置连接外部的ODATA数据源 - 第13张  | 优通SAP

You have successfully learned how to consume external OData services in SAP Netweaver Gateway.

Please stay tuned to us for more SAP Netweaver Gateway tutorials.Please feel free to comment and let us know your feedback. You feedback will keep us alive.

Thank you.

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,我从事SAP开发13年,其它ERP开发7年,基本都是零售行业。本站记录工作学习的过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519

留下一个回复

你的email不会被公开。