SAP MDG · DATA MODEL UI
How do I extend the SAP MDG Business Partner data model with a custom entity using the Reuse Option?
Extend the BP model in MDGIMG with a type 4 custom entity, relate it to the standard parent entity, generate the model, map it to GenIL and the UI, then move data through a custom access handler into an active Z table via an update-task function module.
Extend the BP model in MDGIMG with a type 4 custom entity, relate it to the standard parent entity, generate the model, map it to GenIL and the UI, then move data through a custom access handler into an active Z table via an update-task function module.
This guide uses the Reuse Option pattern to extend the SAP MDG Business Partner model with a custom entity such as ZBP_SUPPL under BP_VENGEN. The flow is FPM UI → BOL/GenIL BUPA → MDG staging (/1MD/) → custom handler class → API structures → update-task persistence into a custom active table.
Process flow
- Create the active-area table in SE11 with MANDT, the BP key field, and custom attributes.
- Open MDGIMG and navigate to General Settings -> Data Modeling -> Edit Data Model -> BP.
- Create the custom entity with storage type 4 and key assignment 3.
- Assign attributes from the custom field list.
- Create the relationship from the standard parent entity to the custom entity with the required cardinality.
- Validate the data model, activate it, and run background generation.
- Generate the data model-specific structures.
- Create the GenIL dependent object and relation in GENIL_MODEL_BROWSER under BUPA/BP_ROOT as needed by the design path in the guide notes and example pattern to expose the entity in UI/runtime context, then map it in SM34 via VC_MDG_BS_GENIL
MDGIMGGeneral Settings -> Data Modeling -> Edit Data Model -> BP
Create the custom entity, set storage type 4, key assignment 3, attributes, and relationship.
BOL/GenIL Model Browser
Create the dependent object and relationship for the custom BP entity.
SM34VC_MDG_BS_GENIL_C
Map the MDG entity to the GenIL dependent object.
Referenced tables
| Object | Purpose |
|---|---|
ZLFA1_EXT | Example custom active-area table for supplier/BP extension data. |
/1MD/* | Generated MDG staging tables for the custom entity. |
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 sub-node in MDG?
- What are the implementation steps for an MDG BP custom entity?
- How do I persist a custom BP entity to an active Z table in MDG?
Possible questions
- How do I add a custom BP sub-node in MDG?
- What are the implementation steps for an MDG BP custom entity?
- How do I persist a custom BP entity to an active Z table in MDG?
- Which GenIL object and handler class are used for a BP extension?
- How do I configure the UIBB for a BP custom entity?