SAP Knowledge Base Article - Public

2925197 - Error "In the context of Data Services an unknown internal server error occurred" when creating a new sales order item via API Sales Order (A2X) - SAP S/4HANA Cloud

Symptom

When creating a new item for an existing sales order using POST HTTP method on the A_SalesOrderItem entity of API Sales Order (A2X), the following error messages occur:

  • In the context of Data Services an unknown internal server error occurred
  • The table does not contain a row with the specified values
  • The Data Services Request could not be completed due to a conflict with the current state of the resource

Environment

SAP S/4HANA Cloud

Reproducing the Issue

  1. Send API request to create a new item for an existing sales order with POST HTTP method on the A_SalesOrderItem entity of API Sales Order (A2X).
  2. The error "In the context of Data Services an unknown internal server error occurred" occurs and the new item is not created.

Cause

The deep insert was not used within the payload of this API request. The sales order item entity will not be created without including any rellated entities, for example, item partner, item pricing element and item text.

Resolution

At least one deep insert request is required within the payload of this API request. If you want to create an item without any additional sub-entities, you can provide an empty association like the one in the following sample code:

{
"SalesOrder": "50214",
"Material": "TG11",
"RequestedQuantity": "2",
"PurchaseOrderByCustomer": "Created via OData",
"to_Partner": []
}

See Also

Create Sales Order Item

Keywords

Sales Order Item, Deep Insert, Entity, Payload, API Request, OData API, API Sales Order (A2X), A_SalesOrderItem , KBA , SD-SLS-API , API , SD-SLS-SO , Sales Orders , SD-SLS-API-2CL , API (Public Cloud) , Problem

Product

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