Skip to Content
Technical Articles
Author's profile photo Andi Mauersberger

SAP S/4HANA Business Partner Conversion – Merge Customer and Vendor into single Business Partner


In preparation of a technical S/4HANA conversion it is mandatory to convert (CVI conversion) Customers and Vendors into Business Partners. Maybe you struggle with merge of Customer and Vendor into one Business Partner at CVI conversion. This Blog post is about to clarify how to merge Customers and Vendors into one Business Partner and what the result of this merge is.

This CVI conversion has to be processed in ECC environment as a preparation step for technical S/4HANA conversion. CVI Cockpit will guide you through this process. More information about CVI Cockpit you will find in blog post
New CVI Cockpit – Enabling Movement to SAP S/4HANA through seamless BP Synchronization

It might happen that it is needed to merge Customers and Vendors into one Business Partner. In this case the Business Partner represents a legal entity from legal point of view. This legal entity is characterized with

  • A single address
  • A single communication data
  • Several bank accounts
  • Several contact persons
  • Several credit cards

Target audience: Functional expert, Development expert

Version: SAP ECC 6.0 or higher


04/2023: consider CVI_LEDH



At the following example Customer is the leading object. That means Customer data is the main information in regards to address and numbering (dependent on same number set up). If you decide to use Venbdor as leading object, start with Vendor conversion.
As the initial situation there are Customers and Vendors in the system. Usually Customer and Vendor master data is linked with cross reference. Meaning Customer number is stored at Vendor master (field LFA1-KUNNR) and Vendor number is stored at Customer master (field KNA1-LIFNR). If this link is not established yet, this will be a requisit. If this link is not available, alternatively address data can be used. Usually address data for the same legal entity is 100% equal at Customer and Vendor master data. That’s why uing Address data is much more complex and similiar to a duplicate check.

Initial situation

Separated Customer and Vendor master data with Contact Persons and bank accounts.


Initial Situation


All 4 synchronization directios have to be activated in customizing:

  • Customer -> BP
  • Vendor -> BP
  • BP -> Customer
  • BP -> Vendor

Enhancement Implementation

You have to implement your own Enhancement Implementation of BAdI CVI_CUSTOM_MAPPER. With SAP note

2363892 – Linking Customer and Vendor to a single Business Partner during initial load before upgrade to S/4

an example Implementation CVI_MAP_LEGAL_ENTITY is available at methods


This delivered implementation is a POC only, because following data has to be 100% equal:

  1. Customer/Vendor has to be linked via LFA1-KUNNR and KNA1-LIFNR as foundation
  2. Address data

I’ve never seen a system where address data of Customer and Vendor are the same. That’s why you have to create your own matching criteria in your own implementation. You can use standard implementations as template and do your own adjustments. Pay attention to inline documentation at each step. This will help you to decide which steps to take over.
Foundation is the assignment of Customer/Vendor with fields KNA1-LIFNR and LFA1-KUNNR. Sometimes it is enough to just use these assignment to merge Customer and Vendor to one Business Partner.

Preparation with CVI_LEDH (Data Harmonization for Legal Entities)

Available with SAP ECC 6.0 EHP 8 SP17 and higher

During the synchronization process in MDS Load Cockpit (MDS_LOAD_COCKPIT), there may be errors for customer and vendor records that cross-reference each other forming a legal entity pair. The errors are due to inconsistencies in the address, bank details and tax data between the customer and vendor legal entity pair.

The Legal Entity Data Harmonization (CVI_LEDH) report lists the customer and vendor legal entity pairs. It facilitates selection of leading entity (customer/vendor) for address, tax details and bank data for harmonizing the data. The MDS Load Cockpit uses the leading entity information from this report to synchronize the legal entity customer and vendor pair to the business partner. This will harmonize the data and avoid errors for legal entity pairs in MDS Load Cockpit.

The usage of transaction CVI_LEDH is described at blog post Improvements to CVI Cockpit as of SAP ERP 6.0 EHP 8 SP17

A more detailed description how MDS_LOAD_COCKPIT is reacting in different cases you can find at blog post SAP S/4HANA Business Partner Conversion – Merge Customer and Vendor using Transaction CVI_LEDH (Legal Entity Data Harmonization Report)

Conversion steps with MDS_LOAD_COCKPIT

Convert Customer to Business Partner

>Business Partner with Customer role has been created. Business Partner for each contact person and relationship to Customer Business Partner has been created.


Convert Customer to Business Partner

Convert Vendor to Business Partner

Vendor data as of Vendor role, Contact Persons, relationships and bank accounts has been added to Customer Busines Partner. Business Partner has now the full set of Customer and Vendor data as foundation for reverse synchronization.


Convert Vendor to Business Partner

Convert Business Partner to Customer

Business Partner data inclusive vendor information as of Vendor Contact Persons and bank accounts are synchronized into Customer master.


Convert Business Partner to Customer

Convert Business Partner to Vendor

Business Partner data inclusive Customer information as of Customer Contact Persons and bank accounts are synchronized into Vendor master.


Convert Business Partner to Vendor

All 3 data objects, Customer, Business Partner and Vendor, are synchronized now.


Note for S/4HANA: Please pay attention to activate implementation CVI_ASSIGN_CUST_VEND of BAdI CVI_CUSTOM_MAPPER to provide customer number to vendor (LFA1-KUNNR) and vendor number to customer (KNA1-LIFNR).

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Christian Niemann
      Christian Niemann

      Great to have an easy acess to the topic now!

      Thank´s for the great blog!

      Author's profile photo Marek Turczynski
      Marek Turczynski

      Hi Andi Mauersberger

      I am sorry but I must rectify some of your statements as they are unfortunately (at least) inaccurate:

      This delivered implementation is a POC only, because following data has to be 100% equal:

        1. Customer/Vendor has to be linked via LFA1-KUNNR and KNA1-LIFNR as foundation
        2. Address data
        3. Tax numbers
        4. Bank Data

      Tax numbers do not have to be the same. They are not checked by standard implementation of BADI CVI_CUSTOM_MAPPER. If there is a tax code that is not existing in the other party data then it is overtaken.

      Banks do not have the be the same – only if the same bank data is stored in both customer and vendor. If they have different data then all nonmatching bank data will be overtaken. Just the partner bank type needs to be different because it is a key field (unique) in BP.


      All 4 synchronization directios have to be activated in customizing:

        • Customer -> BP
        • Vendor -> BP
        • BP -> Customer
        • BP -> Vendor

      The BP backwards (-> Customer or -> Vendor) synchronization does not need  to be used (in ECC) if you’re not using Treasury module. That is even mentioned by SAP itself in the BP CVI Cookbook!

      In ECC it is enough to continue with Customer/ Vendor -> BP integration to ensure that each Customer/ Vendor has a BP (prerequisite for S/4 Upgrade).


      I wonder why the ridiculously high number ( 67! ) of fields being checked between vendor and customer was not mentioned. Among them customers can find fields like ‘Creation language’.

      Yes – if you have exactly the same data in customer and vendor but you created vendor while being logged on in English and some other person created customer with exactly the same data but was logged on in German your partners will not be synchronized due to address data mismatch.  Field responsible for that is ‘LANGU_CR’.

      Best Regards,

      Marek Turczyński

      Author's profile photo Andi Mauersberger
      Andi Mauersberger
      Blog Post Author

      Hello Marek,

      thank you for precise statement. I had a look into this and corrected my post.

      You are right with the first part. Only address data has to be equal in standard BAdI implementation. Tax numbers and bank data are just added to the missing entity.

      For a correct merge/sync of customer/vendor into single BP it is mandatory to run all 4 synchronization steps. Otherwise you will miss customer's contact persons at vendor and vice versa. If you are on S/4HANA later on, BP/customer/vendor are not in sync regarding contact persons.

      Best Regards

      Author's profile photo Tobias Reich
      Tobias Reich

      Hi Andi,

      thank you for sharing your post this is really helpful. However I'm missing further details how Business Partner duplicates can be avoided. For example if in ERP there exist mutliple vendors as same legal entity (as customers often do not check if have been created in the past) so CVI will create for each vendor a separate business partner which is a pain. It seems there are no standard checks during MDS_LOAD which could avoid creation of duplicates in such cases.

      Do you may have an advise?



      Author's profile photo Guillermo León Giraldo Arias
      Guillermo León Giraldo Arias


      Author's profile photo Marco Haseney
      Marco Haseney

      Hello Andi Mauersberger

      thank you for your blog post. Very helpful for conversion inside one system.

      One comment, one question.

      Comment: Function of transaction CVI_LEDH and usage of manually maintained+saved result by MDS_LOAD_COCKPIT might be included in your explanation

      Question: Same contact person for customer and vendor => how to avoid duplicate BPs type person / BP role BUP001

      Example:Customer=Vendor => SAP

      a) customer: KNA1-KUNNR=4711, KNA1-LIFNR=0815 / KNVK-KUNNR=4711, KNVK-PARNR=1000, KNVK-NAMEV=Andi, KNVK-NAME1=Mauserberger

      b) vendor: LFA1-LIFNR=0815, LFA1-KUNNR=4711 / KNVK-LIFNR=4711, KNVK-PARNR=2000, KNVK-NAMEV=Andi, KNVK-NAME1=Mauersberger

      Merge of customer = vendor by KNA1-LIFNR+LFA1-KUNNR to one BP see your blog

      BUT how will be avoided to create two contact persons BP Andi Mauersberger, who are both linked by relationship to BP SAP?

      These duplicates have to be avoided, because also prsons should be represented by one unique BP (paradigm shift not only for companies/organisations).

      Do you have any advice, how to deal with this situation, because BP contact person analysis after conversion and archiving cannot be the solution.

      Thank you in advance.

      Best regards


      Author's profile photo Andi Mauersberger
      Andi Mauersberger
      Blog Post Author

      Hello Marco,

      thank you for comment. I've updated this post with CVI_LEDH.

      Regarding your question about contact persons:

      Contact persons are needed to convert to BPs without consolidation in a merge scenario. Background is that contact person BP is just needed to create a BP relationship which will lead to an entry in table KNVK. If you think about duplicate check in general this is quite a complex topic. Just consider different writing of names (Mauserberger, Mauersberger, Andi, Andy, ....). Another aspect is the same name for different physical persons. At KNVK contact persons usually you will just have the name and office communication data. There is no private data like private address.

      From technical point of view partner numbers from table KNVK are used in master data and documents. This numbers have to stay and should not change. Otherwise master data and documents become inconsistent.

      With this information the safest way for conversion is to take each KNVK entry, create a contact person BP and connect this to organisation BP via relationship. That's why you might see duplicate names in relationship overview or have duplicates in contact person BPs.

      I hope this helps you and gives you some arguments.

      Best Regards

      Author's profile photo Marco Haseney
      Marco Haseney

      Hello Andi,

      thank you for your detailed reply. Meanwhile I found also OSS note "3066244 - Synchronization process for contact person", which supports your explanation and describes a solution proposal by customer BADI implementation of CVI_CUSTOM_MAPPER.

      But during conversion another problem came up with contact persons. This affects only customer=vendor data records. Although the configurations of S/4HANA CVI Cookbook and OSS notes like 2363892 ff. are done correctly and the order of the load like described in your blog and the cookbook was observed the completeness check TX CVI_COMPL_CHK shows a lack of conversion contact persons for customer=vendor.

      Based on more detailed analysis it seems, that the step 3+4 (see your blog and also cookbook page 58 ff. [opposite order of execution compared to your blog])  BP=>Vendor and BP=>customer are processing the CVI adjustment KNVK by additional entries (creation date and user refers to BP=>Vendor/Customer runs) based on the contact person BPs eg. contact person customer wil be created  contact person vendor additionally in KNVK, BUT there is no link of the new entry to BP contact person in CVI_VEND_CT_LINK. I also detected that KNVK entries are created with missing KNVK-PRSNR. So the new entries in KNVK are shown as error (not converted) in TX CVI_COMPL_CHK. This error occurs in both cases. If e.g. in TX XD03 the contact person detail will be accessed, this will end up  in detail in an error see OSS note "1331413 - XD03: inconsistencies in address contact persons (AM 885)" but only for the relevant data records without KNVK-PRSNR, which were definetly be generated by one of the MDS_LODA_COCKPIT runs. Unfortunately neither MDS_LOAD_COCKPIT log / SLG1 log nor any other change history enables the user to identfy the load, which causes the corrupt data.  

      The corrupt KNVK entries are duplicates of the correct one, which also were generated by a MDS_LOAD_COCKPIR run, but after the corrupt one (due to CP ID is higher).

      A rerun of MDS_LOAD_COCKPIT e.g. Vendor=>BP for the incorrect vendors shown in TX CVI_COMPL_CHK  just makes the problem even worse, because then new contact persons BPs are created including relationship, BUT they are with corrupt data in name etc. 

      I found OSS note 3309852, but this cannot be a solution, because this is in conflict to the logic of your blog/cookbook. The process should add/adjust KNVK and CVI_VEND_CT_LINK/CVI_CUST_CT_LINK correctly from the beginning, because reload MDS_LOAD_COCKPIT will make the data even more corrupt see my description.

      I spend a lot of time in research OSS, SDN etc. but did not find any solution.

      Do you have any idea of the cause and also how to correct the corrupt data KNVK etc. for the contact person customer=vendor cases, because they are the only left to be shown as not converted in TX CVI_COMPL_CHK.

      Thank you in advance.

      Best regards




      Author's profile photo Onno Cleeren
      Onno Cleeren

      Hi Andi,


      We have done Business Partner migration for customer only in MDG and kept same numbers all along for customer and BP e.g. ECC customer #: 123 = BP #: 123. Now assume supplier is same legal entity but has different ECC supplier#: 789. How to create the link so the supplier mapped BP as well has number 123? I dont see that in CVI_LEDH which seems to focus on master data harmonization with customer as leading object.

      Thanks Onno