Skip to Content
Author's profile photo Denis Tislenko

Dynamic entity structure in the Odata service

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:

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:


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


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


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

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.