SAP MDG · DATA MODEL UI
How do I map an employee vendor to Business Partner person category in SAP CVI?
Use the CVI mapping BAdIs: set the BP category to Person in `CVI_MAP_TITLE` when the vendor account group is `ZEMP`, and derive the BP number/grouping in `CVI_CUSTOM_MAPPER` method `MAP_VENDOR_TO_BP` from the employee personnel number (`LFB1-PERNR` / company data).
Use the CVI mapping BAdIs: set the BP category to Person in `CVI_MAP_TITLE` when the vendor account group is `ZEMP`, and derive the BP number/grouping in `CVI_CUSTOM_MAPPER` method `MAP_VENDOR_TO_BP` from the employee personnel number (`LFB1-PERNR` / company data).
For employee vendors, the cookbook pattern uses two CVI enhancements: CVI_MAP_TITLE to force the BP category to Person, and CVI_CUSTOM_MAPPER method MAP_VENDOR_TO_BP to derive the partner number and grouping from employee data. In the example, the vendor account group ZEMP is the trigger, and the BP grouping BPAB is assigned for the mapped Business Partner.
Process flow
- Identify employee vendors by account group `ZEMP` in vendor master data (`LFA1`).
- Implement `CVI_MAP_TITLE` and set `c_partner_category = bp_as_person` when the vendor is an employee vendor.
- Implement `CVI_CUSTOM_MAPPER~MAP_VENDOR_TO_BP` to read company data (`VMDS_EI_COMPANY_T` / `VMDS_EI_COMPANY`).
- Derive the BP key from the employee personnel number and assign `C_PARTNER-HEADER-OBJECT_INSTANCE-BPARTNER`.
- Assign BP grouping `BPAB` in `C_PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CONTROL-GROUPING`.
- Check for blank personnel number and handle duplicates or already-existing BPs.
- Validate BP number range / external number assignment and account-group mapping in CVI customizing.
- Test end-to-end vendor-to-BP synchronization in the CVI process.
Referenced tables
| Object | Purpose |
|---|---|
LFA1 | Vendor general data used to detect employee vendors by account group. |
LFB1 | Vendor company-code data; the example references `LFB1-PERNR` for the personnel number. |
VMDS_EI_COMPANY_T | CVI vendor company data table type used in `MAP_VENDOR_TO_BP`. |
VMDS_EI_COMPANY | CVI vendor company data structure used to read personnel number data. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1*---------------------------------------------------------------------*
2* Title : SAP S4HANA Customer Vendore Integration Cookbook
3*---------------------------------------------------------------------*
4* TAGS
5* SAP S/4HANA
6* CVI
7* CUSTOMER VENDOR INTEGRATION
8* BUSINESS PARTNER
9* HCM EMPLOYEE
10* EMPLOYEE VENDOR
11* CVI_MAP_TITLE
12* CVI_MAP_BP_CATEGORY
13* CVI_CUSTOM_MAPPER
14* MAP_VENDOR_TO_BP
15* BP CATEGORY PERSON
16* BP NUMBER ASSIGNMENT
17* EXTERNAL NUMBER RANGE
18* ACCOUNT GROUP ZEMP
19* BP GROUPING BPAB
20* LFA1
21* LFB1-PERNR
22* VMDS_EI_COMPANY_T
23* VMDS_EI_COMPANY
24*---------------------------------------------------------------------*
25
26*---------------------------------------------------------------------*
27* SOURCE EXAMPLE 1
28* BAdI: CVI_MAP_TITLE
29* Purpose: Set employee Vendor Business Partner category to Person
30*---------------------------------------------------------------------*
31data: lv_ktokk type ktokk.
32
33select single ktokk into lv_ktokk
34 from lfa1
35 where lifnr = i_vendor_id.
36if sy-subrc = 0 and lv_ktokk = ‘ZEMP’.
37 c_partner_category = bp_as_person.
38endif.
39
40*---------------------------------------------------------------------*
41* SOURCE EXAMPLE 2
42* BAdI: CVI_CUSTOM_MAPPER
43* Method: MAP_VENDOR_TO_BP
44* Purpose: Derive BP number from employee personnel number
45*---------------------------------------------------------------------*
46MAP_VENDOR_TO_BP
47
48 data: lt_company type VMDS_EI_COMPANY_T,
49 ls_company type VMDS_EI_COMPANY.
50
51 if I_VENDOR-CENTRAL_DATA-CENTRAL-DATA-KTOKK = 'ZEMP'.
52 lt_company = I_VENDOR-COMPANY_DATA-COMPANY.
53 loop at lt_company into ls_company where data-
54pernr ne space. "What if more than one Company Code?
55 concatenate 'EN' ls_company-data-pernr into C_PARTNER-HEADER-
56OBJECT_INSTANCE-BPARTNER. "What BP already exists?
57 C_PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CONTROL-GROUPING = 'BPAB'.
58 exit.
59 endloop.
60 endif.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I derive BP category Person for employee vendors during CVI synchronization?
- Which BAdI should I use to map employee vendor data to a person BP in SAP S/4HANA?
- How do I default BP number assignment and grouping for employee vendors in CVI?
Possible questions
- How do I map an employee vendor to Business Partner person category in SAP CVI?
- Which BAdI should I use to map employee vendor data to a person BP in SAP S/4HANA?
- How do I default BP number assignment and grouping for employee vendors in CVI?
- How do I implement MAP_VENDOR_TO_BP for employee vendors?
- How do I set BP category Person from vendor account group ZEMP?