SAP Knowledge Base Article - Public

3544068 - Error "Error setting delivery date: Purchase requisition is being processed" with API_SALES_ORDER_SRV when Setting the Request Delivery Date

Symptom

When updating a sales order using the OData API_SALES_ORDER_SRV (Sales Order A2X) to set the "request delivery date", a lock error occurs: "Error setting delivery date: Purchase requisition is being processed".

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental. 

Environment

SAP S/4HANA Cloud Public Edition

Reproducing the Issue

  1. Create a sales order using the API_SALES_ORDER_SRV. The system automatically creates a purchase requisition.
  2. When updating the sales order to set the "request delivery date", a lock error occurs: "Error setting delivery date: Purchase requisition is being processed".

Cause

The error message is expected. After creating the sales order in the system, a Purchase Requisition is created automatically. This happens asynchronously and if the customer tries to update the "request delivery date", the system also needs to update the Purchase Requisition which is still in creation mode during that time. 

Resolution

There are 3 solutions for this:

    1. Use the OData V4 API_SalesOrder (Sales Order A2X) that already supports schedule lines in create deep. 
    2. Increase the sleep time between the API calls.
    3. Use the BADI Modification of Requested Delivery Date for Sales Document Items (SD_SLS_MODIFY_ITEM_REQDATE) to change the "request delivery date" on Item Level. 
      • Create a custom field: Create a custom field on sales order item level called “MyItemReqDelDate” of type date and enable usage for the sales order API. 


        Save and publish the custom field. 
      • Create custom logic for modification of "request delivery date" for sales document items (SD_SLS_MODIFY_ITEM_REQDATE) via the "Custom Logic" app.
      • Create a sales order via the API.
      • Check the sales order in the "Manage Sales Order – Version 2" app. 

    Keywords

    API_SALES_ORDER_SRV, A2X, Purchase requisition, PR, Error,  "Error setting delivery date: Purchase requisition is being processed", Request delivery date, OData V4 API, SD_SLS_MODIFY_ITEM_REQDATE, BADI, Sales order, Items, Delay, Sleep time , KBA , SD-SLS-API-2CL , API (Public Cloud) , Problem

    Product

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

    Attachments

    Pasted image.png