As mentioned in the introductory article SAP OData Development Tutorial - From Getting Started to Upgrading (including SEGW, RAP and CDP) , SAP OData service development, technically speaking, can be divided into three categories. Therefore, this tutorial is also divided into three parts, which will be introduced separately. This article is the article directory for this tutorial.
About the Author
Jerry Wang, joined the SAP Chengdu Research Institute after graduating from the University of Electronic Science and Technology of China with a master's degree in computer science in 2007. Jerry is a SAP Community Mentor and a SAP China Technology Ambassador. In his 15-year career in SAP standard product development, Jerry has participated in the research and development of standard products such as SAP Business ByDesign, SAP CRM, SAP Cloud for Customer, SAP S/4HANA, and SAP Commerce Cloud (e-commerce cloud).
Jerry has in-depth research on the development, testing, publishing, deployment, testing of SAP OData services, as well as the behind-the-scenes technical implementation details and usage scenarios of OData services based on various SAP technologies.
Development tutorial based on SEGW - Gateway Service Builder
- 1. Create a SAP OData project in the SAP ABAP transaction code SEGW
- 2. Configure and test the OData service created by the transaction code SEGW in the SAP ABAP system
- 3. How to use the SAP ABAP OData service diagnostic tool/IWFND/ERROR_LOG
- 4. Implementation Guide for GET_ENTITYSET Method of SAP ABAP OData Service Data Provider Class
- 5. How does the SAP ABAP OData service support the $filter operation
- 6. Use Postman tool to efficiently manage and test SAP ABAP OData service
- 7. How does the SAP ABAP OData service support the $orderby (sort) operation
- 8. How does the SAP ABAP OData service support the Create operation
- 9. How does the SAP ABAP OData service support the Delete operation
- 10. How does the SAP ABAP OData service support the update (Update) operation
- 11. Use HTTP PUT, PATCH and MERGE request to consume SAP ABAP OData service modification operation implementation and its differences
- 12. How does SAP ABAP OData service support $select to selectively read only part of model field values
- 13. Implementation of paging loading datasets for SAP ABAP OData service (Paging)
- 14. Introduction of performance evaluation and testing tools for several SAP ABAP OData services
- 15. Difference between EntityType and EntitySet in SAP ABAP OData service
- 16. How to modify SAP ABAP OData model to support $expand operation
- More articles are being written, so stay tuned
Develop OData services using the Restful ABAP Programming model (RAP for short)
- Currently writing, stay tuned
Develop OData services using the SAP Cloud Application Programming programming model
- Currently writing, stay tuned
@[toc]
Application scenarios of $expand operation in OData service
The OData model creation we have completed so far in this step has only one node, Book. In the actual project, the OData model is much more complicated than the model designed for teaching purposes in our tutorial.
For example, the following figure is the OData model of the SAP CRM My Opportunities Fiori application. You can see that the model root node Opportunity can navigate to other child nodes, for example, through the Navigation Properties(导航属性)
which we will learn in this step, from the root node Opportunity Departure, you can navigate to other child nodes. For example, the yellow Products in the figure below is one of the navigation properties. Through this field, you can navigate to all the Products data contained in the Opportunity.
This navigational affiliation between Opportunity and Products is also reflected in the UI of the Fiori application. My Opportunity is a Fiori application. The detail page of Opportunity has several Tab pages. Starting from the second tab page, each tab page corresponds to a child node of the Opportunity OData model. Take the Products tab in the following figure as an example, the data it contains is technically obtained by navigating to the OData model sub-node Products through the Opportunity root node and using the Navigation Property of Products.
We open the Chrome Developer Tools network tab and find an HTTP request url:
GET Opportunities(guid'FA163EE5-6C3A-1ED6-9DC1-C10749724C39')?$expand=Competitors,Products,OpportunityLogSet HTTP/1.1
In this url, not only the data of the Opportunity root node whose guid is FA163EE5-6C3A-1ED6-9DC1-C10749724C39
is requested, but also the $expand
operation defined by the OData protocol, 在同一个 HTTP 请求里
For example, Competitors
, Products
and other data are retrieved together.
It can be seen that the OData protocol $expand
, its function is to retrieve the root node together with the child node data specified by the Navigation Property in the same HTTP request, thereby reducing the need to achieve the same data reading The number of HTTP requests spent for the purpose.
Here are the specific steps on how our own OData service supports $expand
operations.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。