SAP Knowledge Base Article - Public

3729509 - Error "Invalid URI Segment" in Batch Request using API_SLSPRICINGCONDITIONRECORD_SRV in SAP S/4HANA Cloud Public Edition

Symptom

An "Invalid URI segment" error with HTTP 400 Bad Request occurs when updating the validity end date for multiple pricing records via a batch request.

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Call the API, for example: https://{host}:{port}/sap/opu/odata/sap/API_SLSPRICINGCONDITIONRECORD_SRV.
  2. Observe the error occurred: "Invalid URI Segment".

Cause

The error occurs due to incorrect URI formatting in the batch request, specifically the presence of unencoded special characters (e.g., colon ':') in the datetime value.

Resolution

  • Encode special characters in the URI by replacing ':' with '%3A' in the datetime value, ensure the request is sent as a single POST call to the $batch endpoint and verify the correct batch structure as per API documentation.
  • For example:

"uri" : "<host>/sap/opu/odata/sap/API_SLSPRICINGCONDITIONRECORD_SRV/A_SlsPrcgCndnRecdValidity(ConditionRecord='0000032848',ConditionValidityEndDate=datetime'9999-12-31T00%3A00%3A00')".

See Also

Keywords

invalid uri segment, bad request, status code 400, batch request, API_SLSPRICINGCONDITIONRECORD_SRV, A_SlsPrcgCndnRecdValidity, condition record, validity end date, batch processing, $batch endpoint, odata v2 adapter, uri format, colon symbol replacement, %3A , KBA , SD-MD-CM-2CL , Conditions and Condition Maintainance (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions