SAP MDG · DATA MODEL UI
How do I extend the SAP MDG Business Partner data model with a custom Supplier entity using the Reuse Option?
Use the MDG BP reuse option to add a custom entity under BP_VENGEN, map it through a custom access handler, expose it in BUPA/GenIL and FPM, and persist activated data to a custom active table such as ZLFA1_EXT.
Use the MDG BP reuse option to add a custom entity under BP_VENGEN, map it through a custom access handler, expose it in BUPA/GenIL and FPM, and persist activated data to a custom active table such as ZLFA1_EXT.
This guide shows the standard SAP MDG reuse-option pattern for a custom Supplier/BP sub-node: define the entity in MDGIMG, generate the staging area, extend the standard API structures, expose the node in BUPA/GenIL, and persist the activated data to a custom active table through a dedicated access handler.
Process flow
- Create transparent table ZLFA1_EXT in SE11 with the key and custom fields.
- In MDGIMG, extend the BP data model with entity ZBP_SUPPL under BP_VENGEN.
- Set Storage and Use Type to 4 and Key Assignment to 3.
- Create the relationship with leading 1:1 cardinality.
- Create and append the API structures ZVMDS_EI_VMD_EXT_DATA and ZVMDS_EI_VMD_EXT_DATAX.
- Generate or regenerate the MDG staging structures.
- In GENIL_MODEL_BROWSER, add dependent object ZBP_SUPPL_EXT in component BUPA.
- Maintain the mapping in SM34 view cluster VC_MDG_BS_GENIL_C for BUPA to ZBP_SUPPL_EXT and ZBP_SUPPL.","Implement the access handler class inheriting from CL_MDG_BS_ECC_HANDLER.","Write the update-task persistence FM such as Z_BP_ZLFAL_EXT_U
SE11Dictionary > Transparent Table
Create the custom active table such as ZLFA1_EXT to hold activated Supplier/BP data.
MDGIMGGeneral Settings > Data Modeling > Edit Data Model
Define entity type ZBP_SUPPL, set Storage and Use Type 4, Key Assignment 3, and maintain the relationship under BP_VENGEN.
Component BUPA > Enhance > Dependent Objects / Relations
Create the GenIL dependent object ZBP_SUPPL_EXT and relate it to BP_Root.
SM34View Cluster VC_MDG_BS_GENIL_C > Component BUPA > Comp - GenIL - Node Customizing
Map external object ZBP_SUPPL_EXT to entity type ZBP_SUPPL.
Referenced tables
| Object | Purpose |
|---|---|
ZLFA1_EXT | Custom active-area transparent table for the activated Supplier/BP extension data. |
VC_MDG_BS_GENIL_C | View cluster used to maintain BUPA GenIL node customizing for the custom external object mapping. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example: SAP_S4HANA_Customer_Vendor_Integration_Cookbook.abap
Exact relevant implementation excerpt from the knowledge document set.
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 do I add a custom BP/Supplier sub-node in MDG using the reuse option?
- How do I configure a custom Supplier entity under BP_VENGEN in MDG?
- How do I persist custom BP Supplier fields from MDG staging to an active table?
Possible questions
- What is the MDG reuse option for custom BP fields?
- Which transaction codes are needed for BP entity extension in MDG?
- Which classes and methods are used for the custom access handler?
- How do I connect an FPM UIBB to a custom GenIL object in BUPA?
- How do I make the custom BP entity write to the active table on activation?