RFCまたはBAPIを使用してODataサービスを作成する方法
1. Go to Service Gateway builder and the transaction to it is SEGW.
2. In the create project window, enter the Project name and Description. In the Attributes section leave with defaults and provide then choose the package name. Hit OK button to proceed further.
3. After entering the OK button, you can see the project got created in Gateway service builder. All the nodes in the project are empty. Our next step will be creating the Entity Types and Entity Sets required for the OData service.
4. We are using BAPI “BAPI_EPM_PRODUCT_GET_LIST” to get the list of products, so here we need the Entity Type structure which is similar to the structure BAPI_EPM_PRODUCT_HEADER in the BAPI. To create Entity Type : right click on Data Model → Import → RFC/BOR Interface.
5. In the Create Entity Type window, enter the Entity Type Name.
- Under Data Source Attributes section choose Type as : Remote Function Call and Name as the BAPI name – BAPI_EPM_PRODUCT_GET_LIST.
- Under Target System section – ♦ choose “Local” if your deployment is Embedded ♦ choose “Remote” if your deployment is Hub.
- Select the check box Create Default Entity Set, if you want the Entity Set to be create automatically.
6. Click on Next to proceed to step 2 of Entity Creation wizard. In this step choose the fields you want to be displayed in the service. Here we have selected PRODUCT_ID, CATEGORY, NAME, DESCRIPTION, SUPPLIER_NAME, PRICE and CURRENCY_CODE fields from the structure HEADERDATA[].
7. Hit Next button to navigate the step-3. In this step we need to choose the Key Field in the Entity Type which is mandatory. Choose ProductId is the key field by selecting the check box in the column “Is Key”. Hit Finish button to complete the Entity Type creation process.
8. Now we have created Entity Type – ProductList and Entity Type sets – ProductListSet.
9. Save and generate the service to create run-time artifacts.
10. By now we have modeled the service, out next step is to map the service to the BAPI to get the data. To do so go to and expand “Service Implementation” node. Expand the ProductListSet entity set , choose GetEntitySet(Query) and right click on it and then go to “Map to Data Source”.
11. In the Map to Data Source window, choose Local as Target System if your deployment is Embedded (or) Remote if your deployment is Hub.
12. In the next step, you need map the BAPI fields to the service entity type fields. Hit Propose Mapping button to automatically the map the fields or you can manually drag drop the fields from the right to the column “Data Source Parameter“.
13. Save and regenerate the service, by hitting generate button.
14. By this we have completed building the service, our next task is to register the service and test the service. We are going to discuss these steps here as i have explained in detail here OData Service Registration.
15. Test the service by using the transaction /IWFND/GW_CLIENT.
So we have successfully created OData service using RFC/BAPI. Hope this tutorial help you.
原文地址:https://www.cnblogs.com/yjyongil/p/11039052.html
- 损失函数详解
- 排查Java的内存问题
- 使用两种方法让 ASP.NET Core 实现遵循 HATEOAS 结构的 RESTful API
- 设计模式六大原则(5):迪米特法则
- Selenium2+python自动化61-Chrome浏览器(chromedriver)
- 区块链可以减少社会不平等吗?
- 【干货】不止准确率:为分类任务选择正确的机器学习度量指标(附代码实现)
- python爬虫beautifulsoup4系列1
- 区块链入门教程
- python爬虫beautifulsoup4系列2
- python爬虫beautifulsoup4系列3
- 多元回归模型
- C++ STL之min_element()与max_element()(取容器中的最大最小值)
- RESTful API 设计最佳实践
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- PHP模版引擎原理、定义与用法实例
- python如何查看安装了的模块
- Linux下源码包安装Swoole及基本使用操作图文详解
- python实现简易版学生成绩管理系统
- PHP中localeconv()函数的用法
- 解决pytorch多GPU训练保存的模型,在单GPU环境下加载出错问题
- PHP数据对象映射模式实例分析
- Pytorch 解决自定义子Module .cuda() tensor失败的问题
- PHP异常类及异常处理操作实例详解
- PHP面向对象程序设计(OOP)之方法重写(override)操作示例
- Python3与fastdfs分布式文件系统如何实现交互
- PHP判断是否微信访问的方法示例
- Pytorch损失函数nn.NLLLoss2d()用法说明
- python实现学生成绩测评系统
- Python dict的常用方法示例代码