SAP Knowledge Base Article - Public

3366726 - Call OData API_PURCHASEREQ_PROCESS_SRV with JSON format raise exception

Symptom

Using the URI /sap/API_PURCHASEREQ_PROCESS_SRV/A_PurchaseRequisitionItem?$format=json the API returns error 500, when removing the ?$format=json the OData call works without any error.

Environment

SAP S/4HANA Cloud.

Reproducing the Issue

  1. Open the API Platform 
  2. Select GET method
  3. URI /sap/opu/odata/sap/API_PURCHASEREQ_PROCESS_SRV/A_PurchaseRequisitionItem?$format=json
  4. Execute
  5. Error 500

Cause

Calling API in JSON format returns the error "TOO_LARGE_BODY" in SAP Gateway client usually occurs when the size of the HTTP response is larger than the value specified for the ICM parameter (icm/HTTP/max_request size MB).

Resolution

You can pass $top to restrict the number of records returned in the response:

  • /sap/opu/odata/sap/API_PURCHASEREQ_PROCESS_SRV/A_PurchaseRequisitionItem?$format=json&$top=100

See Also

https://api.sap.com/api/API_PURCHASEREQ_PROCESS_SRV/overview

Keywords

API_PURCHASEREQ_PROCESS_SRV, 500, bad request , KBA , MM-PUR-REQ , Purchase Requisitions , Bug Filed

Product

SAP S/4HANA Cloud Public Edition all versions ; SAP S/4HANA Cloud all versions