on 07-11-2014 2:12 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.