Symptom
While creating a custom Odata service, the customer cannot make filtering work. When running the Odata test, it does not respect the filter.
Environment
SAP Cloud for Customer.
Reproducing the Issue
- Go to the Administrator WOC.
- Open the Odata Services view.
- Select the custom Odata Service.
- In the Customer collection, select the desired fields. Let's say the “Changed in” field. Checking the “filter” option.
- Inform in the field “default value” any filter that you want and save the Odata.
Cause
Default value are only relevant for Create (POST) calls. i.e. if data is not provided then pick the default value.
Default value with hidden_in_edm makes a value constant which is applicable for Read too, but that is only available for code or boolean fields.
In the Odata service modeler (editor) where there is an option to provide the default values, if the property is of boolean or code type, then another option to mark it hidden_in_edm is also available.
Hide in metadata means - since the value has a default value expected to behave as a constant value, there is no need to show in metadata.
Such property will be considered for READ or POST always. But if the property has only default value - then it will be considered only during POST if explicitly no data is sent in payload.
Resolution
This feature is not supported in the current release of SAP Cloud for Customer.
1. If you are a partner: please use cloudsolutionpartner@sap.com or the Partnerfinder
2. If you are a customer:
- Contact your Account Executive.
- Check the link for SAP Advisory Services.
An alternative option may be to check the SAP Cloud for Customer - Customer Influence to submit an idea:
Keywords
Custom; odata; service; filter; filtering; , KBA , LOD-CRM-INT-API , OData API (C4C Only) , Product Enhancement