Sub topic 9
Customer data: general, company code and sales area
This chapter explains the three levels of customer data in SAP S/4HANA and where each level is stored. It also covers which business partner role unlocks each level.
It assumes you know the SAP ERP customer master (the sales, accounting and general views), the organizational units company code and sales area, and basic relational keys. It also assumes you have read the earlier chapters on roles and Customer/Vendor Integration (CVI).
Why customer data has levels
A customer is not one flat record. Some facts are true for the customer everywhere, such as name, address and language. Other facts depend on the legal entity that books the money (the company code). Others depend on the organization that sells to the customer (the sales area, which is a combination of sales organization, distribution channel and division).
The classic customer master reflects this with one table per level. In S/4HANA you still maintain these levels, but you do it through the business partner. CVI copies the data into the classic tables so that sales, billing and accounting keep working.
| Level | Key | Typical content | Classic table | Role to maintain it |
|---|---|---|---|---|
| General | Customer number | Name, address, language, communication data, tax numbers, account group | KNA1 | FLCU00 or FLCU01 |
| Company code | Customer, company code | Reconciliation account, payment terms, dunning, payment methods | KNB1 | FLCU00 (FI customer) |
| Sales area | Customer, sales organization, distribution channel, division | Customer group, shipping, billing, incoterms, tax classification | KNVV | FLCU01 (customer) |
Related sales area tables are KNVP (partner functions), KNVI (tax indicators) and KNVK (contact persons).
Where each level lives
General data is the only level that exists in two places. The business partner tables (BUT000 for the header, ADRC for addresses) hold the master copy. CVI writes the customer-relevant part into KNA1. Company code and sales area data are customer-specific. They are entered on the business partner screens, but they end up in KNB1 and KNVV.
The link between the two worlds is table CVICUSTLINK. It maps the business partner's GUID (a 32-character internal key) to the customer number.
Roles decide which levels you can edit
Assigning a role to the partner is what creates the customer. The two customer roles open different levels:
- FLCU00 (FI customer) opens the company code level. Without it you cannot enter a reconciliation account or payment terms for accounting.
- FLCU01 (customer) opens the sales area level. Without it, the sales area data is not available.
A partner with only FLCU01 can receive sales orders, but you cannot post an invoice to it until company code data exists. Assign both roles to a customer that is used in the full order-to-cash process.
General data
General data applies to the customer in every organizational unit. In transaction BP it appears on the address, identification and control tabs. Examples are the search term, the correspondence language, the tax numbers and the standard address.
The customer account group (KNA1-KTOKD) is not typed in. It is derived from the business partner grouping through a mapping in customizing. The grouping you choose at creation therefore decides the account group the customer gets, and it cannot be changed freely afterwards. Chapter 13 covers that mapping.
Company code data
Company code data is created per company code. In transaction BP, with role FLCU00 selected, you open the company code dialog and add a row for each company code. Typical fields:
- Reconciliation account (KNB1-AKONT), the general ledger account that the customer's open items roll up into.
- Payment terms (ZTERM), payment methods and the dunning procedure.
- Sort key, interest calculation and the house bank used for incoming payments.
Each company code row is one record in KNB1. A customer that trades with three legal entities has three rows.
Sales area data
Sales area data is created per combination of sales organization, distribution channel and division. In transaction BP, with role FLCU01 selected, you open the sales area dialog and add the combination. The data is spread over several tabs:
- Sales: customer group, sales district, sales office and currency.
- Shipping: delivery priority, shipping conditions and delivering plant.
- Billing: incoterms, payment terms for billing and account assignment group.
- Partner functions: sold-to, ship-to, bill-to and payer, stored in KNVP.
- Tax indicators: stored per destination country in KNVI.
When a customer is new to a second sales area, copy the data from a reference sales area and then adjust it, instead of retyping every field.
Reading the three levels in ABAP
This report starts from a customer number. It finds the linked business partner, then lists the company code and sales area rows.
REPORT zcust_levels.
PARAMETERS p_kunnr TYPE kunnr OBLIGATORY.
START-OF-SELECTION.
SELECT SINGLE b~partner
FROM cvi_cust_link AS l
INNER JOIN but000 AS b
ON b~partner_guid = l~partner_guid
WHERE l~customer = @p_kunnr
INTO @DATA(lv_partner).
IF sy-subrc <> 0.
WRITE: / 'No business partner linked to customer', p_kunnr.
RETURN.
ENDIF.
WRITE: / 'Business partner:', lv_partner.
SELECT bukrs, akont, zterm
FROM knb1
WHERE kunnr = @p_kunnr
INTO TABLE @DATA(lt_cc).
LOOP AT lt_cc INTO DATA(ls_cc).
WRITE: / 'Company code', ls_cc-bukrs, ls_cc-akont, ls_cc-zterm.
ENDLOOP.
SELECT vkorg, vtweg, spart, waers
FROM knvv
WHERE kunnr = @p_kunnr
INTO TABLE @DATA(lt_sa).
LOOP AT lt_sa INTO DATA(ls_sa).
WRITE: / 'Sales area', ls_sa-vkorg, ls_sa-vtweg, ls_sa-spart, ls_sa-waers.
ENDLOOP.If the customer has general data but no KNB1 rows, the partner was created with FLCU01 only, or the company code dialog was never filled.
Reading the levels through the API
The released APIBUSINESSPARTNER service exposes the same levels as navigation properties. A business partner links to its customer, and the customer links to its company code and sales area entities.
GET /sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('1000123')?$expand=to_Customer/to_CustomerCompany,to_Customer/to_CustomerSalesArea
Accept: application/jsonThe mapping is:
| OData entity | Level | Table behind it |
|---|---|---|
| A_Customer | General | KNA1 |
| A_CustomerCompany | Company code | KNB1 |
| A_CustomerSalesArea | Sales area | KNVV |
Prefer the API over direct table reads when you build integrations. Only the API is released for extensions, and it respects the validations that CVI applies.
Common errors
- Missing level. The sales order screen rejects the sold-to party because no sales area row exists for that combination. Add the sales area in transaction BP under role FLCU01.
- Role present, data absent. Assigning a role creates the customer but does not create any company code or sales area rows. You must add them yourself.
- Editing KNA1 directly. Changes made straight to the classic tables are overwritten or rejected by CVI. Always change the business partner.
- Wrong account group. The grouping chosen at creation set it. If it is wrong, you usually need a new partner, because the grouping is fixed once saved.
Exercise
A business partner has role FLCU01 only, and sales orders for it work. Accounting reports that an invoice cannot be posted to the customer. Which level is missing, which role must be added, and which table will then contain the new rows?
Show answer
The company code level is missing. Add role FLCU00 (FI customer), then maintain the company code dialog with at least the reconciliation account and payment terms. The new rows are stored in KNB1, one per company code.
Exercise
You run the ABAP report with a customer number and it prints a business partner, no company code lines and two sales area lines. What does that say about the roles and the data on this partner?
Show answer
The customer was created through the customer role FLCU01, and sales area data was maintained for two sales area combinations. Either FLCU00 was never assigned, or it was assigned but no company code row was added. Either way KNB1 holds no rows for this customer.