sap-cloud-sdk - 通过 SAP Cloud SDK VDM 对业务合作伙伴进行深度插入对 to_Customer 不起作用
问题描述
我正在尝试使用 SAP Cloud SDK 创建一个业务合作伙伴,包括客户、客户销售区域和客户公司。
这就是我创建我的业务伙伴 vdm 的方式:
final CustomerSalesArea customerSalesArea = CustomerSalesArea.builder()
.salesOrganization("YOD1")
.distributionChannel("Y2")
.division("Z1")
.currency("EUR")
.customerAccountAssignmentGroup("01")
.customerPaymentTerms("0001")
.customerPricingProcedure("Y1")
.incotermsClassification("FH")
.itemOrderProbabilityInPercent("100")
.orderCombinationIsAllowed(true)
.customerAccountGroup("CUST")
.build();
final CustomerCompany company = CustomerCompany.builder()
.companyCode("YOD1")
.reconciliationAccount("0012100000")
.customerAccountGroup("CUST")
.build();
final Customer customer = Customer.builder()
.customerSalesArea(customerSalesArea)
.customerCompany(company)
.build();
final BusinessPartner businessPartner = BusinessPartner.builder()
.firstName(oxidBusinessPartner.getFirstName())
.middleName(oxidBusinessPartner.getMiddleName())
.lastName(oxidBusinessPartner.getLastName())
.businessPartnerCategory("1")
.correspondenceLanguage("DE")
.businessPartnerIDByExtSystem(oxidBusinessPartner.getCustomerId())
.customer(customer)
.build();
final BusinessPartnerRole businessPartnerRole1 = BusinessPartnerRole.builder()
.businessPartnerRole("FLCU00")
.build();
final BusinessPartnerRole businessPartnerRole2 = BusinessPartnerRole.builder()
.businessPartnerRole("FLCU01")
.build();
businessPartner.addBusinessPartnerRole(businessPartnerRole1);
businessPartner.addBusinessPartnerRole(businessPartnerRole2);
final AddressEmailAddress emailAddress = AddressEmailAddress.builder()
.emailAddress(oxidBusinessPartner.getEmail())
.build();
for (PostalAddress address : oxidBusinessPartner.getPostalAddresses()) {
final BusinessPartnerAddress businessPartnerAddress = BusinessPartnerAddress.builder()
.country(address.getCountry())
.cityName(address.getCity())
.postalCode(address.getZipCode())
.county(address.getRegion())
.emailAddress(emailAddress)
.build();
businessPartner.addBusinessPartnerAddress(businessPartnerAddress);
}
现在,我可以使用DefaultBusinessPartnerService
. 然而,实际的深度插入似乎无法正常工作,因为Customer
没有创建。
A_BusinessPartner
我可以通过使用展开 to查询 API 来确认这一点to_Customer
,它返回null
. 然而,深插入BusinessPartnerRole
按预期工作。
那么,我在这里缺少什么?是否存在某种依赖关系,例如我首先需要创建一个BusinessPartner
然后是一个Customer
(我绝不是 S4/HANA 方面的专家)?但话又说回来,SAP Cloud SDK 没有提供创建 a 的方法,Customer
api.sap.com 也没有。
解决方案
不幸的是,使用Business Partner API时无法创建Customer实体的实例。在官方文档中,您会发现仅支持“阅读”和“更新”客户。我在SAP API Business Hub中寻找替代的 Rest 服务,并找到了Customer Master 服务,但功能有限。也许它允许创建客户。
推荐阅读
- matlab - 从文本文件中读取特定数据并计算结果
- reactjs - 如何在 React 项目中全局(仅一次)导入某些内容
- redis - 是否有充分的理由不将密码重置令牌存储在像 redis 这样的键值存储中?
- string - 在 Bash 中使用 read 准确地将 x 个字符输出到变量
- javascript - C# Html Razor 页面使用颜色从 html 打印 pdf
- javascript - 在浏览器中创建 Angular 组件的标准方法是什么?
- kotlin - 如何在 Exposed 中禁用 SQL 参数记录?
- c# - c# Regex - 检查是否满足一定长度的条件
- reactjs - 如何使用 Strapi 和 FormData.append 上传图像
- bash - 读取文件以检查数字和文本并将其写入 bash 中的不同文件