Quantcast
Channel: Visual BI Solutions
Viewing all articles
Browse latest Browse all 989

SAP NetWeaver Gateway – OData Service Optimization using Deep Insert

$
0
0

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
 

SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 1

Header


 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 2

Item


 
3. Create Association and Navigation between Header and Item
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 3

Association


 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 4

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)
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 5
 
5. Create Structure for Deep Entity in Model Class (MPC_EXT). Item must be defined using Navigational property name.
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 6
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 7
*item should have same name as navigation property
 
6. Re-Implement DEFINE method in Model Class (MPC_EXT)
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 8
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 9

Binding Deep Structure


 
7. Create Custom method in Data Provider Class (DPC_EXT) and implement the logic as required.
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 10
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 11
 
8. Get the requested Header and Item data using method
IO_DATA_PROVIDER->READ_ENTRY_DATA
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 12
 
9. Re-Implement Deep Insert method (CREATE_DEEP_ENTITY) in Data Provider Class (DPC_EXT) and call custom method.
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 13
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 14
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 15
 
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.
 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 16
 
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.
 

SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 17

Json Input


 
SAP NetWeaver Gateway – Odata Service Optimization using Deep Insert - 18

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.


Viewing all articles
Browse latest Browse all 989

Latest Images

Trending Articles



Latest Images