SAP Knowledge Base Article - Public

3842628 - OData filter error in Custom Services

Symptom

  • When searching or filtering records by a displayId field in an SAP Sales Cloud and SAP Service Cloud, Version 2 (SSv2) Custom Service UI backed by an SAP CAP (OData v4) backend, the following error is returned:
Parsing URL failed at position 65: Expected "(", "eq", "ge", "gt", "in", "le", "lt", or "ne" but "s" found.
  • The error occurs on any search or filter action that targets the displayId field through the Custom Service.

Environment

  • SAP Sales Cloud and SAP Service Cloud, Version 2
  • SAP Cloud Application Programming Model (SAP CAP) as the backend service

Cause

  • The Custom Service metadata has apiStyle set to REST on one or more API definitions.
  • When apiStyle is REST, SSv2 generates a non-standard filter operator sw (starts with) for search queries.
  • SAP CAP only supports standard OData v4 filter syntax and does not recognise the sw operator, causing the parsing error.

Resolution

Set apiStyle to OdataV4 on all API definitions in the Custom Service metadata. SSv2 will then generate valid OData v4 filter functions (startswith(), contains()) that SAP CAP can process correctly.

Steps

  1. Export the metadata JSON from SSv2 Custom Services.
  2. For each entry in the apis array, change:
    1. "apiStyle": "REST" to "apiStyle": "OdataV4"

  3. Re-upload the updated metadata JSON to SSv2 Custom Services.

Keywords

apiStyle, REST, OdataV4, sw operator, OData v4 filter, displayId, Custom Services, CAP backend, parsing URL failed, filter operator, startswith, contains , KBA , CEC-CRM-CZM-EXT , Extensibility for SAP Sales/Service Cloud , Known Error

Product

SAP Sales Cloud and SAP Service Cloud Version 2 all versions