Symptom
Failed to create a complete sales order including items and schedule lines within one call through the OData API Sales Order (A2X). Schedule lines are not successfully created.
Environment
SAP S/4HANA Cloud Public Edition
Cause
It's not supported to deep insert schedule lines in the sales order creation through the OData API Sales Order (A2X).
Resolution
To create schedule lines, you have to create a sales order firstly and then send another request to create schedule lines for existing items of this sales order. There are two ways:
- Create a schedule line using the entity
Example URL and request for creating a schedule line for sales order 50214, item 10:
POST <host>/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderScheduleLine
{
"SalesOrder": "50214",
"SalesOrderItem": "10",
"ScheduleLineOrderQuantity": "35",
"OrderQuantityUnit": "PC",
"OrderQuantitySAPUnit": "ST",
"OrderQuantityISOUnit": "PCE",
"RequestedDeliveryDate": "2020-10-01T00:00:00"
} -
Create a schedule line using the association
Example URL and request for creating a schedule line for sales order 50214, item 10:
POST <host>/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='50214',SalesOrderItem='10')/to_ScheduleLine
{
"ScheduleLineOrderQuantity": "11",
"OrderQuantityUnit": "PC",
"OrderQuantitySAPUnit": "ST",
"OrderQuantityISOUnit": "PCE",
"RequestedDeliveryDate": "2020-08-01T00:00:00"
}
Keywords
Schedule Lines, Sales Orders, Items, OData API, Sales Order (A2X), API_SALES_ORDER_SRV, Deep Insert, A_SalesOrderScheduleLine, A_SalesOrderItem, To_ScheduleLine , KBA , SD-SLS-API , API , SD-SLS-API-2CL , API (Public Cloud) , Problem