SAP Knowledge Base Article - Public

3738841 - Equals filter on custom field returns no results in enterprise project api/app - s/4hana cloud public edition

Symptom

You have created a custom field and populated it on an enterprise project.
Then you detected that filtering by the custom field using equals in the "Project Control – Enterprise Projects" app or API returns no records.
Using contains for the custom field returns the expected project.

Environment

SAP S/4HANA Cloud Public Edition

Cause

We found two formats stored for the custom field in the CDS view:
'000XXXXX49' (10-character, leading zeros)
'XXXXX49' (7-character, no leading zeros)
Because of this inconsistency, condition eq may not return the expected record. 

Resolution

As a workaround, you could use the following request avoiding the eq issue:
…/sap/opu/odata/sap/API_ENTERPRISE_PROJECT_SRV;v=0002/A_EnterpriseProject?$filter=(startswith(YY1_CustomFieldName,'XXXXX49') and endswith(YY1_CustomFieldName,'XXXXX49') &$format=json&$inlinecount=allpages

See Also

Keywords

enterprise project api, odata filter eq, code list custom field, cds view, leading zeros, project control enterprise projects, empty response, equals filter fails, contains filter works, inconsistent value padding, startswith, endswith, custom field filtering, project filtering, value help , KBA , PPM-SCL-STR , Project Structure (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions