Symptom
When trying to create service confirmation, using the API Service Confirmation A2X (API_SERVICE_CONFIRMATION_SRV), the error: "You can only create service confirmation items with preceding items.". The service order referenced on the payload is correctly created and released for confirmation, even though, the error is thrown.
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
POST <host>/sap/opu/odata/sap/API_SERVICE_CONFIRMATION_SRV/A_ServiceConfirmation HTTP/1.1
Content-Type: application/json
{
"ServiceConfirmationType": "SVC1",
"ServiceConfirmationDescription": "Test"
"ReferenceServiceOrder" : "8000001111",
"SoldToParty" : "171000001",
"to_Item" : [
{
"ReferenceServiceOrderItem" : "20",
"ActualServiceDuration" : "2.000",
"ActualServiceDurationUnit" : "H",
"Quantity" : "1",
"QuantityUnit" : "HR",
"ExecutingServiceEmployee": "9988776656"
}
]
}
Cause
This error is thrown because there's no reference to the service order on the item level of the payload.
Resolution
Add the field "ReferenceServiceOrder" on the item node as well. Check bellow the corrected version of the payload used as example before:
{
"ServiceConfirmationType": "SVC1",
"ServiceConfirmationDescription": "Test"
"ReferenceServiceOrder" : "8000001111",
"SoldToParty" : "171000001",
"to_Item" : [
{
"ReferenceServiceOrder" : "8000001111",
"ReferenceServiceOrderItem" : "20",
"ActualServiceDuration" : "2.000",
"ActualServiceDurationUnit" : "H",
"Quantity" : "1",
"QuantityUnit" : "HR",
"ExecutingServiceEmployee": "9988776656"
}
]
}
See Also
Keywords
service confirmation, service order, API_SERVICE_CONFIRMATION_SRV, OData V2, A_ServiceConfirmation, A_ServiceConfirmationItem, CRM_ORDERADM_I/032 , KBA , CRM-S4-SRV-SCO-2CL , S4CRM: Service Confirmation (Public Cloud) , Problem
SAP Knowledge Base Article - Public