This blog will focus on techniques & methods to optimize OData Services implementations within SAP Netweaver Gateway 2.0.
While developing a transactional Fiori application, there is a need to create header line and its corresponding line item details. This requires multiple back-to-back calls to the model, thereby negatively affecting the response time & performance of the application.
This process can be optimized by using Deep Insert Methods.
Deep Insert can be used to POST Nested structure of feeds to the backend system and reduce the number of OData Calls made to the SAP Gateway Server
How to implement it?
1. Create Project in SAP NetWeaver Gateway system using SEGW
2. Create Header and Item Entity Types and Entity Sets

Header

Item
3. Create Association and Navigation between Header and Item

Association

Navigation
Notes: Navigation name will be used in deep structure
4. Now generate runtime objects and it will create 4 classes (2 for Model and 2 for Data Provider)

5. Create Structure for Deep Entity in Model Class (MPC_EXT). Item must be defined using Navigational property name.


*item should have same name as navigation property
6. Re-Implement DEFINE method in Model Class (MPC_EXT)


Binding Deep Structure
7. Create Custom method in Data Provider Class (DPC_EXT) and implement the logic as required.


8. Get the requested Header and Item data using method
IO_DATA_PROVIDER->READ_ENTRY_DATA

9. Re-Implement Deep Insert method (CREATE_DEEP_ENTITY) in Data Provider Class (DPC_EXT) and call custom method.



Coding Part is done, now we will proceed for testing.
Testing
1. Go to Transaction /IWFND/GW_CLIENT and call the OData URI with Header Entity Set.

Since it’s POST, Input should be given while executing call.
Input Script (Json Format):
Navigational property name should be used to post the values for Item.

Json Input

Result
Note the reduced number of OData Calls made to the SAP Gateway Server
Want to know more? Click here to contact us.
Subscribe to our Newsletter
The post SAP NetWeaver Gateway – OData Service Optimization using Deep Insert appeared first on Visual BI Solutions.







