1

我们正在尝试使用 S4 HANA SDK 执行 POST 操作。我们的用例是将子实体添加到已创建的父实体。

我们正在沿着这些方向努力

final BusinessPartnerService service; // your BusinessPartner service
final BusinessPartner abcBusinessPartner; // fetched businessPartner
final BusinessPartnerRole newRole; // your role, for example created by: BusinessPartnerRole.builder(). ... .build();

abcBusinessPartner.addBusinessPartnerRole(newRole);

service.updateBusinessPartner(abcBusinessPartner);

我们从本地系统返回以下错误。

{
  "error": {
    "code": "/IWFND/CM_MGW/096",
    "message": {
      "lang": "en",
      "value": "PATCH requests require components to be updated"
    },
    "innererror": {
      "application": {
        "component_id": "MM-PUR-REQ",
        "service_namespace": "/SAP/",
        "service_id": "MMPUR_REQ_SSP_MAINTAIN_SRV",
        "service_version": "0001"
      },
      "transactionid": "94EEA58F4E630230E005D1A751652A34",
      "timestamp": "20190708061130.8418390",
      "Error_Resolution": {
        "SAP_Transaction": "For backend administrators: run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details",
        "SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"
      },
      "errordetails": []
    }
  }
}
4

1 回答 1

1

基于博客:: https://blogs.sap.com/2018/09/17/sap-s4hana-cloud-sdk-version-2.4.1-is-available/

对于创建子实体的用例,我们必须在创建时使用 .asChildOf 限定符。

例如 :: new DefaultBusinessPartnerService() .createBusinessPartnerAddress(addressToCreate) .asChildOf(parentBusinessPartner, BusinessPartner.TO_BUSINESS_PARTNER_ADDRESS) .execute();

于 2019-07-08T08:29:13.027 回答