SAP Knowledge Base Article - Public

3555785 - Error while using API to retrieve list of outbound delivery - SAP S/4HANA Cloud Public Edition

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.
OperatorDescriptionExample
eqEqual$filter=revenue eq 100000
neNot Equal$filter=revenue ne 100000
gtGreater than$filter=revenue gt 100000
geGreater than or equal$filter=revenue ge 100000
ltLess than$filter=revenue lt 100000
leLess 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

Product

SAP S/4HANA Cloud Public Edition all versions