SAP Knowledge Base Article - Public

2802329 - "Invalid Token Detected" Error When Performing a Filter in Odata Query


When performing an Odata query with a filter defined for a text field, the following error message is returned:

Invalid Token Detected at Position X (where X represents the position of a character from the query)


SAP Cloud for Customer.

SAP Business ByDesign.

Reproducing the Issue

Perform a query using an Odata URL, and defining a filter for a text field. For example:$filter=Email eq "abc'"


You are using a special character such as single or double quote (' or ") in the field value. As the Odata API uses these characters to limit the begin and the end of the values to be filtered, they are not properly handled by the system, causing the error.


Perform the query suppressing the special character. In the example above mentioned in the Reproducing the Issue section, the e-mail of the filter should be inserted as "".

The Odata API is capable of identifying the value even without the special characters.


 OData, Invalid Token Detected, Custom OData, Error, characters. , KBA , AP-RC-ODF , OData framework (C4C Only) , AP-RC-ODF-BYD , OData Framework and Console (ByD) , How To


SAP Business ByDesign all versions ; SAP Cloud for Customer add-ins all versions