Hi,
I have some difficulties with some queries not respecting the metadata, and would really like to figure out what did I missed, as documentation suggest the queries are correct and I didn't found any working examples.
My current work is to parse the edm metadata to provide the basis of an in-site drag-and-drop editor interface for a website. For testing I use the samples provided by SAP on sapes1.sapdevcenter.com, as created by SAP experts it's be the best source available.
Unexpected result with sap:requires-filter
In sample service ZCD204_EPM_DEMO_SRV all EntitySets has the "sap:requires-filter" flag.
To create a table of the datas, we need to know which are the mandatory filters to be able to fill the table, and the edm itself does not provide any information about that.
In document SAP Annotations for OData Version 2.0 (I didn't found version 1.0, but i assume it's backward compatible, as not said explicitly not), it sais, if sap:requires-filter is true and no $filter is in query, result will be an error describing what is the minimal filter. Instead I have a valid result-set, without using filters (ie: BusinessPartners) OR a HTTP400/Bad Request error saying the entity set does not exists (SalesOrders).
What did I missed? Is there alternative ways to find out the minimal filters (preferably in one query for multiple EntitySets)?
Available options for field which trivially represent enum /select types.
In same metadata: BusinessPartner.AddressType probably is an enum, even more as the values for this table are "02", but it is saved as string, probably as it would be hard to explain edm.
How to query the service to get available options?
On a similar issue: RMTSAMPLEFLIGHT's FunctionImport GetAvailableFlights has parameters cityform and cityto. As probably there is a very limited set of available targets, how can you query distinct set like sql's "select distinct FligtDetails.cityfrom from Flights"?
As for conclusion of above:
- Does the metadata (service description) not match the service?
If so:
- How to decide if a service's metadata is reliable? (Validation of service's structural integrity.)
- Which other ways are to get the service's real description from client side? (Maybe queries like sql's "show tables", "show create table" etc.)
I appreciate any guidelines.