0% found this document useful (0 votes)
488 views

How-To Extend Master Data Governance For Material by A New Entity Type (Custom Z-Table, Reuse Option) V9.0

This document provides instructions for extending the preconfigured MDG-M data model to add a new entity type called "Business Partner Details" to store business partner nicknames for materials. It describes creating the necessary DDIC objects, extending the MDG BS MAT access class, creating SMT mappings, and extending the user interface. The goal is to reuse existing database fields to save the attribute values of the new entity type after approval in MDG-M change requests.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
488 views

How-To Extend Master Data Governance For Material by A New Entity Type (Custom Z-Table, Reuse Option) V9.0

This document provides instructions for extending the preconfigured MDG-M data model to add a new entity type called "Business Partner Details" to store business partner nicknames for materials. It describes creating the necessary DDIC objects, extending the MDG BS MAT access class, creating SMT mappings, and extending the user interface. The goal is to reuse existing database fields to save the attribute values of the new entity type after approval in MDG-M change requests.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

PUBLIC

How-To: Extend MDG-M by a New Reuse Entity


Type

Applicable Releases:
From EhP6 for SAP ERP 6.0 and from S/4HANA 1511

Version 9.0
June 2023
Document History

Document Version Description

1.0 First official release of this guide (April 2012)


7.0 Update (June 2016)
8.0 Update (October 2022)
9.0 Small updates (June 2023)

© 2023 SAP SE or an SAP affiliate company. All rights reserved. See Legal Notice on www.sap.com/legal-notice for use terms, disclaimers, disclosures, or restrictions related to SAP Materials for general audiences.
How-To: Extend MDG-M by a New Reuse Entity Type

1. BUSINESS SCENARIO ............................................................................................................................................4


2. PREREQUISITES ............................................................................................... ERROR! BOOKMARK NOT DEFINED.
3. SCENARIO ............................................................................................................................................................5
4. BACKGROUND INFORMATION .............................................................................................................................5
4.1. DATA MODELING CONCEPTS IN MDG ....................................................................................................................6
4.1.1. Storage and Use Types...........................................................................................................................6
4.1.2. Relationship Type...................................................................................................................................8
4.2. REUSE AREA VERSUS THE FLEXIBLE OPTION ...............................................................................................................8
4.3. INPUT HELP (ACCESSIBLE USING THE F4 KEY) .......................................................................................................... 11
4.4. CODE LISTS..................................................................................................................................................... 12
4.5. DATA MODELING CONSIDERATIONS FOR LIST-UIBBS ................................................................................................ 12
4.6. UI: ADAPTATION OPTIONS IN FLOORPLAN MANAGER ................................................................................................ 12
5. STEP BY STEP EXPLANATION .............................................................................................................................. 14
5.1. PREPARE MDG-M API ..................................................................................................................................... 14
5.1.1. Create DDIC Objects ............................................................................................................................. 14
5.1.2. Extend MDG BS MAT (Material Master Data Structure)......................................................................... 18
5.1.3. BAdI: Extension of the API with Customer-Specific Segments ................................................................. 20
5.1.4. BAdI Implementation: READ Method .................................................................................................... 24
5.1.5. BAdI Implementation: CHECK_AND_SAVE Method ................................................................................ 25
5.1.6. BAdI Implementation: GET_ES_NODEINFO Method............................................................................... 27
5.2. MDG DATA MODEL EXTENSION .......................................................................................................................... 27
5.2.1. Extend MDG Data Model...................................................................................................................... 28
5.2.2. Generate Model-Specific Structures ...................................................................................................... 34
5.2.3. Clear UI Metadata Buffers .................................................................................................................... 35
5.3. CREATE SMT-MAPPING .................................................................................................................................... 36
5.3.1. Create Mapping Entries in Customizing ................................................................................................. 36
5.3.2. Map the Active Area to the Staging Area .............................................................................................. 37
5.3.3. Map the Staging Area to the Active Area .............................................................................................. 40
5.4. ADJUST STAGING AREA OF LINKED CHANGE REQUESTS .............................................................................................. 42
5.5. EXTEND USER INTERFACE ................................................................................................................................... 44
5.5.1. Create FPM List UIBB............................................................................................................................ 44
5.5.2. Add List UIBB to Material UI ................................................................................................................. 51
5.5.3. Clear UI Metadata Buffers .................................................................................................................... 54
6. TESTING YOUR DATA MODEL EXTENSION ........................................................................................................... 56
7. ADDITIONAL INFORMATION .............................................................................................................................. 57
7.1. FURTHER READING ........................................................................................................................................... 57
7.2. SAP NOTES.................................................................................................................................................... 57

3
How-To: Extend MDG-M by a New Reuse Entity Type

1. Business Scenario
SAP Master Data Governance for Material (MDG-M) provides business processes to find, create, change,
and mark material master data for deletion. It supports the governance of material master data on a central
hub and the distribution of material master data to connected operational and business intelligence
systems.
The processes are workflow-driven and can include several approval and revision phases, and the
collaboration of all users participating in the master data maintenance.
Domain-specific content (data models, user interfaces, workflows) is provided as part of the standard for
several application areas. It is a common requirement from customers to adapt the MDG data models to their
specific needs.
The model MM is preconfigured with one reuse area called MATERIAL. This reuse area points to the access
class CL_MDG_BS_MAT_ACCESS, which can handle most fields of the pre-delivered Material Master in ERP
or S/4HANA.
This guide describes how to extend the preconfigured content of Master Data Governance for Material (using
the data model MM) by adding a new entity type that already exist as database fields. The attribute values of
the new entity type will be copied to the corresponding customer tables (reuse option) after activation of the
change request by using BAdI MDG_BS_MAT_API_SEGMENTS_EXT.

4
How-To: Extend MDG-M by a New Reuse Entity Type

2. Scenario
The following explanation shows you how to add the new entity type Business Partner Details to save
Business Partner nicknames for materials as part of the MDG-M data model

Figure: Data Model – Material (Scope of 2011 Delivery) with custom entity type “Business Partner Details”

3. Background information
In MDG, the data model is a central part of the application. SAP delivers several preconfigured data models
that you can start using with little configuration.

Looking at the Material object type and its related data in an abstract way, you can distinguish the following
categories of data fields:
• Identifying Material Data ~ 10 fields
• Descriptive Material Data ~ 100 fields
• Process Controlling Material Data ~ 1.000 fields
MDG for material data focuses on the main identifying, descriptive attributes and process controlling data of
the Material Master.
It is important to understand that MDG not only delivers the data fields in a model, but also comes with the
standard business rules to check for completeness and consistency. These checks are only enforced when
necessary in the process.

The delivered standard data model is MM. (This model is linked to the material business object ID: 194. It is
also linked to the change request business object type: BUS2550.). You can view the SAP delivered data
model in Customizing for Master Data Governance under General Settings > Data Modeling > Edit Data
Model.

The MM data model content for the different releases can be found in SAP Note 3134600.

5
How-To: Extend MDG-M by a New Reuse Entity Type

Additional Information:
• A BAdI is available for data enhancement during change request activation
(MDG_BS_MAT_API_ENRICH)
• Authorization Concept: Depend on the reuse of backend logic and pre-delivered roles defined in
PFCG
• Field control: visibility and mandatory fields are controlled with the field control feature that re-uses the
backend logic and existing settings (T130F).

3.1. Data Modeling Concepts in MDG


The meta-model below shows the basic elements making up a MDG data model. When you extend the data
model by a new entity type you must also define its relationship to other data model elements and decide on
a storage and use type for the new entity type. In the following sections you will find more details regarding
these topics.

Figure: The meta model is an entity-relationship-model

3.1.1. Storage and Use Types


You assign storage and use type to specify whether and how master data can be changed in Master Data
Governance. The storage and use type also indicates which database tables are generated by the system.

Changeable via The master data of this storage and use type can be changed in Master Data
Change Request; Governance with a change request. The system generates all necessary
Generated Database database tables: check and text tables as well as additional tables, for
Tables (Type 1) example, for attachments and sets. The common key fields of these tables
are:

• The entity type itself


• The edition – if you previously specified in the data model that the
validity of master data changes is restricted to editions
• The entity types that are assigned to the entity type through leading
relationships

Furthermore, all tables contain a checkbox that indicates whether the master
data record is active. Depending on the workflow template used, it is possible
that a master data record is not set to active until the change request in which
the record was created or changed is released.

The settings you make for the entity type (such as language dependency)
result in additional key fields in the text table and the tables for attachments and

6
How-To: Extend MDG-M by a New Reuse Entity Type

sets.

The non-key fields contained in the text table are the entity texts. The non-key
fields contained in the check table are the attributes of the entity type. The
attachment and set tables contain predefined non-key fields. Furthermore, all
database tables contain a checkbox that indicates whether the master data record
was deleted. The check table also contains attributes that record which user
created or changed the data records and when this was done.
Changeable without The master data of this storage and use type can be changed in Master Data
Change Request; Governance without a change request. The system generates only the check
Generated and text tables with the entity type as well as with the entity types assigned to
Check/Text Tables the entity type through leading relationships as fixed key fields.
(Type 2)
The non-key fields contained in the text table are the entity texts. The check table
does not contain non-key fields.
The master data of this storage and use type cannot be changed in Master Data
Not Changeable via
Governance. Therefore, the system does not generate database tables. Instead,
MDG; No Generated
the system derives the available values from the domain that is assigned to the
Tables (Type 3)
data element – either from the assigned value table or from the domain fixed
values
The master data of this storage and use type can be changed in Master Data
Changeable via Other
Governance only with a change request of an entity type with storage and use type
Entity Type;
1. The entity type needs to be in a relationship with the relationship type leading
Generated Database
and assigned as the To-Entity type to an entity type with storage and use type 1.
Tables (Type 4)
The system generates the check table as described for storage and use type 1,
but also generates the entity types that are assigned through qualifying
relationships as key fields. The system does not generate a text table,
attachments, or sets since entity texts are not allowed for entity types with this
storage and use type.

You can view the settings for storage and use type for existing entity types in Customizing for
Master Data Governance under General Settings > Data Modeling > Edit Data Model. You
select the MM data model and double click on Entity Types (view cluster VC_USMD001). In the
list of entity types you can double click an entity type to view its details as shown below for
entity type MATERIAL.

The table below gives you some criterions for the decision between storage and use type 1 and 4.
Criterion Type1 Type4
Cross-dependencies Need to handle dependencies Easy to implement
between Type1 entities (include
into CR, blocking, …)
Parallel CRs Not needed Necessary if two Type4 entities for same Type1
entity shall be maintained independently
Snapshot Independent Together with corresponding Type1 entity and all
other Type4 entities ( Performance)
Enqueue This entity plus corresponding This entity, corresponding parent entity and all its
Type4 entities child entities
Authorization Own authorization objects Depends on authorization object of Type1 entity
(plus maybe additional own ones)
Implementation effort Own access class BAdI MDG_BS_MAT_API_SEGMENTS_EXT (lean, no
CD mapping, enqueue, Query, …) or own access
class
Mass Maintenance OK Not possible (exception: 1:1 Relationship)

7
How-To: Extend MDG-M by a New Reuse Entity Type

Multi-Record Processing No difference

Important
For more complex requirements like search, mapping, change documents, field properties,
authorization, locks or derives, you need to provide an own access class by implementing
interface if_usmd_pp_access instead of using MDG_BS_MAT_API_SEGMENTS_EXT BAdI.
This guide only describes the usage of the BAdI MDG_BS_MAT_API_SEGMENTS_EXT.

3.1.2. Relationship Type


If you have defined multiple entity types, you can determine what type of relationship should
link them (leading, referencing, qualifying, or foreign key relationship). For each relationship,
you specify a relationship type and cardinality.

Relationship Type Definition


Referencing Specifies the From-Entity type as an attribute of the To-Entity type.
Leading Specifies the From-Entity type on a higher level than the To-Entity type.
The From-Entity type is automatically taken as the key in the generated
tables. A Leading relationship type is identical to a Qualifying relationship
type, except when the To-Entity type has a Storage and Use Type of 4.
Master data for To-Entity types in Leading relationships is processed in the
context of the entity type that is assigned using the leading relationship.
Qualifying Specifies the From-Entity type on a higher level than the To-Entity type.
The From-Entity type is automatically taken as the key in the generated
tables.

The following options are possible for the relationship between two entity types:
Cardinality Definition

1:N This cardinality represents a mandatory relationship in which one or more


To-Entity Types can be assigned to a From-Entity Type.
This cardinality is valid for relationships with the relationship types Leading,
Qualifying, and Referencing. In relationships with the relationship type
referencing, the From-Entity Type is a required attribute of the To-Entity
Type.

0:N This cardinality represents an optional relationship in which any number To-
Entity Types can be assigned to a From-Entity Type.

Note
Which relationship types are permitted depends on the storage and use types of the entity types. The
general design assumption is that there is a 1:N relationship between a database table and its entity
types. This means one entity type does not bundle several database tables.

3.2. Reuse Area Versus the Flexible Option


When you extend the SAP delivered data model with a new entity type, you must decide where
to store data after the activation of a change request. During the processing of the change
request, the system stores data in the MDG staging area. After the activation of a change
request, you can move the data to tables outside of MDG or keep the data in the MDG tables.

8
How-To: Extend MDG-M by a New Reuse Entity Type

For optimal integration into SAP Business Suite, MDG provides the following two persistence modes:
• Generated active area (flex mode): Tables as defined in the MDG data model are
used to store active data.
• Reuse active area (re-use mode): Existing structures of applications are used. For
example, MDG for material makes use of the MARA table.

Figure: Flexibility Option (left) versus Reuse Option (right)


Where the data is stored is specified by the Reuse Area setting on the Data Model or Entity
Type level as shown in the screenshots below.

Figure: Assignment of Reuse Area for the Data Model MM

9
How-To: Extend MDG-M by a New Reuse Entity Type

Figure: Assignment of Access Class for Reuse Area MATERIAL

Figure: Alternative assignment of Reuse Area on Entity Type level


The MDG model MM is preconfigured with one reuse area called MATERIAL. This reuse area
points to the access class CL_MDG_BS_MAT_ACCESS, which can handle all fields of the pre-
delivered data model and some more.

10
How-To: Extend MDG-M by a New Reuse Entity Type

If you extend the data model by a new entity type and want the data of that entity type to remain
in the MDG tables after activation you can choose MDG as a reuse area.

The table below gives you some criterions for the decision between flex or reuse mode.

Criterion Flex Reuse (Z table)


Direct Update of Active Not possible Possible and used in
Area (for migration, …) IDoc/DIF/LSMW/API/…
DIF usage Not recommended for MDG-M OK
(can’t write to active area)
SOA Not recommended for MDG-M OK
(can’t write to active area)
Access/usage in Dynamic tables, access only via Can be tuned via indices, view
productive applications (in IF_USMD_MODEL_EXT-> definition possible and transportable,
co-deployment) like READ_CHAR_VALUE (or …
complex select), no indices on DB
• Search level
• Typed read access
• …
Performance in • Flex entities need no snapshot • Reuse entities need
maintenance (and snapshot comparison) snapshot
• Number of records in active • Number of records in reuse
area has impact on active area has no impact
performance on performance
Project effort No additional coding required (plus Coding needed – either
optional additional checks, feeder implementation of BAdI
class, …) MDG_BS_MAT_API_SEGMENTS_EXT or
specific access class
Use case Co-Deployment: Stays in MDG, no Co-Deployment: Needs to be
need to access data operatively accessed by operative processes.
Both deployments: Take existing
data/extensions under
governance.
Both deployments: Data import must
be done without CR for performance
reasons (or no governance for
migration/import needed).
File Upload No difference (updates only staging)
Mass Maintenance/Multi- No difference
Record Processing
DRF usage No difference

3.3. Input Help (Accessible Using the F4 Key)


The system applies the following rules of precedence when assigning input help:
1. Search help assignment in data model definition
2. Backend structure MDG_BS_MAT_S_MARA, MDG_BS_MAT_S_* (not existing for Flex Entities)
a. Search help assignment in the structure
b. Value table on domain with foreign key association

11
How-To: Extend MDG-M by a New Reuse Entity Type

3. Search help assignment on data element (for flex entities)


4. Fixed values or value table on domain

Note
Value table on domain without foreign key assignment (for flex entities) is not supported out of the
box.

3.4. Code Lists


The considered code list for the check comes from the Fixed Values or Value Range table
which is assigned to the domain of the data element.

3.5. Data Modeling Considerations for List-UIBBs


If you want the Material UI to use two or more list UIBBs (User Interface Building Blocks), you must adjust the
data model. You can implement independent list UIBBs or interdependent list UIBBs. For more information,
see the table below.

UIBB Desired System Behavior Action


Independent Changes to one list UIBB have no Create separate entity types and assign
List UIBBs impact on the other list UIBB. one to each List- UIBB.
Interdependent If you create a new row for the same Either assign the same entity type for both
List UIBBs key in one UIBB, the system creates a List-UIBBs or implement a derivation.
new row in the other UIBB.

3.6. UI: Adaptation Options in Floorplan Manager


A Floorplan Manager UI can be adapted using different techniques. The figure below shows the
relationship between configuration, customizing, and personalization. Context-Based-
Adaptation is another way the user interface can be customized for specific use cases.

In the context of MDG, you typically choose to customize the SAP delivered configuration.
Only if customizing is not feasible do you copy the SAP delivered UI configuration to the

12
How-To: Extend MDG-M by a New Reuse Entity Type

customer namespace and change the copy.


In the following cases the UI should be copied rather than customized:
• Code changes are required
• The UI needs to be changed for all users in the system and not only client-specific
• The changes to the UI are extensive

Note
For more details regarding options for Floorplan manager user interface adaptation, advantages,
disadvantages, and steps required please familiarize yourself with SAP Note 1619534. See also How To Guide
for the UI Extend MDG-M User Interface.

13
How-To: Extend MDG-M by a New Reuse Entity Type

4. Step by Step Explanation


Two major building blocks make up the implementation of the entity type extension. In the first phase, you
extend the data model. In the second phase, you extend the user interface to include the new entity type.
The flow diagram below shows the detailed implementation steps. We recommend you use it as an
orientation. Each box in the diagram below corresponds to a section in this guide in which you find detailed

execution instructions.
Figure: Implementation steps for re-use Entity-Type extension

4.1. Prepare MDG-M API

4.1.1. Create DDIC Objects


In this section you create the table and structure that you use to store master data after activation in MDG.
After activation data will be transferred from the MDG staging area to the table that you define in the
following steps.

14
How-To: Extend MDG-M by a New Reuse Entity Type

In transaction SE11
1.
create table
YMDGM_BUPA00 as
shown.

In transaction SE11
2.
create structure
YMDGM_BUPA01_S
as shown.

In transaction SE11
3.
create table type
YMDGM_BUPA01_T
as shown.

15
How-To: Extend MDG-M by a New Reuse Entity Type

Make sure table type


4.
YMDGM_BUPA01_T is
a Sorted Table.

Make sure table type


5.
YMDGM_BUPA01_T
uses the keys as
shown.

In transaction SE11
6.
create structure
YMDGM_BUPA01_S_
X as shown.

Note:
DELETE_ROW
indicates that this row
shall be deleted

16
How-To: Extend MDG-M by a New Reuse Entity Type

In transaction SE11
7.
create table type
YMDGM_BUPA01_T_X
as shown.

Make sure table type


8. YMDGM_BUPA01_T_X
is a sorted table.

17
How-To: Extend MDG-M by a New Reuse Entity Type

Make sure table type


9.
YMDGM_BUPA01_T_X
has the key fields as
shown.

4.1.2. Extend MDG BS MAT (Material Master Data Structure)


Start transaction SE11.
1.
Enter
MDG_BS_MAT_S_MA
T_DATA as shown.

Choose Display.

18
How-To: Extend MDG-M by a New Reuse Entity Type

Create a new Append.


2.

Enter the Append


3.
Name as shown.

Enter the append


4.
component details as
shown.

19
How-To: Extend MDG-M by a New Reuse Entity Type

Save your changes


5.
and make sure that
the append appears
in structure
MDG_BS_MAT_S_MA
T_DATA as shown.

Important naming
convention:

<Tablename>_TAB
for the data part and
<Tablename>_X_TAB
for the change structure
with <Tablename>
being the name of the
database table you
want to put under
governance.
From MDG 9.0:
6.
Repeat step 1-5 for
backend structure
CMD_BS_MAT_S_
MAT_DATA.

4.1.3. BAdI: Extension of the API with Customer-Specific Segments

In MDG customizing
1.
start the selected
entry as shown.

20
How-To: Extend MDG-M by a New Reuse Entity Type

Create a new BAdI


2.
implementation for
MDG_BS_MAT_API
_SEGMENTS_EXT

Enter the name of


3.
the Enhancement
Implementation as
shown.

Enter further details


4.
for the BAdI as
shown in the
screenshot.
Remark:
The screen shot
shows
ZMDG_BS_MAT_API
_BP01_IMPL and
ZCL_MDG_BS_MAT_
API_BP01_IMPL.
Please use
ZMDG_BS_MAT_API
_BP00_IMPL and
ZCL_MDG_BS_MAT_
API_BP0_IMPL
instead to be in sync
with the following
screen shots.
Check your
5.
Enhancement
Implementation
details look similar to
the screenshot.

21
How-To: Extend MDG-M by a New Reuse Entity Type

Create a new filter


6.
entry.

Enter the filter value


7.
YMDGM_BUPA01_S

4.1.3.1 Creating a Selection-Range Table

22
How-To: Extend MDG-M by a New Reuse Entity Type

The IS_SELECTION
1.
parameter contains
the material selection
criteria for which the
database select must
be executed.
The selection criteria
always contain the
MATNR and possibly
additional key fields
of the customer-
specific database
table.

In case you have key


fields in your
customer-specific
table you must
append
MDG_BS_MAT_S_MA
T_SELECTION by
your key-fields.

This is shown in the


next step.
Start transaction
2.
SE11.
Create the structure
YBUPA_GUID_S_RAN
GE that looks like
shown in the screen
shot.

Start transaction
3.
SE11.
Create the range table
type that looks like
shown in the screen
shot.

23
How-To: Extend MDG-M by a New Reuse Entity Type

Start transaction
4.
SE11.

Open structure
MDG_BS_MAT_S_MA
T_SELECTION.
Create an append
called
ZMDG_BS_MAT_RANG
E which has a
component called
BUPA_ID_RANGE of
component type
YBUPDA_GUID_T_RA
NGE.
The APPEND structure
is shown and the
structure
MDG_BS_S_MAT_SEL
ECTION

It is vital that the component name of the append adheres to the naming standard
<KEY-FIELDNAME OF BACKEND TABLE>_RANGE.
In our case the backend table is YMDGM_BUPA00 and the key-fieldname is
BUPA_ID therefore the component name is BUPA_ID_RANGE.

4.1.4. BAdI Implementation: READ Method


METHOD if_mdg_bs_mat_api_segments_ext~read.
DATA: lt_mdgm_bupa TYPE ymdgm_bupa01_t.
CLEAR: et_data, et_message.
SELECT * FROM ymdgm_bupa00 INTO CORRESPONDING FIELDS OF TABLE
lt_mdgm_bupa WHERE matnr IN is_selection-matnr_range
AND bupa_id IN is_selection-bupa_id_range.
INSERT LINES OF lt_mdgm_bupa INTO TABLE et_data.
ENDMETHOD.

24
How-To: Extend MDG-M by a New Reuse Entity Type

4.1.5. BAdI Implementation: CHECK_AND_SAVE Method

25
How-To: Extend MDG-M by a New Reuse Entity Type

METHOD if_mdg_bs_mat_api_segments_ext~check_and_save.

DATA: ls_data TYPE ymdgm_bupa01_s.


DATA: ls_data_x TYPE
ymdgm_bupa01_s_x.
DATA: ls_message TYPE mdg_bs_mat_s_mat_msg.
DATA: lt_modify TYPE STANDARD TABLE OF ymdgm_bupa00.
DATA: ls_modify TYPE ymdgm_bupa00.
DATA: lt_delete TYPE STANDARD TABLE OF ymdgm_bupa00.
DATA: ls_delete TYPE ymdgm_bupa00.

CLEAR et_message.
 First some checks
LOOP AT is_data-ymdgm_bupa00_tab INTO ls_data.
" All fields must be filled, otherwise MESSAGE e000(00) WITH ls_data-
matnr ls_data-bupa_id ls_data-nickname.
IF ls_data-matnr IS INITIAL OR ls_data-bupa_id IS INITIAL OR ls_data-
nickname IS INITIAL.
ls_message-msgid = '00'.
ls_message-msgno =
'000'. ls_message-msgty
= 'E'.
ls_message-msgv1 = 'Empty value detected in:
'. ls_message-msgv2 = ls_data-matnr.
ls_message-msgv3 = ls_data-bupa_id.
ls_message-msgv4 = ls_data-nickname.
INSERT ls_message INTO TABLE
et_message.
ENDIF.
" BuPa must
exist
" ...
ENDLOOP.
 In test mode, we're finished now
CHECK iv_test_mode =
abap_false.
 Determine which records to delete or to insert/update
LOOP AT is_data-ymdgm_bupa00_x_tab INTO ls_data_x.
IF ls_data_x-delete_row = abap_true. " Keep key fields for deletion
ls_delete-matnr = ls_data_x-matnr.
ls_delete-bupa_id = ls_data_x-
bupa_id. INSERT ls_delete INTO TABLE
lt_delete.
ELSE.
READ TABLE is_data-ymdgm_bupa00_tab INTO
ls_data WITH TABLE KEY matnr = ls_data_x-
matnr
bupa_id = ls_data_x-
bupa_id.
ASSERT sy-subrc = 0. " No _x record without data record
MOVE-CORRESPONDING ls_data TO
ls_modify. INSERT ls_modify INTO TABLE
lt_modify.
ENDIF
.
ENDLOOP
.
 Now change the DB
 Note: In a productive implementation, these DB changes must be done ON
COMMIT (PERFORM xxx ON COMMIT or CALL FUNCTION xxx IN UPDATE TASK)
 * Note: We are basically ignoring the _X structure here - if data gets
changed, all fields get updated
IF NOT lt_delete IS INITIAL.
DELETE ymdgm_bupa00 FROM TABLE lt_delete.
26
ENDIF.
IF NOT lt_modify IS INITIAL.
MODIFY ymdgm_bupa00 FROM TABLE lt_modify.
How-To: Extend MDG-M by a New Reuse Entity Type

4.1.6. BAdI Implementation: GET_ES_NODEINFO Method


Implement GET_ES_NODEINFO method if you have extended the enterprise search model
MATERIAL. See also extensibility guides for the Search:
https://community.sap.com/topics/master-data-governance/how-to#central-governance-of-
material-data.
With this method you get the node name in the Enterprise Search template for the given
customer-defined database table with parameters ET_ES_NODENAME.

4.2. MDG Data Model Extension


In this section you will extend the MDG data model with the entity type YBUPA01. The entity
type has one attribute NICKNAME and one qualifying relationship to entity type YBUPA.
YBUPA01 will have two key fields MATERIAL and YBUPA. For details of the data model
extension refer to the figure below.

Figure: Data Model details for extension

27
How-To: Extend MDG-M by a New Reuse Entity Type

4.2.1. Extend MDG Data Model


1. Start the MDG
customizing with
transaction MDGIMG
and start the
Configuration
Workbench as
shown.

28
How-To: Extend MDG-M by a New Reuse Entity Type

2. In the Configuration
Workbench open
the MM Data
Model.

Choose the Edit


3.
pushbutton.

29
How-To: Extend MDG-M by a New Reuse Entity Type

To create a new entity


4.
type, choose the New
pushbutton.

Create the new Entity


5.
Type YBUPA01 (SU
Type 4) with the
details shown in the
screenshot.

30
How-To: Extend MDG-M by a New Reuse Entity Type

Choose Save.
6.
Choose OK in the
confirmation dialog.

Create the new Entity


7.
Type YBUPA (SU Type
3) with the details
shown in the
screenshot.

Choose Save.
8.
Choose OK in the
confirmation dialog.

31
How-To: Extend MDG-M by a New Reuse Entity Type

Go back to entity
9.
type YBUPA01.

Switch the
Attributes tab.

Choose the New


pushbutton.

Create the new


10.
attribute
NICKNAME as
shown.

Choose Save.
11.

Choose OK in the
confirmation dialog.

32
How-To: Extend MDG-M by a New Reuse Entity Type

For entity type


12.
YBUPA01 open the
Incoming
Relationships tab.

Choose the New


pushbutton.

Create the two


13.
relationships as
shown.

Choose the Activate


14.
pushbutton to
activate your data
model.

33
How-To: Extend MDG-M by a New Reuse Entity Type

To check the
15.
activated data
model, open the Edit
Data Model
Customizing activity
as shown.

Choose the Visualize


16.
Data Model pushbutton
.

Make sure that your


17.
extension of the MDG
data model looks
similar to the details
shown in the
screenshot.

4.2.2. Generate Model-Specific Structures


Every time you change the MDG data model, you must regenerate the structures. In this
Customizing activity, for each data model and entity type you generate technical structures in
the ABAP Dictionary. The system uses these structures internally for implementing the staging
area. To generate these data model-specific structures follow the steps below.

Note
In general, if you change a data model (for example, if you change attributes of entity types or
relationships); you must regenerate the structures.

34
How-To: Extend MDG-M by a New Reuse Entity Type

In MDG customizing
1.
start Generate Data
Model-Specific
Structures.

Select Data Model MM.


2.
Open the Structures
view.

Create the four entries


3.
in the structures table
for entity type
YBUPA01.
Save your changes.
4.

4.2.3. Clear UI Metadata Buffers


After finishing the UI, clear the metadata buffers. You can find the report in Customizing Master
Data Governance, Central Governance-> Master Data Governance for Material-> Clear UI
Metadata Buffers.

This report clears the following buffers in this sequence:

- Text Buffer
- Search Help Buffer
- SMT-Mapping Data Buffer
- SPI Metadata Buffer

35
How-To: Extend MDG-M by a New Reuse Entity Type

You should use this report after extending the data model to make sure that the metadata is
consistent with the MDG customizing and UI configuration.

4.3. Create SMT-Mapping


You extend mappings by creating new transformations (complex transformations, field
mappings) and field checks for them or by editing them.

Important
When the mappings are saved the corresponding coding is generated. Make sure that all relevant structures are
ready before you start.

4.3.1. Create Mapping Entries in Customizing


1.
In MDG customizing
start Generate Data
Model-Specific
Structures.

Select the MM data


2.
model.

Open the Mapping


view.

36
How-To: Extend MDG-M by a New Reuse Entity Type

Create a new entry


3.
for entity type
YBUPA01 / Active
Area Mapping.

Mapping from the


active area to the
staging area:
Z_MAP_YBUPA00
_2 STA.

Mapping from the


staging area to the
active area:
Z_MAP_YBUPA00_2
PP

4.3.2. Map the Active Area to the Staging Area


In MDG customizing
4.
start Create and
Edit Mappings.

37
How-To: Extend MDG-M by a New Reuse Entity Type

Select Mapping ->


5.
New.

Enter the name of the


6.
mapping:

Z_MAP_YBUPA00_2
STA

Create a new
7.
mapping step
MAP_YBUPA01 as
shown. Source
structure is
YMDGM_BUPA01_S,
Target structure
ZMM_S_MM_PP_YBUP
A01.
Select your mapping
8.
step and choose the
Details pushbutton.

Open the
9.
Transformations tab.

38
How-To: Extend MDG-M by a New Reuse Entity Type

Add a new Field


10.
Mapping.

Enter the field


11.
mappings as shown.
Source structure is
YMDGM_BUPA01_S
Save your changes.

39
How-To: Extend MDG-M by a New Reuse Entity Type

4.3.3. Map the Staging Area to the Active Area


In MDG customizing
1.
start Create and
Edit Mappings.

Select Mapping ->


2.
New to create the
next mapping.

Enter the following


3.
mapping name:
Z_MAP_YBUPA00_2
PP

Choose Add to
4.
create new mapping
step using the
details shown in the
screenshot.
Source structure is
ZMM_S_MM_PP_YBU
PA01, change
structure is

40
How-To: Extend MDG-M by a New Reuse Entity Type

YMDGM_BUPA01_S_
X, target structure is
YMDGM_BUPA01_S.
Choose the Change
5.
Structure Keys
pushbutton. Then
add the key fields of
the change
structure, as shown.

Add the key field


6.
BUPA_ID, MATNR
and NICKNAME as
shown.

Select your
7.
mapping step and
choose the Details
pushbutton.

41
How-To: Extend MDG-M by a New Reuse Entity Type

Open the
8.
Transformations
tab.

Choose the Add


9.
pushbutton to
create a new Field
Mapping entry.

Create the field


10.
mapping as shown.
Source structure is
ZMM_S_MM_PP_YBU
PA01.

Save your changes.

4.4. Adjust Staging Area of Linked Change Requests


This step is necessary to adjust any open change requests after you have changed the data model.

Start Customizing for Master


1.
Data Governance (transaction
MDGIMG).

Go to General Settings ->


Data Modeling -> Edit Data
Model.

Select data model MM.

42
How-To: Extend MDG-M by a New Reuse Entity Type

Double click on Entity Types.

Choose the pushbutton Adjust


staging area of linked change
requests
2. Choose the Yes pushbutton.

3. The following message


appears.

Note: Make sure that user


DDIC exist in all relevant
clients.

43
How-To: Extend MDG-M by a New Reuse Entity Type

4.5. Extend User Interface


You can follow the described example or you can create an ATS list UIBB instead without a
template. For more information, see extensibility guide for UI: How-To Extend MDG-M
User Interface.

4.5.1. Create FPM List UIBB


Navigate to the
1.
Component
Configuration as
shown in the
screenshot.

Open
2.
configuration
FPM_LIST_UIB
B_T EMPLATE.

44
How-To: Extend MDG-M by a New Reuse Entity Type

Choose the
3.
Start
Configuration
pushbutton.

Choose the
4.
Copy
icon.

Enter a name
5.
for the copy as
shown.

45
How-To: Extend MDG-M by a New Reuse Entity Type

Refresh the
6.
navigation tree
and open the
new
configuration.

Choose the
7.
Start
Configuration
pushbutton.

Choose to
8.
continue in
change mode.

46
How-To: Extend MDG-M by a New Reuse Entity Type

Under General
9.
Settings choose
the Feeder
Class
pushbutton.

Enter the name


10.
of the feeder
class.

To confirm,
11.
choose
Yes.

47
How-To: Extend MDG-M by a New Reuse Entity Type

Enter the feeder


12.
parameters as
shown.

Make sure you


enter a value for
the number of
default rows.

48
How-To: Extend MDG-M by a New Reuse Entity Type

Node name
13.
verification: if
you’re unsure
about the node
name, run
transaction MDB,
enter ABB ID
MDG_MAT and
you will get the
available nodes

Choose the Column


14.
pushbutton to
see the list of
available
columns.

49
How-To: Extend MDG-M by a New Reuse Entity Type

Select the columns


15.
from the list of
available columns as
shown.

50
How-To: Extend MDG-M by a New Reuse Entity Type

4.5.2. Add List UIBB to Material UI


Navigate to the
1.
Application
Configuration as
shown.

51
How-To: Extend MDG-M by a New Reuse Entity Type

Open the
2.
configuration
BS_MAT_OVP.

Choose the Start


3.
Configuration
pushbutton.

52
How-To: Extend MDG-M by a New Reuse Entity Type

Choose to
4.
continue in
display mode.

Navigate to the
5.
configuration
BS_MAT_OVP_LA
YO UT.

Select Other
6.
Functions ->
Enhance.

Or you can
create a new
CBA or you can
use customizing
mode.

Provide a name
7.
for your
enhancement.

Add a new List


8.
Component to the
Section:
MAT_SECTION
element as
shown.

53
How-To: Extend MDG-M by a New Reuse Entity Type

Enter the details


9.
for the new list
component.

Create a new
10.
wire entry with
the details shown
in the screenshot.
Use connector
class
PLMU/CL_FRW_W_
CONN_DEFAULT.

Save your
11.
changes.

4.5.3. Clear UI Metadata Buffers


After finishing the UI, clear the metadata buffers. You can find the report in Customizing Master
Data Governance, Central Governance-> Master Data Governance for Material-> Clear UI
Metadata Buffers.

This report clears the following buffers in this sequence:


- Text Buffer
- Search Help Buffer
- SMT-Mapping Data Buffer
- SPI Metadata Buffer

54
How-To: Extend MDG-M by a New Reuse Entity Type

You should use this report after extending the data model to make sure that the metadata is
consistent with the MDG customizing and UI configuration.

55
How-To: Extend MDG-M by a New Reuse Entity Type

5. Testing Your Data Model Extension


To test your configuration, start the MDG Material UI using the following URL (replace the parameters host,
port, and client-id to match your landscape):
https://<host>:<port>/sap/bc/webdynpro/sap/mdg_bs_mat?ACTION=CREATE&WDCONFIGURAT
IONID=BS_MAT_INIT&sap-client=<client-id>

Alternatively, start transaction PFCG, enter role name SAP_MDGM_MENU* and click the Display pushbutton.
Select the Menu tab. In the hierarchy window, navigate to Role Menu -> Material Governance -> Material
Processing. Right click on Create Material and select Execute from the drop-down

56
How-To: Extend MDG-M by a New Reuse Entity Type

6. Additional Information

6.1. Further Reading


Information on SAP MDG on SAP S/4HANA
• Exchange knowledge: SAP Community | Q&A | Blog
• Try SAP Master Data Governance on S/4HANA for free: Trial Version
• Learn more: Latest Release | Webinars | Help Portal | How-to Information | Key Presentations

SAP Roadmap Explorer


• Please see the roadmap for SAP Master Data Governance

Related Information
• Learn more: Floorplan Manager for Web Dynpro ABAP | How to Adapt FPM | FPM Blog | How-to
Information | Service Mapping Tool |

6.2. SAP Notes


In addition to the detailed explanations written in this document, please see the following SAP Notes for
further important information.

Note Number Note Description


3194967 MDG Customer Connection 2021 for S/4HANA 2022
3043582 MDG Customer Connection 2020

1806108 Functional restrictions in MDG-M in MDG7 (incl. SP02)


2129261 Functional restrictions in MDG-M in MDG8
2284745 Functional Restrictions in MDG for Material with SAP Master Data Governance 9.0
2461516 Functional Restrictions in MDG for Material with SAP Master Data Governance 9.1
Functional Restrictions in MDG for Material in SAP Master Data Governance 9.2 and on
2656693
SAP S/4HANA 1809
2816571 Functional Restrictions in MDG for Material on SAP S/4HANA 1909
2948873 Functional Restrictions in MDG for Material on SAP S/4HANA 2020
3070012 Functional Restrictions in MDG for Material on SAP S/4HANA 2021
3219945 Functional Restrictions in MDG for Material on SAP S/4HANA 2022
2479869 Usage of Lean Classification with SAP Master Data Governance

1619534 How to Create, Enhance and Adapt FPM Applications

57

You might also like