Symptom
While using API_OUTBOUND_DELIVERY_SRV with entity A_OutbDeliveryHeader to retrieve list of outbound delivery, error message "Invalid token detected at position XX" received specially when filter used in request URI.
For example, /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader?$filter=CreationDate eq datetime'2024-12-31T00:00:00' and CreationTime le time'23:59:59'
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
Method: GET
Request URI: /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=0002/A_OutbDeliveryHeader?$filter=CreationDate eq datetime'2024-12-31T00:00:00' and CreationTime le time'23:59:59'
Response: 400 - Bad Request
<message xml:lang="en">Invalid token detected at position XX</message>
Cause
Incorrect format used in request URI.
Resolution
Correct format for time should be 'PT23H59M00S'.
For example, /sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV;v=2/A_OutbDeliveryHeader?$filter=CreationDate eq datetime'2024-12-31T00:00:00' and CreationTime le time'PT23H59M59S'
See Also
Comparison operators | ||
The following table describes the operators you can use to compare a property and a value. | ||
Operator | Description | Example |
eq | Equal | $filter=revenue eq 100000 |
ne | Not Equal | $filter=revenue ne 100000 |
gt | Greater than | $filter=revenue gt 100000 |
ge | Greater than or equal | $filter=revenue ge 100000 |
lt | Less than | $filter=revenue lt 100000 |
le | Less than or equal | $filter=revenue le 100000 |
Keywords
API, Outbound Deliveries, 400 Bad Request, Invalid token, SAP_COM_0106, Creationtime , KBA , LE-SHP-API-2CL , Interfaces for Delivery Documents (API) (Public Cloud) , How To