我正在尝试使用 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 也没有。