Sub topic 11
One partner as both customer and supplier
This chapter covers how one business partner acts as a customer and a supplier at once. It assumes you know the earlier chapters on roles, groupings and number ranges, and that you know the Customer/Vendor Integration (CVI) basics. You should also know the customer data levels (general, company code, sales area) and the supplier data levels (general, company code, purchasing organization).
Why a dual role needs no duplicate
In SAP ERP, a company that bought from you and sold to you usually had two records: a customer in KNA1 and a vendor in LFA1. Address, tax numbers and bank details were maintained twice. The only link was an optional cross-reference (the vendor number in the customer record and the customer number in the vendor record), and it was easy to leave inconsistent.
In S/4HANA the business partner is the leading object. One partner holds the shared general data once. Roles decide which application data exists for it:
- A customer role adds customer data.
- A supplier role adds supplier data.
- Both roles on the same partner make it a customer and a supplier.
CVI then creates or updates the classic customer and supplier records in the background. These records are the ones sales, purchasing and accounting transactions still use.
Which roles make up the dual role
| Role | Meaning | Data it unlocks |
|---|---|---|
| `FLCU00` | FI customer | Customer company code data |
| `FLCU01` | Customer | Customer sales area data |
| `FLVN00` | FI vendor | Supplier company code data |
| `FLVN01` | Supplier | Supplier purchasing organization data |
You can combine these freely. A partner with FLCU00 and FLVN00 is a customer and supplier in accounting only. Adding FLCU01 and FLVN01 makes it usable in sales orders and purchase orders too.
What is shared and what is separate
Everything stored at business partner level is shared. Changing it once changes it for both sides. Data that belongs to the customer or supplier process stays separate.
| Shared (business partner level) | Separate (per role) |
|---|---|
| Name, search terms, language | Customer reconciliation account |
| Addresses and communication data | Supplier reconciliation account |
| Tax numbers and tax classification | Sales area data: pricing, shipping, incoterms |
| Bank details and payment cards | Purchasing data: order currency, incoterms |
| Identification numbers | Payment terms and payment methods per company code |
| Central block and deletion flag | Posting blocks and deletion flags per company code or organization |
Bank details are shared, but each side decides how to use them. For example, the customer's incoming payment method can use a bank account that the supplier's outgoing payment method also uses.
Creating the dual role
There are two common paths.
- Create with both roles. In transaction
BP, create the partner, then addFLCU00,FLCU01,FLVN00andFLVN01(or the subset you need). Fill in each role's data screens and save once. - Extend an existing partner. Open a partner that is already a customer, switch to change mode, and add a supplier role. Fill in the supplier data (company code, purchasing organization) and save. CVI creates the supplier record without touching the customer record.
Extending a partner is the more common case. A customer later becomes a supplier, or the other way round.
The same extension works through the API. Add the role first, then maintain the supplier data:
POST /sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartnerRole
Content-Type: application/json
x-csrf-token: <token fetched with a prior GET using x-csrf-token: fetch>
{
"BusinessPartner": "1000123",
"BusinessPartnerRole": "FLVN00"
}The partner number 1000123 is an example. A role alone does not create usable supplier data. Company code and purchasing organization data must follow before the supplier can be used in postings.
The number question
CVI assigns the customer and supplier numbers according to the number assignment settings you configure for the direction "business partner to customer" and "business partner to supplier". These settings link a grouping to a customer account group and a supplier account group.
The common design is that the customer number, the supplier number and the business partner number are all identical. Then a user who sees customer 1000123 knows that supplier 1000123 is the same company. That requires the number ranges to be set up consistently, which is covered in the configuration chapter.
When the numbers differ, nothing breaks technically. The link tables still tie the right records to the partner. Users just lose the shortcut of recognizing the company by number alone.
Customer-vendor clearing
The main business reason for a dual role is netting open items. If you owe a company money and it owes you money, you can clear receivables against payables. This needs:
- Both roles on the same business partner.
- The clearing indicators set in the company code data of both the customer and the supplier.
- The same company code on both sides.
Automatic payment runs can then net customer and supplier items for the partner. The business partner model makes the assignment reliable, because both sides are guaranteed to refer to the same legal entity.
Reading dual-role partners
A partner is a dual-role partner when it has entries in both link tables. This ABAP report lists some of them:
REPORT z_list_dual_role_partners.
SELECT b~partner, c~customer, v~vendor
FROM but000 AS b
INNER JOIN cvi_cust_link AS c
ON c~partner_guid = b~partner_guid
INNER JOIN cvi_vend_link AS v
ON v~partner_guid = b~partner_guid
WHERE b~type = '2'
INTO TABLE @DATA(lt_dual)
UP TO 10 ROWS.
cl_demo_output=>display( lt_dual ).Through the OData service, the same partners show up with both the Customer and Supplier keys filled:
GET /sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?$filter=Customer ne '' and Supplier ne ''&$select=BusinessPartner,BusinessPartnerFullName,Customer,Supplier&$top=5
Accept: application/jsonIf Customer and Supplier are equal to BusinessPartner in the results, your number alignment is working as designed.
Common errors
- Supplier role added, no supplier created. CVI needs a mapping from the partner's grouping to a supplier account group. Without it, saving fails with a synchronization error. Check the grouping assignment in configuration.
- Number already in use. The target supplier number is taken in the supplier number range. The save fails, or a different number is chosen, depending on the setup.
- Blocked on one side only. A posting block on the customer company code data does not stop supplier postings. Use the central block when you want to block the whole partner.
- Changed data not visible. Shared data shows up on both sides. Role-specific data does not. If a user cannot find a payment term, they are probably looking at the wrong role.
- Deleting one side. You can flag the customer side for deletion without touching the supplier side. Archiving the partner as a whole needs both sides to be free of open items and dependent documents.
Exercise
A company is already a business partner with roles FLCU00 and FLCU01. Purchasing wants to order from it. Which roles do you add, what data must be filled in afterwards, and how can you confirm in the system that the partner is now also a supplier?
Show answer
Add FLVN00 (FI vendor) for accounting and FLVN01 (supplier) for purchasing. Afterwards fill in the supplier company code data (for example reconciliation account and payment terms) and the purchasing organization data. To confirm the result, check that the partner has an entry in CVIVENDLINK, for example with the join on BUT000 and CVIVENDLINK, or read the partner through APIBUSINESSPARTNER and check that the Supplier field is filled.
Exercise
Customer 5000 and supplier 5000 exist in the legacy system as two different companies. Can both be turned into a single business partner with the same number for all three objects? Explain.
Show answer
No. They are different companies, so they must become two separate business partners. At most one of them can keep the number 5000 across business partner, customer and supplier. The other needs a new number, and references to its old number must be mapped during migration.