SAP Knowledge Base Article - Public

3019379 - Duplicate Values in the CustomerOrderItemCollection OData Service


When you are executing a GET call for the CustomerOrderItemCollection entity, you are getting two entries with same Object ID


SAP Cloud for Customer

Reproducing the Issue

Execute the below GET call in the Chrome Browser or Odata Console$filter=SalesOrderID eq 'YYYYY'

XXXXXX - Tenant ID

YYYYY    -  Sales Order ID

You will get two entries with same Object ID.


Duplicate Entries for Sales Order is returned in OData because there are two Item Schedule Lines of type code = 1 (requested) exists for the item with different requested dates.This might be coming from ERP. So, the data need to be verified in ERP. Currently this is the supported behavior of Order OData service in case there are multiple entries for Requested Item Schedule lines (type 1) for an Order Item. If you check the result closely, you can see that the both the entries have different StartDateTime values.


To resolve this, you need to write a logic in your custom solution where you are consuming the OData service to filter the 2 entries by comparing the StartDateTime for both entries incase the ObjectID is same and pick the one with latest date to get the desired single result.


Odata, CustomerOrderItemCollection, Duplicate Entries , KBA , LOD-CRM-INT-API , OData API (C4C Only) , Problem


SAP Cloud for Customer add-ins all versions