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

Odata collection to entity navigation

$
0
0


Hi Guys,

 

I am very new to odata and recently i am looking at a requriement that goes something like this (using sflight as example). It needs to returns records from sflight and it also need to able to return a txt file which contains records from sflight.

 

So i created a entity type of Sflight which contains all the properties from the sflight table, then i created an entity of DataFile of media source type to enable the download of the txt file.

 

According to sap odata book, navigation can be from collection/entity to collection/entity, so i am trying to create M to 1 navigation from collection of Sflight to single Datafile entity. So that i can use $filter at the Sflight collection and pass it to DataFile for file generation.

 

But i can't seem to find out how to do that.

 

1. Any one got an example on how to create a navigdation from collection to single entity? When navigation is triggered, the get_entity method of DataFile is triggered, but i wont be able to get the list of Sflight that i need to generate the txt file.

 

2. Is there a way to use media source at collection level in stead of entity level?

 

3. Any other sugguestion to this requirement is most welcome? but i try to use media source instead of returning edm.binary.

 

thanks


Viewing all articles
Browse latest Browse all 2823

Trending Articles