cancel
Showing results for 
Search instead for 
Did you mean: 

query results does not match $metadata

Former Member
0 Kudos

Hi,

I have some difficulties with some queries not respecting the , 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 (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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Janos,

Although things are improving, there is generally no enforcement of the filter rules established in the service metadata - this a deficiency in the Gateway engine in my view. If a metadata document can be thoroughly checked for element types, etc, why can't the same be done for filters and addressability?

If an entity is marked as 'requires filter' but no filter is actually implemented, you can waste a lot of time trying to discover the filter pattern!

The bottom line is, if you are building the service yourself, you put in the logic for filter patterns you have designed. If you are using a published service and there is no documentation available, the only way to determine if a filter is actually supported is to experiment or examine the provider model code.

regards

Ron.   

Former Member
0 Kudos

Hi Ron,

yes, I have the same option. The doc actually describes sap:required-in-filter and sap:filter-restriction annotations (i'm not sure if it was in older versions as well), but I never saw any example or metadata that would use that.

Well, this would be a client-side-program, so it consumes and depends on metadata (or an alternative source/method), with only http access to the service.

Thanks,

János