Updated Sample Implementation ‘Merge Customer and Vendor into a Single Business Partner’
In SAP S/4HANA, a Business Partner can have different roles such as Customer and Supplier. It is therefore possible that one legal entity is represented by a single Business Partner having a Customer role as well as a Vendor role.
If you want to make use of this option in SAP S/4HANA and if you are preparing for a conversion project from your SAP ERP 6.0 system, you need to consider merging your Customer and Vendor into a single Business Partner during CVI synchronization in case they reflect the same legal entity (CVI = Customer Vendor Integration).
This activity is part of the synchronization of your customers, vendors, and contact persons to Business Partners based on the simplification item for the Business Partner Approach.
The possibility to merge a customer and a vendor into one single Business Partner was first introduced with SAP note 2363892 – Linking Customer and Vendor to a single Business Partner during initial load before upgrade to S/4. Please also see Andi Mauersberger’s blog post SAP S/4HANA Business Partner Conversion – Merge Customer and Vendor into single Business Partner. Andi’s blog post shows how the merging is done.
The intention of this blog post here is to make you aware of some SAP notes which extended or changed the sample implementation CVI_MAP_LEGAL_ENTITY for BAdI CVI_CUSTOM_MAPPER.
Is merging mandatory?
To make it perfectly clear: Using a single Business Partner with customer and supplier role for a legal entity in SAP S/4HANA is only an OPTION and it is NOT A MUST. You need to check if your business requirements and your organization with regards to Customer and Supplier master data management can support having just one Business Partner for Customer and Vendor. Please remember that such a Business Partner uses the same general data for both the Customer and the Vendor role. This includes (e.g). the BP’s address data, bank data, tax numbers, industry classification, and contact persons assignments.
So, if your sales and purchasing department is good to go with one address four your customer and your vendor, sharing the same bank account data, using the same industry classification then you also might want to combine your Customer and Vendor data into one single Business Partner during CVI synchronization in SAP ERP as part of a conversion project to SAP S/4HANA. If not, please remember to deactivate implementation CVI_MAP_LEGAL_ENTITY for BAdI CVI_CUSTOM_MAPPER which is activated by default depending on your Support Package level or if you have used SAP note 2951811 – Transport-based correction instructions (TCIs) for customer vendor integration (CVI) on ECC (SAP_APPL).
In the following, we assume that you want to merge customer and vendor data into one Business Partner for the same real-world entity.
Important SAP Notes
The following SAP notes provide or extend the sample implementation CVI_MAP_LEGAL_ENTITY for BAdI CVI_CUSTOM_MAPPER. If you have implemented these SAP notes or if you are using the respective Support Package level in SAP ERP 6.0, Customer and Vendor will only be merged into one Business Partner if …
- … the Customer and Vendor are linked through the Customer Number field in the Vendor table and the Vendor Number field in the Customer table (kna1-lifnr, lfa1-kunnr).
- … the Customer and Vendor contain exactly the same postal address information.
- … the Customer and Vendor have the same bank account information.
- … if the tax numbers are in sync.
Above conditions apply if you have the following SAP notes installed:
- 2363892 – Linking Customer and Vendor to a single Business Partner during initial load before upgrade to S/4
–> the original implementation
- 2921774 – Missing Tax – Linking Customer and Vendor to a single Business Partner during initial load before upgrade to S/4
–> making sure that the tax numbers are in sync.
- 2968536 – Harmonize the behavior for Linking Customer and Vendor to a single Business Partner
–> making sure that only customers and vendors are merged if they use the same bank account information.
If merging is not successful, the following SAP notes provide detailed error messages rather than a generic one:
- 3088419 – DDIC for Legal Entity BAdI Message (367) Enhancements
- 3067086 – Legal Entity BAdI Message (367) Enhancements
Please be aware that this BAdI implementation is just meant to be a proof of concept – whenever a different behavior than the SAP default is desired – the desired behavior has to be created within a custom project which means to deactivate implementation CVI_MAP_LEGAL_ENTITY and to create and activate an own implementation for BAdI CVI_CUSTOM_MAPPER.
Prerequisite for below examples is that the vendor number is maintained in the customer master and the customer number is maintained in the vendor master.
Customer 1000218 was synchronized to Business Partner 1944 with below address:
Vendor 1000258 containing customer number 1000218 (and customer 1000218 containing vendor number 1000258) was synchronized with below address but failed with the error message in the Post Processing Office:
Changing the Vendor’s address to the very same of the Customer allows to synchronize the vendor as well and to merge it into BP 1944.
Same Tax Numbers
Customer 1000219 was synchronized to Business Partner 1946 with below tax number:
Vendor 1000259 containing customer number 1000219 (and customer 1000219 containing vendor number 1000259) was synchronized with another tax number but failed with the error message in the Post Processing Office:
Changing the Vendor’s tax number to the very same of the Customer allows to synchronize the vendor as well and to merge it into BP 1946.
Same Bank Account Information
Customer 1000220 was synchronized to Business Partner 1947 with below bank account:
Vendor 1000265 containing customer number 1000220 (and customer 1000220 containing vendor number 1000265) was synchronized with another bank account but failed with the error message in the Post Processing Office:
Changing the Vendor’s bank account to the very same of the Customer allows to synchronize the vendor as well and to merge it into BP 1947.
SAP S/4HANA allows you to maintain one single Business Partner with Customer and Vendor roles if they reflect the same legal entity. If you want to make use of this possibility and if you are running a conversion project, you need to think of merging Customers and Vendors into Business Partners during CVI synchronization in SAP ERP 6.0. The BAdI implementation provided with above SAP notes allows you to merge these data in a consistent way. Still, you need to check your specific business requirements and to map them to the solution offered with this BAdI implementation. If you have different or additional requirements with regards to merging, you can create your own implementation based on the sample coding.