Sub topic 5
Roles that turn a partner into a customer or supplier
This chapter assumes you know the business partner categories from the previous chapter. It also assumes you can read basic ABAP and HTTP requests, and that you know customer and vendor master data in classic SAP ERP. It explains what a role is, which roles make a partner a customer or supplier, and which errors come from missing roles.
A role is a business context for a partner
A business partner is a general record: a name, an address, bank details and other data that does not depend on how you do business with the partner. A role adds a business context to that record. It decides which data screens (tabs) appear in transaction BP. It also decides which application can use the partner and which extra data you must maintain.
One partner can hold many roles at the same time. The partner keeps one number and one set of general data, whichever roles are assigned. Each role assignment is a row in table BUT100, with the partner number, the role key and a validity period. The role definitions themselves are in table TB003.
A role does not create a second partner. It switches on a context for the partner you already have.
The roles that matter for customers and suppliers
| Role | Name in transaction BP | What it enables |
|---|---|---|
| 000000 | Business Partner (Gen.) | General data only. No customer or supplier exists. |
| FLCU00 | FI Customer | Customer company code data, such as reconciliation account and payment terms. Required for accounting postings. |
| FLCU01 | Customer | Customer sales area data, such as sales organization, distribution channel, division and shipping. |
| FLVN00 | FI Vendor | Supplier company code data, such as reconciliation account and payment methods. |
| FLVN01 | Supplier | Supplier purchasing data per purchasing organization. |
The names in your system can differ slightly by release or language. The keys are the stable part.
FLCU00 and FLCU01 are separate roles because the classic customer master already had separate accounting and sales views. They map to the same customer number. The same applies to FLVN00 and FLVN01 on the supplier side.
From role to customer record
The business partner and the classic customer or supplier are separate database objects. Customer/Vendor Integration (CVI), covered in a later chapter, keeps them in sync. Roles trigger it.
When you save a partner with a customer role, CVI creates the customer record in the classic customer tables, such as KNA1. It also stores the link in the CVI link tables. When you save a partner with a supplier role, it creates the supplier record in LFA1 in the same way.
The customer and the supplier are created only if a role of that kind exists. A partner with only role 000000 never appears in customer or supplier lists.
Combining roles
Roles are additive. Common combinations:
- Customer for sales and billing. Assign FLCU00 and FLCU01. FLCU01 alone gives you sales area data, but the customer has no company code data and cannot be posted to.
- Supplier for purchasing and payment. Assign FLVN00 and FLVN01. A supplier with only FLVN01 can be named on a purchase order but cannot be paid.
- Accounting-only partner. Assign only FLCU00 or FLVN00. This is common for one-time or internal counterparties that never get a sales area or purchasing organization.
- Customer and supplier at once. Assign roles from both sides. The next chapters cover this case in detail.
You add roles to an existing partner. You do not create a new partner.
Adding a role in transaction BP
- Open transaction BP and display the partner, or create a new one.
- Switch to change mode.
- In the field "Change in BP role" (or the role selection on the toolbar), choose the role to add, for example FI Customer.
- SAP shows the role-specific tabs, such as Customer: Company Code Data. Fill in the required fields.
- Save. CVI creates or updates the classic customer record in the same transaction.
If the role selection does not offer a role, the role may not be allowed for the partner's grouping or category. See the callout below.
Role validity and role categories
A role assignment has a valid-from and valid-to date. If a role has ended, the partner no longer acts in that role from that date. Applications that check the role will treat the partner as unavailable. This often explains a partner that "was a customer last year" but cannot be selected today.
Each role also belongs to a role category. The category is a technical grouping that CVI and the screen sequence use. For customers and suppliers, the role category is what links a role to the customer or supplier processing, not the role's description text. When you define custom roles, assign them a category that matches their purpose. Otherwise CVI will not treat the partner as a customer or supplier. Role customizing is covered in the configuration chapter.
Reading roles with ABAP
This report lists partners that hold a customer role, together with the roles they hold.
REPORT z_list_customer_roles.
SELECT partner, rltyp
FROM but100
WHERE rltyp IN ( 'FLCU00', 'FLCU01' )
ORDER BY partner, rltyp
INTO TABLE @DATA(lt_roles)
UP TO 20 ROWS.
cl_demo_output=>display( lt_roles ).A partner that appears with FLCU01 but not FLCU00 is a candidate for the "customer cannot be posted to" problem described above.
Reading and adding roles through the API
The released OData service APIBUSINESSPARTNER exposes roles as a navigation property of the partner. This request reads the roles of one partner.
GET /sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('1000123')/to_BusinessPartnerRole
Accept: application/jsonYou can add a role to an existing partner by posting to the same navigation property. Fetch a CSRF token first, as with any write call.
POST /sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('1000123')/to_BusinessPartnerRole
Content-Type: application/json
x-csrf-token: <token fetched with a prior GET using x-csrf-token: fetch>
{
"BusinessPartnerRole": "FLCU01"
}The partner number 1000123 is an example. When you create a new partner, you can include the roles in the same request, as in the creation example in the API chapter.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Partner is not found in customer or supplier searches | Only role 000000 is assigned | Add FLCU00, FLCU01, FLVN00 or FLVN01 as needed |
| Invoice cannot be posted to the customer | FLCU00 is missing, so company code data is missing | Add FLCU00 and maintain company code data |
| Sales order rejects the customer | FLCU01 is missing, or the sales area is not maintained | Add FLCU01 and extend the sales area |
| Role is not offered in transaction BP | Role not allowed for the grouping or category, or authorization is missing | Check customizing and authorization |
| Role exists but the partner is unusable | Role validity period has ended | Extend the validity date |
| Role exists in BUT100 but no customer record exists | Role was inserted without CVI, or CVI failed | Check CVI status, as covered in the troubleshooting chapter |
Key points
- A role is a business context. It does not create a new partner.
- FLCU00 and FLCU01 make a partner a customer. FLVN00 and FLVN01 make it a supplier.
- Accounting data comes with the FI roles. Sales and purchasing data comes with the other two.
- Saving a role that belongs to a customer or supplier category triggers CVI, which creates the classic record.
- Roles have validity dates and can be limited by customizing and authorization.
Exercise
A partner has only the role FLCU01. A user tries to post an invoice to this customer and gets an error that company code data is missing. What is wrong, and how do you fix it?
Show answer
The partner has the Customer role, which holds sales area data, but not the FI Customer role FLCU00, which holds company code data. In transaction BP, add the role FLCU00 and maintain the company code data, such as the reconciliation account. After saving, CVI updates the classic customer record with the company code data, and the posting can proceed.
Exercise
You find a partner that has role 000000 only, yet a colleague expects it to appear in the supplier list. Name two ways to check the roles of this partner and one way to make it a supplier.
Show answer
Check the roles in transaction BP in the role selection, or select from table BUT100 for the partner number. Alternatively, read toBusinessPartnerRole through APIBUSINESS_PARTNER. To make it a supplier, add FLVN00 (and FLVN01 if purchasing is needed) in transaction BP, or post the role through the API, then save so CVI creates the supplier record.