I am trying to get all SalesOrderItems using the
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultSalesOrderService
class provided by S/4HANA SDK but the response is always an empty list and in logs I see this error:
c.s.c.s.odatav2.connectivity.ODataQuery : Failed to convert response into ODataFeed: Illegal argument for method call with message 'to_ValueAddedService'.
Mention: The latest version of the SDK is used - 2.9.1 - and the version of the S/4HANA system is 1902.
This is a response example:
{
"d":{
"results":[
{
"__metadata":{
"id":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')",
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')",
"type":"API_SALES_ORDER_SRV.A_SalesOrderItemType"
},
"SalesOrder":"1",
"SalesOrderItem":"10",
"HigherLevelItem":"0",
"SalesOrderItemCategory":"",
"SalesOrderItemText":"Trading Goods Testing",
"PurchaseOrderByCustomer":"test 1",
"Material":"HAWA1",
"MaterialByCustomer":"",
"PricingDate":"\/Date(1547769600000)\/",
"RequestedQuantity":"10",
"RequestedQuantityUnit":"PC",
"ItemGrossWeight":"1.000",
"ItemNetWeight":"1.000",
"ItemWeightUnit":"KG",
"ItemVolume":"0.000",
"ItemVolumeUnit":"",
"TransactionCurrency":"",
"NetAmount":"1000000",
"MaterialGroup":"A001",
"MaterialPricingGroup":"",
"Batch":"",
"ProductionPlant":"",
"StorageLocation":"",
"DeliveryGroup":"0",
"ShippingPoint":"",
"ShippingType":"",
"DeliveryPriority":"1",
"IncotermsClassification":"",
"IncotermsTransferLocation":"",
"IncotermsLocation1":"",
"IncotermsLocation2":"",
"CustomerPaymentTerms":"",
"SalesDocumentRjcnReason":"",
"ItemBillingBlockReason":"",
"WBSElement":"",
"ProfitCenter":"",
"ReferenceSDDocument":"",
"ReferenceSDDocumentItem":"0",
"SDProcessStatus":"A",
"DeliveryStatus":"A",
"OrderRelatedBillingStatus":"",
"YY1_DownPaymentReferen_SDI":"1400000013",
"to_Partner":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_Partner"
}
},
"to_PricingElement":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_PricingElement"
}
},
"to_SalesOrder":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_SalesOrder"
}
},
"to_ScheduleLine":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_ScheduleLine"
}
},
"to_Text":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_Text"
}
},
"to_ValueAddedService":{
"__deferred":{
"uri":"/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='1',SalesOrderItem='10')/to_ValueAddedService"
}
}
}
]
}
}
Using .select() before executing the request bypasses this issue but this is not a long term solution. This needs to be fixed internally in the SDK.