[英]Consuming SalesOrderItem API using S/4HANA SDK
I am trying to get all SalesOrderItems using the 我试图使用所有SalesOrderItems
com.sap.cloud.sdk.s4hana.datamodel.odata.services.DefaultSalesOrderService 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: 由S / 4HANA SDK提供的类,但响应始终为空列表,在日志中我看到此错误:
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. 提及:使用最新版本的SDK - 2.9.1 - 而S / 4HANA系统的版本是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"
}
}
}
]
}
}
It is an issue with the Sales Order API on SAP S/4HANA Cloud side. 这是SAP S / 4HANA Cloud方面的销售订单API的问题。 The
to_ValueAddedService
navigational property is not declared in the $metadata
, however it appears on the A_SalesOrderItem
OData EDM Entity and is not working. to_ValueAddedService
导航属性未在$metadata
声明,但它出现在A_SalesOrderItem
OData EDM实体上并且不起作用。 SAP S/4HANA Cloud colleagues are already looking into the incident. SAP S / 4HANA Cloud的同事们已经在调查此事件。
Using .select() before executing the request bypasses this issue but this is not a long term solution. 在执行请求之前使用.select()会绕过此问题,但这不是一个长期解决方案。 This needs to be fixed internally in the SDK.
这需要在SDK内部修复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.