SAP CVI Business Partner Gap Report ABAP Generator
Before converting to S/4HANA, every customer and vendor must be linked to a Business Partner through CVI. This generator produces a read-only ABAP report that lists the records that are not linked yet.
Fill in
Must start with Z or Y
Customers without a Business Partner link
REPORT ZCVI_GAP_CHECK.
DATA lv_ktokd TYPE kna1-ktokd.
SELECT-OPTIONS s_ktokd FOR lv_ktokd.
START-OF-SELECTION.
SELECT a~kunnr, a~name1, a~ktokd, a~land1
FROM kna1 AS a
LEFT OUTER JOIN cvi_cust_link AS l ON l~customer = a~kunnr
WHERE l~customer IS NULL
AND a~ktokd IN @s_ktokd
INTO TABLE @DATA(lt_cust)
UP TO 5000 ROWS.
WRITE: / 'Customers without BP link:', lines( lt_cust ).
LOOP AT lt_cust INTO DATA(ls_cust).
WRITE: / ls_cust-kunnr, ls_cust-ktokd, ls_cust-land1, ls_cust-name1.
ENDLOOP.Vendors without a Business Partner link
* Add this block to the same report, after the customer loop.
SELECT a~lifnr, a~name1, a~ktokk, a~land1
FROM lfa1 AS a
LEFT OUTER JOIN cvi_vend_link AS l ON l~vendor = a~lifnr
WHERE l~vendor IS NULL
INTO TABLE @DATA(lt_vend)
UP TO 5000 ROWS.
WRITE: / 'Vendors without BP link:', lines( lt_vend ).
LOOP AT lt_vend INTO DATA(ls_vend).
WRITE: / ls_vend-lifnr, ls_vend-ktokk, ls_vend-land1, ls_vend-name1.
ENDLOOP.Optional: customers also set up as vendors
* Candidates for a single Business Partner with both roles.
* Compare on tax number or on the vendor field KUNNR in LFA1.
SELECT l~lifnr, l~kunnr, l~name1
FROM lfa1 AS l
WHERE l~kunnr <> @space
INTO TABLE @DATA(lt_both)
UP TO 5000 ROWS.
WRITE: / 'Vendors that reference a customer:', lines( lt_both ).Requires ABAP 7.40 or later for the inline syntax. CVI link tables exist only where the Customer Vendor Integration components are installed, so verify CVI_CUST_LINK and CVI_VEND_LINK in SE11 on your release. Run in a sandbox first. This report only reads data.
Plan your master data cleanup
Want help sizing duplicates and CVI cleansing from your own extract? Send us the counts and we will advise.
Optional. The tool and every export work without this. No spam.
How to use the generated report
Fill in the report name, row limit and optional account group, then copy the code into SE38 in a sandbox copy of production. Activate and run it. The customer list reads KNA1 and left joins CVI_CUST_LINK, so rows with an empty link are customers without a Business Partner. The vendor block does the same for LFA1 and CVI_VEND_LINK. Use the counts as a baseline and rerun after each CVI synchronization cycle.
- Run in a copy of production, not directly in production first
- Filter by account group to isolate one-time or blocked accounts
- Save counts per run to show progress to the program board
Why the gap matters
In S/4HANA the Business Partner is the leading object, so customers and vendors that cannot be converted block the technical conversion until their data is clean. Typical reasons include missing mandatory fields, inconsistent country or region, duplicates, and account groups without a mapping in CVI customizing. The gap list is the starting point for cleansing, and the same keys help prioritize records that have open items or recent activity.
Common mistakes
Do not assume every unlinked record is bad data. In some systems CVI is partly active already. Check your own configuration first. Do not delete records just because they are unlinked, since open documents may reference them. Also remember that blocked, deletion flagged and rarely used accounts often dominate the count, so filter by status before sizing cleanup effort.
Frequently Asked Questions
Does this report change any data?
No. It only runs SELECT statements and writes a list to the screen. It is safe to run in a sandbox, but still follow your change policy and avoid running on production at peak hours.
Why are the link tables missing in my system?
The CVI link tables belong to the Customer Vendor Integration component. If they are absent in SE11, CVI is not installed on that release, and you must follow SAP guidance to enable it before the pre-conversion checks.
Can I use this for large systems?
Yes, but raise the row limit carefully. For millions of records, write to a file or a Z table instead of using WRITE, and run in background to avoid dialog time limits.
What comes after the gap report?
Cleanse the data, fix customizing, run the synchronization cockpit, and rerun the report until counts are acceptable. The SAP pre-checks in the conversion then confirm CVI consistency.
If the gap list is large, Netray can help build a repeatable cleansing and deduplication approach for the master data before CVI runs.
Related Tools
SAP S/4HANA Key Simplifications Reference
A searchable reference of the biggest ECC to S/4HANA data model and functional changes, with the action each one usually forces.
SAPSAP ECC Obsolete Transactions and S/4HANA Replacements
A lookup table of common ECC transaction codes and the transaction or app that replaces them in S/4HANA, for training and role design.
SAPSAP Custom Code Inventory ABAP Query Generator (TADIR)
Generates ABAP SELECT statements against TADIR that count and list custom objects by type and package for S/4HANA remediation planning.
SAPSAP S/4HANA Pre-Conversion Technical Checklist
A checklist of the technical preparation items to close before running SUM on a system conversion from ECC to S/4HANA.