cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway service with multiple entity sets

Former Member
0 Kudos

Hi,

I have designed a Gateway service with 3 entities, and 3 entity sets.Entity sets are not related one to another. This entity sets correspond to static data stored in 3 different custom table in SAP. The aim of this service is to provide static data (but customizable on the backend) for drop down lists on a SAP UI5 application consuming Gateway services.

I am wondering if it is possible through a single read operation, to retrieve all entity sets. Since the service URL to get data related to one entity set is /sap/opu/odata/sap/ZTEST_SERVICE_SRV/EntitySet, how should I process if I want to retrieve all 3 entity sets ? Is it something possible or do we have to call each entity set at once ?

Thanks in advance for your help.

Thibault

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Thibault,

there are 2 options.

1. You can use $batch. This way one HTTP request would be send that would contain the three requests you showed.

2. Create a fourth entity type and entity set called for example valuehelps. For this you can create associations to the three entity sets you mentioned and you could use $expand.

Best Regards,

Andre


Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Adding to Andreas' reply.


Other option is to have a single entity for all three search helps.

That would contain following properties,

     -     'Search Help Identifier'  - To determine which of three custom tables to fetch from

     -     key

     -     description

If no  'Search Help Identifier'  is passed, you can pass all three set of search help values.

Former Member
0 Kudos

Hi Krishna,

I'd try and avoid a construct like this because I don't think it's very compliant or discoverable - you have to know how to access it. That's maybe acceptable for "internal" services, but really, we should try and use the protocol instead of introducing so many workarounds.

It seems that the simplicity of OData on some levels makes people think they have got the wrong answer. It can get complex but something like a value list is pretty basic and shouldn't be subject to loads of different interpretations.   

Batching GET's on the entities or using a grouping entity as per Andre's suggestion is what I'd be thinking of doing. I know that the former is used by some Fiori applications.

Regards

Ron.

sreehari_vpillai
Active Contributor
0 Kudos

Hi Ron,

Could you please share any examples for the $batch.

Sreehari

AshwinDutt
Active Contributor
0 Kudos

This message was moderated.