Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

Dynamic entity structure in the Odata service

$
0
0

Most of the time you will need a flexible Odata entity structure. For example, for adding customer fields or providing only fields which would be displayed in customer scenario.

 

I found this example from Aron for Media Links: http://scn.sap.com/docs/DOC-44864

But if you need it not for Stream media, but for old good abap tables, please have a look at some additional steps below:

 

1. You have to perform all steps as described by Aron (except redefining Model and Data provider class methods).

In our example, we will create model with two fields (CARRID and PLANETYPE) from SFLIGHT table:

 

2. Redefine method Define of model provider class as shown below:

001.png

3. Redefine method GET_ENTITYSET of Data provider class as shown below:

002.png

 

Now execute your service adding /Flights and you will see flights data:

Flights.PNG

 

With this, you could already build flexible Odata structure. Enjoy!


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>