当前位置:网站首页>OData - API using SAP API hub in SAP S4 op
OData - API using SAP API hub in SAP S4 op
2022-06-27 22:46:00 【Tab Zhu】
I've been studying recently BTP, I saw SAP API Hub There are many, many ready-made API, So I thought of using them in my own OP On , To achieve the purpose of using rapid development
stay SAP S4 OP Use in SAP API Hub Of API
First let's open up SAP API Hub - SAP API Business Hub(api.sap.com), Click on APIs
choice OData V2, Enter... In the right search box Purchase order( If you need anything else API Please modify )
Select first API Click on , stay Overview Interface selection EDMX download
stay S4 OP End SEGW Create a... In the transaction Project
Right click selection Import->Data Model from File
Choose the downloaded API file
Click on Finish, And then click Generate Generate
Generate the corresponding class
Next we ZCL_ZTAB_API_PO_PROCES_DPC_EXT double-click
Click on the way -> Inheritance method , choice A_PURCHASEORDER_GET_ENTITYSET redefinition
Then simply write a get PO Code of order information , Save activation
DATA lt_purchaseorder TYPE
zcl_ztab_api_po_proces_mpc=>tt_a_purchaseorderitemtype.
DATA ls_purchaseorder LIKE LINE OF lt_purchaseorder.
SELECT a~ebeln,b~ebelp,b~werks,b~matnr,b~menge,b~meins
FROM ekko AS a
INNER JOIN ekpo AS b ON b~ebeln = a~ebeln
INTO TABLE @DATA(lt_ekpo)
UP TO 5 ROWS.
IF sy-subrc EQ 0.
LOOP AT lt_ekpo INTO DATA(ls_ekpo).
ls_purchaseorder-purchaseorder = ls_ekpo-ebeln.
ls_purchaseorder-purchaseorderitem = ls_ekpo-ebelp.
ls_purchaseorder-material = ls_ekpo-matnr.
ls_purchaseorder-plant = ls_ekpo-werks.
ls_purchaseorder-purchaseorderitem = ls_ekpo-ebelp.
ls_purchaseorder-orderquantity = ls_ekpo-menge.
ls_purchaseorder-purchaseorderquantityunit = ls_ekpo-meins.
APPEND ls_purchaseorder TO lt_purchaseorder.
CLEAR ls_purchaseorder.
ENDLOOP.
ENDIF.
CHECK lt_purchaseorder IS NOT INITIAL.
et_entityset = lt_purchaseorder. To transaction code /n/iwfnd/maint_service, Click Add Service
We enter the system alias ( Because it was created OData The service is packaged locally , So the input LOCAL), And then do the screening , Choose services , Click add selected service
Select the package directly , Then make sure , Load service
Return to the service maintenance interface : We can see that the service has been added to it
We can click SAP Gateway To test , Click on EntitySets, Select the method we just redefined Set
Click on the perform , We can see PO The data has been retrieved
The copy address opens in the browser , You can also view the returned Json
边栏推荐
- PHP connects to database to realize user registration and login function
- Azure Kinect DK 实现三维重建 (PC非实时版)
- 从学生到工程师的蜕变之路
- 扁平数组和JSON树的转换
- [microservices] (16) -- distributed transaction Seata
- 中金证券经理给的开户链接办理股票开户安全吗?我想开个户
- Where can I set the slides on the front page of CMS applet?
- Golang uses regularity to match substring functions
- [MySQL practice] query statement demonstration
- 使用sqlite3语句后出现省略号 ... 的解决方法
猜你喜欢

go语言切片Slice和数组Array对比panic: runtime error: index out of range问题解决

Solve the problem that the virtual machine cannot be connected locally

Exclusive interview with millions of annual salary. What should developers do if they don't fix bugs?

这类人开始被VC疯抢,月薪8万

Penetration learning - shooting range chapter - detailed introduction to Pikachu shooting range (under continuous update - currently only the SQL injection part is updated)

Livox Lidar+海康Camera 基于loam的实时三维重建生成RGB彩色点云

Educational Codeforces Round 108 (Rated for Div. 2)

结构化机器学习项目(一)- 机器学习策略

Livox Lidar+APX15 实时高精度雷达建图复现整理

netERR_CONNECTION_REFUSED 解决大全
随机推荐
Structured machine learning project (I) - machine learning strategy
PCIe knowledge point -008: structure of PCIe switch
【微服务】(十六)—— 分布式事务Seata
这类人开始被VC疯抢,月薪8万
Mysql database experiment report (I)
同花顺炒股软件可靠吗??安全嘛?
OpenSSL programming I: basic concepts
MySQL数据库 实验报告(一)
The problem of minimum modification cost in two-dimensional array [conversion question + shortest path] (dijkstra+01bfs)
医美大刀,砍向00后
[microservices] (16) -- distributed transaction Seata
Zabbix6.0升级指南-数据库如何同步升级?
Consumer finance app user insight in the first quarter of 2022 - a total of 44.79 million people
How to use RPA to achieve automatic customer acquisition?
扁平数组和JSON树的转换
Penetration learning - shooting range chapter -dvwa shooting range detailed introduction (continuous updating - currently only the SQL injection part is updated)
Beijing University of Posts and Telecommunications - multi-agent deep reinforcement learning for cost and delay sensitive virtual network function placement and routing
mysql中一对多关联,获取多表中最新一条数据
初识C语言 第二弹
Codeforces Round #717 (Div. 2)