Sub topic 4
How business partner data is stored
This chapter assumes you know basic SAP GUI navigation, the classic customer and vendor master views, and how relational tables and keys work. It explains where business partner data lives in the database and how it connects to the classic customer and supplier tables.
One header, many dependent tables
Every business partner has one header row in table BUT000. The header holds the fields that apply to any partner, such as category, grouping, name fields and the creation data. Other tables hold the details and refer back to the header.
The partner number (PARTNER) is the business key that users see. The system also assigns a technical key, PARTNER_GUID. Many tables, including the CVI link tables, join on the GUID and not on the number.
| Table | Content |
|---|---|
| `BUT000` | Header: partner number, GUID, category, grouping, names |
| `BUT020` | Address assignments |
| `ADRC` | Address details such as street, city and country |
| `BUT0ID` | Identification numbers, such as a tax or registration number |
| `BUT100` | Roles assigned to the partner |
| `BUT050` | Relationships between partners |
| `LFA1` / `KNA1` | Classic supplier and customer general data |
Table names can differ slightly between releases. Check them in transaction SE11 in your own system.
Linking partners to customers and suppliers
The classic tables still exist in S/4HANA. A business partner that acts as a customer has a matching row in KNA1. A partner that acts as a supplier has a matching row in LFA1. The link tables CVI_CUST_LINK and CVI_VEND_LINK record which partner GUID belongs to which customer or supplier number. The next chapters cover how Customer/Vendor Integration (CVI) maintains these links.
Reading the link in ABAP
The following query lists the customer number that belongs to each organization partner. It joins on the GUID, which is how CVI connects the two objects.
SELECT b~partner, c~customer
FROM but000 AS b
INNER JOIN cvi_cust_link AS c
ON c~partner_guid = b~partner_guid
WHERE b~type = '2'
INTO TABLE @DATA(lt_customers)
UP TO 10 ROWS.Field TYPE holds the partner category. The value 2 means organization. A partner with no customer role has no row in CVI_CUST_LINK, so the inner join leaves it out. This is expected.
Why the GUID matters
You can change a partner's number range or grouping rules over time, and the number is the field people see and type. The GUID never changes, so the link tables stay stable. When you write your own joins, use the GUID for table-to-table links and the number only for display or user input.
Common mistakes
- Reading
KNA1orLFA1directly to find a partner. Start fromBUT000or the released API, then follow the link. - Joining on
PARTNERandKUNNRas if they were always equal. They can match when number ranges are aligned, but the link table is the reliable source. - Writing directly to the classic tables. Changes made there bypass the business partner and can break synchronization.
Exercise
You need the supplier number for a business partner, and you only have the partner number. Which tables do you use, and which field joins them?
Show answer
Read BUT000 to get PARTNER_GUID for the partner number. Then read CVI_VEND_LINK using PARTNER_GUID. The link row gives the supplier number, which is the key of LFA1.