SAP
How-To Guide

Extending Content in Master Data
Governance, Material Data

Version 1.0
May 2010
© Copyright 2013 SAP AG. All rights reserved.
No part of this publication may be reproduced or
transmitted in any form or ...
Document History
Document Version

Description

1.00

First official release of this guide
Typographic Conventions

Icons

Type Style

Description

Icon

Example Text

Words or characters quoted
from the screen. T...
Table of Contents

1.

Business Scenario.....................................................................................
3.10 Data Replication .......................................................................................................
5.2.2
5.2.3
5.3

Generated Tables ...........................................................................................
7.3.2
7.4

Create and assign a reuse area .................................................................. 232

UI confi...
1. Business Scenario
The main focus of this process is the governance of material master data in a Master Data
Governance ...
2. Background Information
For all the described use cases, consider the following technical background of the solution pro...
You can define the reuse area on data model level or on entity type level.
To define the reuse area on data model level, c...
Important
To ensure records are kept in generated tables, select the reuse area MDG the records
are kept in the generated ...
The entity Types are linked using relationships.
Field Name
If the relationship type is Leading or Qualifying, the syntax ...
Field Name
If the relationship type is Referencing, the syntax used to derive a field name is as follows:
/1MD/<Data Model...
Relationships

Generated Table:
Relationships:

Generated Table:
After you define an entity type and its corresponding data element, and define a relationship involving
that entity type, ...
Relationship Type
Relationship Types are defined in the table below.

Relationship Type

Definition

Referencing

Specifie...
Important
The general design assumption is that there is a 1:N relationship between a database
table and its entity types....
The following graphics show the schematic structure of a Floorplan Manager application:

2.5.1

UI Configuration

You can ...
Note
Currently, it is not possible in Customizing to edit the MDG_MM_APP_BS_MAT_GEN UI
configuration.
Follow these steps:
...
… &sap-wd-configId=MDG_MM_APP_BS_MAT_GEN&SAP-CONFIG-MODE=X

Click the Adapt Configuration link.

2.5.2

UI BAdI

2.5.2.1 P...
2.6 UI Entry Point
The following UI options exist for accessing preconfigured content in MDG:


Portal



SAP GUI



Ne...


The System parameter represents the system used in your environment.

The Change Material screen is shown below.

2.6.2...
You assign the following roles to the business client:


SAP_MDGM



SAP_MDGS
2.6.3

NetWeaver Business Client

You assign the following roles to the NetWeaver business client:


SAP_MDGM



SAP_MDG...
3. Extend by existing field

In this example, the MM data model is extended by the following attributes belonging to the e...
3.1 Data Model Requirements (Active Area)
3.1.1

Table Extensions

The two attributes already correspond to the fields FOR...
3.2 Data Model Requirements (Staging Area)
3.2.1

Data Model Extensions

In the Edit Data Model Customizing activity, you ...
3.2.1.1 Entity Types

Note
The maintenance of the Data Model is cross client.
1. Select the MM data model and navigate to ...
2. Double click Attributes in the dialog structure

3. Add new attributes corresponding to the MARA fields.
Ensure that the customer extension fields consider the customer namespace for DDIC fields. The
customer namespace for fiel...
The tables of the MM data model display as follows before activation.
The tables of the MM data model display as follows after activation.

3.2.3

Structure Extensions

In the Generate Data Mo...
adjustment is that delivered structures in namespace /MDG* are not generated as these
structures are already delivered by ...
3.2.3.1 Maintain Customer Includes (Structures in Namespace /MDG*)
Call Transaction SE11 and create the customer include f...


CI_MDG_S_MM_MATERIAL



CI_MDG_SD_MM_MATERIAL



CI_MDG_S_EMM_MATERIAL

Add the components in each include and activa...
3.2.3.2 Generate structures (structures in customer namespace)
Not applicable to this scenario.
3.3 SMT Mapping
3.3.1

SMT Mapping

You extend mappings by creating new transformations (complex transformations, field ma...
Select your package

In the Transformations tab page, add a new Transformation of Type Field Mapping.
Note

Map the two new attributes.
Extend the corresponding Mapping Steps in the Mappings MDG_BS_MAT_MAP_2FC and
MDG_BS_MAT_MAP_2STA.

You can define the mai...
After you have created the mapping in SMT you should return to the IMG and perform the IMG activity
Check Customizing to e...
3.4 UI Model
The new attributes should also be considered in the UI.

3.4.1

Field Control

By default, the UI uses a BAdI...
3.4.2

Field Control and Data Model

Not applicable to this scenario.

3.4.3

UI Configuration

For demo purposes we copy ...
Enter new values for the Target Configuration IDs.

Click Start Deep Copy.

In the Manage UI Configuration screen, click E...
The attribute we want to add belongs to the entity type Material and the attributes of this entity type
are shown in the G...
Click Configure UIBB.

In this example, you want to show the new attributes in an extra group of the General Data tab page...
Click the Group you created. At the bottom of the right screen you can see the attributes of the group.
In the Text field,...
The new group is marked (otherwise mark it again).
Click Add Melting Group.
Click Configure Melting Group.

In the Configu...
A new screen opens. At the bottom of this screen, the attributes of the newly added elements of the
melting group display....
Click save. The UI configuration is complete.
3.4.4

UI BAdI Implementation

The UI BAdI contains already logic that is implemented for the user interface for individua...
Maintain the name of the new implementation and the package (if not exists) and save.
We also create a new Class for our U...
Maintain the name of the new class and the package (if not exists) and click Save.
Switch to your package.
Now we have to make some changes in the BAdI implementation and its implementing class:
1. Double click the enhancement im...
Click

, and update the value as shown in the screenshot:

Double click the newly generated implementing class. In the Att...


Initialize the displayed data (when creating a new entity type, for example)



Restrict the values displayed in a dro...
In the General Data tab page, you can implement a new column (for example, BaseUOM)

In the Units of Measure tab page, you...


Adjust settings made in Customizing for field control. For more information, see the chapter on
Field Control.



Impl...
3.5 Print Forms
Not covered in this version of the guide.

3.6 Search
Not covered in this version of the guide.
3.7 Data Quality
3.7.1

Validation and Derivation

In this Customizing activity you define the validations and derivations...
3.7.1.1 Derivation
We now create a derivation for the new attribute ZZMSTAE. The system sets a default value of 02.
1. In ...
2. In the Node DERIVE_MATERIAL_ZZMS dialog box, name the node using the following
notation: DERIVE_<ENTITY TYPE>
3. In the Properties tab page, under Mode, select Event Mode.

4. In the Signature tab page, choose Add Existing Data Obje...
5. In the Assigned Rulesets tab page, click Create Ruleset. You can assign several rules to a
ruleset.
6. To insert a rule to the ruleset, under Rules¸ choose Insert Rule -> Create.
7. Enable the rule and the ruleset.

The result is shown in the screenshot below.
3.7.1.2 Check
We now create a check function for the new attribute ZZFORMT. If the Material Type is not initial, you
must ...
3. In the Node CHECK_MATERIAL dialog box, give the node a Name, making sure you use the
following notation: CHECK_<ENTITY ...
5. In the Signature tab page, add the data object you want to create the check function for.

6. In the Assigned Rulesets ...
7. Click Create. Insert a rule to the ruleset called CHECK_FORMT.

8. To create the message, choose Perform Action -> Crea...
9. Click Use Predefined Message and follow the steps shown in the screenshots below.
10. The following predefined message shows when a user attempts to create a material that is
configured to have a Material...
3.7.2

BAdI Implementation

You can use this BAdI to create customer-specific checks on entities, change requests, and edi...
3.8 Process Model
3.8.1

Workflow

The standard workflow template used by Master Data Governance for material is WS6080008...
For each change request type, you can provide separate settings.

SAP delivers Business Rule Framework plus (BRFplus) deci...
system, you import the content from this excel. The decision tables in your system are then filled with
this example conte...
Example
An example of a workflow is shown in the graphic below.

Example decision tables are shown in the graphic below.
3.8.1.1 Extend Rules Based Workflow
You can find details regarding extending the Rule Based Workflow.



How to-Master D...
3.8.1.2.1

Create Simple Workflow

You introduce a dedicated step to check the new attributes.
You create a new status Extension Fields to be evaluated as shown in the screenshots below:
In this activity you define which statuses the change requests can have and which processing options
are enabled for each ...
Note
You must adjust the APPStep numbers in your workflow accordingly.
Note
You can analyze a workflow in transaction SWI6.
3.8.1.2.1

Define Workflow Step Numbers

In the Define Workflow Step Numbers Customizing activity you create the workflow ...
Before you can start the workflow, you must activate the type linkage.
Add an entry for business object type BUS2250 and set the Type linkage active indicator.
3.8.1.2.1 Assign Processor to Workflow Step Number (Simple
Workflow)
In the Assign Processor to Workflow Step Number Custo...
BAdI: Assign Processor to Workflow Step
You can use this BAdI to define rules according to which a processor is allocated ...
These settings have to be adjusted for the following reasons:


A new workflow is used



A new UI configuration is used...
3.8.4

Process Model - BAdI Implementation

For the process modeling there is one BAdI available:
BAdI: Customize User Int...
3.9 Initial Load
The initial load of records to MDG considering an extended Data Model is not covered in this guide.

3.10...
3.11

Key/ Value Mapping

If required, mapping can be defined for elements for example, UoM, industry sector, material typ...
3.12

Test Run
4. Extend by existing table

Note
The node extensibility (entity type), which is introduced in the following sections cove...
The entity type and the attributes correspond to fields of table MARC. They should also be displayed in
the UI.
4.1 Data Model Requirements (Primary Persistence)
4.1.1

Table Extensions

The new attributes already correspond to the fi...
4.2 Data Model Requirements (Staging)
4.2.1

Data Model Extensions

In this Customizing activity, you define and activate ...
4.2.1.1 Entity types

Note
The maintenance of the Data Model is cross client.
Select the MM data model and add the new ent...
Attributes of Entity Type ZZMARC are shown in the screenshot below.

We recommend you only assign a Search Help to a Data ...
Details for Entity Type ZZT024D are shown in the screenshot below.
Details for Entity Type ZZT001W are shown in the screenshot below.
Ensure that the customer extension fields consider the customer namespace for DDIC fields. The
customer namespace for fiel...
4.2.2

Generated Tables

Activate the extended data model.
Note
If you use your own ABAP Dictionary objects (data elements...
The screenshot below shows the generated tables before activation.

The screenshot below shows the generated tables after ...
Note that the system created the following fields only (ZBATCH, ZLVORM, and ZZDISLS) because
they are maintained as attrib...
Structures for PDF-based Forms
Structures for the Service Mapping tool (SMT)
Structures for mapping between active area an...
4.2.3.1 Maintain customer includes (structures in namespace /MDG*)
Not applicable to this scenario.

4.2.3.2 Generate stru...
Return to the screen in which you created the structures. Click Generate Structures. This activates the
structure.
4.3 SMT Mapping
4.3.1

SMT Mapping

You extend mappings by creating new transformations (complex transformations, field ma...
The mapping step MAP MM Model from Staging Area to PP is shown below.

The mapping step MM Model from PP to Staging Area i...
2. Define a mapping step. Its source structure is the generated data-model-specific structure. Its
target structure is the...
5. Enter the key fields of the change structure.
6. Choose Close to leave the dialog box. The Change structure Keys Exist setting is selected for
this step.

7. Continue t...
2. In this example, you define a 1:1 mapping between the fields of the API structure (source) and
the fields of the genera...
After you have created the mapping in SMT you should return to the IMG and perform the IMG activity
Check Customizing to e...
4.4 UI Model
The new attributes should also be considered in the UI.

4.4.1

Field Control

By default, the UI uses a BAdI...
4.4.2

Field Control and Data Model

In MDG, you created a new entity type for the ERP table MARC. When you create a recor...
In our use case, you enhance the SMT mapping using fixed values, as shown in the screenshot
below.
4.4.3

UI configuration

For demo purposes the standard UI configuration was copied and extended. Now we want to extend
ou...
1. Create a new tab.
2. Expand the Main View node to navigate to the newly created Subview and start editing the
Attributes..
3. Navigate to the UIBB (subscreen).
4. Apply attribute settings as shown in the screenshot below.

5. Click the

. And click Yes in the dialog box.

6. Select...
7. Add the columns you would like to show up in the UI.
8. Maintain the following attributes:



For input fields select



For description fields select:
9. Click
. Mark the last 3 entries of the Chosen Feeder Actions section of the
dialog box and click OK.

10. Check the UIB...
4.5 Print Forms
Not covered in this version of the guide.

4.6 Search
Not covered in this version of the guide.
4.7 Data Quality
4.7.1

Validation and Derivation

see previous use case for an example.

4.7.2

BAdI Implementation

See ...
4.8 Process Model
4.8.1

Workflow

See the previous use case for an explanation.

4.8.2

Workflow - BAdI Implementation

S...
4.9 Initial Load
The initial load of records to MDG considering an extended Data Model is not covered in this guide.

4.10...
4.11

Key/ Value Mapping

If required, mapping can be defined for elements for example, UoM, industry sector, material typ...
4.12

Test Run
5. Extend by customer field of existing tables
...

Add entity type

Add entity type

ZZMARC MARC MARC
ZZMARC MARC MARC
th...
5.1 Data Model Requirements (Primary Persistence)
5.1.1

Table Extensions

Append MARA by using append structure to add fi...
5.1.2

Structure Extensions

The Service Mapping Tool is a program that it is used in ABAP to fill a target structure with...
Append the field ZZLOB to the following structures:


MDG_BS_MAT_S_MARA_UI



MDG_BS_MAT_S_MARA_X
Append the field ZCONTROL to the following structures:


MDG_BS_MAT_S_MARC_UI



MDG_BS_MAT_S_MARC_X
Note the following information concerning the structures MDG_BS_MAT_S_MARA_X and
MDG_BS_MAT_S_MARC_X:
If the X-field-struc...
5.2.1.1 Entity types

Note
The maintenance of the Data Model is cross client.
Select the MM data model and add the new ent...
Ensure that the customer extension fields consider the customer namespace for DDIC fields. The
customer namespace for fiel...
5.2.3

Structure Extensions

In this Customizing activity, for each data model and entity type you generate the following ...
The system uses these structures internally for implementing the reuse active area.
Note
In general if you change a data m...
The names of the customer includes are as follows:


CI_MDG_S_PMM_MATERIAL



CI_MDG_S_MM_MATERIAL



CI_MDG_SD_MM_MATE...
Add the field in each include and activate

5.2.3.2 Generate Structures (Structures in Customer Namespace)
Regenerate the ...
The structures are extended automatically.
5.3 SMT Mapping
5.3.1

SMT Mapping

You extend mappings by creating new transformations (complex transformations, field ma...
As described in the previous use case extend for the MARC extension in the Mappings:
After you have created the mapping in SMT you should return to the IMG and perform the IMG activity
Check Customizing to e...
5.4 UI Model
The new attributes should also be considered in the UI.

5.4.1

Field Control

By default, the UI uses a BAdI...
5.4.2

Field control and Data Model

See the previous use case for an explanation.

5.4.3

UI configuration

In this Custo...
5.4.4

UI BAdI Implementation

5.4.4.1 Field Control
Since the UI is copied for demonstration purposes, the UI BAdI has to...
5.5 Print Forms
Not covered in this version of the guide.

5.6 Search
Not covered in this version of the guide.
5.7 Data Quality
5.7.1

Validation and Derivation

see previous use case for an example.

5.7.2

BAdI Implementation

See ...
5.8 Process Model
5.8.1

Workflow

See the previous use case for an explanation.

5.8.2

Workflow - BAdI Implementation

S...
5.9 Initial Load
The initial load of records to MDG considering an extended Data Model is not covered in this guide.

5.10...
5.11

Key Mapping and Value Mapping

If required, mapping can be defined for elements for example, UoM, industry sector, m...
6. Extend by customer table or entity type

A customer table ZZCOUNTRYDETAILS was created in the Data Dictionary.
The MM d...
6.1 Data Model Requirements (Primary Persistence)
6.1.1

Table Extensions

Create a new data base table ZZCOUNTRYDETAILS

...
6.2.1.1 Entity types

Note
The maintenance of the Data Model is cross client.
Select the MM data model and add the new ent...
The details of Entity Type YYCOUNTRY are shown in the screenshot below.
6.2.1.2 Relationships
1. Choose a Relationship Type of P Leading for a relationship with a From-Entity Type of
MATERIAL an...
6.2.1.3 Reuse Area
The Reuse Active Area specifies the reuse active area for active data. This is done by establishing the...
Assign the new Reuse Area to the new entity type
Caution
To create a customer-specific reuse area, you currently require the support of SAP
consulting and development. See...
Note
Since the flexoption is used for the new entity type, records stay in the generated tables
and the creation of mappin...
7. Create own data model with customer object
Airline Partner

Caution
To create a customer-specific reuse area, you curre...
7.1 Data Model
The first step to define a Master Data Governance Custom Object is to define the data model. The
following ...
The Airline and Flights data model is shown in the graphic below.

The Entity relationship model (ERP) consists of the fol...
The table below shows the entity types in more detail.

SCARR
MANDT
CARRID
CARRNAME
CURRCODE
URL

Data element
S_MANDT
S_C...
The Leading relationship models the key attributes SCARR_SPFLI and SCARR_SPFLIGHT into the
respective entity type.

Entity...
In this case we need to model an entity type of type 3 and a respective relationship type qualifying.

Note
For demonstrat...
As a workaround, you can model a field. For example, you can use a CHAR field for the
qualifying entity type with a length...
Relationship

Relationship Type

From

To

CITYFROM
CO_FR_2_C

Referencing
Leading

CITY_FROM SPFLI
COUNT_FRM CITY_FROM
7.1.3

Example 2: Flight customers

The following Enterprise Relationship Model (ERM), which is represented using ABAP Dic...
The goal is to have a MDG application that uses a simple standard workflow for governance. we want
to demonstrate how to a...
7.2 Data Modeling
According to the ERM in chapter 5.1.3 we have a one type 1 and two type 2 entities. They have a
leading ...
Figure 2 Create entity type

Specify the entities as shown below.

For further explanation of the single
attributes one ca...
Figure 4 Attribute Overview

Repeat the previous step for the other entities.

Entity Type:

SBUSPART

Attribute

Data ele...
Note
The ABAP Dictionary table STRAVELAG (which you can check using transaction SE11)
includes the LANGU attribute for the...
Figure 5 Entering new relationships

Specify the relationship details

Figure 6 Relationship details
Note
Cardinality S = ...
7.2.4

Activate data model

Now the MDG data model is finished and can be activated
Note
If you use your own ABAP Dictiona...
7.2.5

Generate data model specific structures

Full Path: Cross-Application Components -> Master Data Governance -> Gener...
Note
If you specify the Entity Type and the Where Used Area, the Prefix Namespace and the
Name of Structure are populated ...
7.3.2

Create and assign a reuse area

In Customizing for Master Data Governance choose General Settings -> Data Modeling ...
Figure 15 Entity Types - Reuse Area

8. Save and activate your data model.
Note
As already mentioned to activate the data ...
7.4 UI configuration
To make the model we just created visible we need to create a UI configuration and we need to build
s...
Figure 19 New Appl. Config created

6. Now you should be able to see your copy. Click Edit.

Figure 20 Edit new Appl. Conf...
9. Click Save and go back to the Structure tab strip. Click Go to Component Configuration

Figure 23 Component Configurati...


You need to delete the automatically assigned dummy entity type.

12. Create the first tab strip for the entity type SB...
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Main extending content in mdgm new
Upcoming SlideShare
Loading in …5
×

Main extending content in mdgm new

1,230 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,230
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
62
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Main extending content in mdgm new

  1. 1. SAP How-To Guide Extending Content in Master Data Governance, Material Data Version 1.0 May 2010
  2. 2. © Copyright 2013 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. SAP NetWeaver How-to Guides are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP NetWeaver. Should you wish to receive additional information, clarification or support, refer to SAP Consulting. Any software coding and/or code lines / strings (Code) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent. Disclaimer Some components of this product are based on Java™. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components. Any Java™ Source Code delivered with this product is only to be used by SAP’s Support Services and may not be modified or altered in any way.
  3. 3. Document History Document Version Description 1.00 First official release of this guide
  4. 4. Typographic Conventions Icons Type Style Description Icon Example Text Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation Example text Emphasized words or phrases in body text, graphic titles, and table titles Example text File and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Example text User entry texts. These are words or characters that you enter in the system exactly as they appear in the documentation. <Example text> Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER. Description Caution Note or Important Example Recommendation or Tip
  5. 5. Table of Contents 1. Business Scenario............................................................................................................... 5 2. Background Information ..................................................................................................... 6 2.1 Prerequisites for Using Master Data Governance ........................................................ 6 2.2 Data Model ................................................................................................................... 6 2.3 2.4 Reuse Area versus the Flexible Option / Access class ................................................ 6 Entity Relationship Model ............................................................................................. 8 2.5 UI Creation.................................................................................................................. 15 2.5.1 2.6 UI Configuration ............................................................................................. 16 2.5.2 UI BAdI ........................................................................................................... 18 UI Entry Point.............................................................................................................. 19 2.6.1 2.6.2 SAP GUI......................................................................................................... 20 2.6.3 3. Portal .............................................................................................................. 19 NetWeaver Business Client ........................................................................... 22 Extend by existing field .................................................................................................... 25 3.1 Data Model Requirements (Active Area) .................................................................... 26 3.1.1 3.1.2 3.2 Table Extensions ........................................................................................... 26 Structure Extensions ...................................................................................... 26 Data Model Requirements (Staging Area) ................................................................. 27 3.2.1 Generated Tables .......................................................................................... 31 3.2.3 3.3 Data Model Extensions .................................................................................. 27 3.2.2 Structure Extensions ...................................................................................... 33 SMT Mapping ............................................................................................................. 40 3.3.1 3.4 SMT Mapping ................................................................................................. 40 3.3.2 Mapping Customizing .................................................................................... 45 UI Model ..................................................................................................................... 47 3.4.1 Field Control ................................................................................................... 47 3.4.2 Field Control and Data Model ........................................................................ 51 3.4.3 UI Configuration ............................................................................................. 51 3.4.4 UI BAdI Implementation ................................................................................. 60 3.5 Print Forms ................................................................................................................. 68 3.6 Search ........................................................................................................................ 68 3.7 Data Quality ................................................................................................................ 69 3.7.1 3.7.2 3.8 Validation and Derivation ............................................................................... 69 BAdI Implementation...................................................................................... 84 Process Model ............................................................................................................ 85 3.8.1 3.8.2 Workflow - BAdI Implementation ................................................................. 100 3.8.3 Adjustments to Change Request Customizing ............................................ 101 3.8.4 3.9 Workflow ........................................................................................................ 85 Process Model - BAdI Implementation ........................................................ 104 Initial Load ................................................................................................................ 105
  6. 6. 3.10 Data Replication ....................................................................................................... 105 3.10.1 Replication of Material ................................................................................. 105 3.10.2 Replication of Supplier or Business Partner ................................................ 105 3.10.3 BAdI Implementation.................................................................................... 105 3.11 Key/ Value Mapping ................................................................................................. 106 3.12 Test Run ................................................................................................................... 107 4. Extend by existing table ................................................................................................. 112 4.1 Data Model Requirements (Primary Persistence) .................................................... 114 4.1.1 4.1.2 4.2 Table Extensions ......................................................................................... 114 Structure Extensions .................................................................................... 114 Data Model Requirements (Staging) ........................................................................ 115 4.2.1 4.2.2 Generated Tables ........................................................................................ 123 4.2.3 4.3 Data Model Extensions ................................................................................ 115 Structure Extensions .................................................................................... 125 SMT Mapping ........................................................................................................... 130 4.3.1 4.3.2 4.4 SMT Mapping ............................................................................................... 130 Mapping Customizing .................................................................................. 137 UI Model ................................................................................................................... 141 4.4.1 Field Control ................................................................................................. 141 4.4.2 Field Control and Data Model ...................................................................... 142 4.4.3 UI configuration ............................................................................................ 145 4.4.4 UI BAdI Implementation ............................................................................... 153 4.5 Print Forms ............................................................................................................... 155 4.6 Search ...................................................................................................................... 155 4.7 Data Quality .............................................................................................................. 156 4.7.1 4.7.2 4.8 Validation and Derivation ............................................................................. 156 BAdI Implementation.................................................................................... 156 Process Model .......................................................................................................... 157 4.8.1 4.8.2 Workflow - BAdI Implementation ................................................................. 157 4.8.3 Change Request/ Customizing Adjustments ............................................... 157 4.8.4 4.9 Workflow ...................................................................................................... 157 Process Model - BAdI Implementation ........................................................ 157 Initial Load ................................................................................................................ 158 4.10 Data Replication ....................................................................................................... 158 4.10.1 Replication of Material Master Data ............................................................. 158 4.10.2 Replication of Supplier or Business Partner Master Data ........................... 158 4.10.3 BAdI Implementation.................................................................................... 158 4.11 Key/ Value Mapping ................................................................................................. 159 4.12 Test Run ................................................................................................................... 160 5. Extend by customer field of existing tables ................................................................. 170 5.1 Data Model Requirements (Primary Persistence) .................................................... 171 5.1.1 5.2 Table Extensions ......................................................................................... 171 5.1.2 Structure Extensions .................................................................................... 172 Data Model Requirements (Staging) ........................................................................ 175 5.2.1 Data Model Extensions ................................................................................ 175
  7. 7. 5.2.2 5.2.3 5.3 Generated Tables ........................................................................................ 178 Structure Extensions .................................................................................... 180 SMT Mapping ........................................................................................................... 188 5.3.1 5.4 SMT Mapping ............................................................................................... 188 5.3.2 Mapping Customizing .................................................................................. 192 UI Model ................................................................................................................... 193 5.4.1 Field Control ................................................................................................. 193 5.4.2 Field control and Data Model ....................................................................... 196 5.4.3 UI configuration ............................................................................................ 196 5.4.4 UI BAdI Implementation ............................................................................... 198 5.5 Print Forms ............................................................................................................... 199 5.6 Search ...................................................................................................................... 199 5.7 Data Quality .............................................................................................................. 200 5.7.1 5.7.2 5.8 Validation and Derivation ............................................................................. 200 BAdI Implementation.................................................................................... 200 Process Model .......................................................................................................... 201 5.8.1 5.8.2 Workflow - BAdI Implementation ................................................................. 201 5.8.3 Change Request/ Customizing Adjustments ............................................... 201 5.8.4 5.9 Workflow ...................................................................................................... 201 Process Model - BAdI Implementation ........................................................ 201 Initial Load ................................................................................................................ 202 5.10 Data Replication ....................................................................................................... 202 5.10.1 Replication of Material ................................................................................. 202 5.10.2 Replication of Supplier or Business Partner- ............................................... 202 5.10.3 BAdI Implementation.................................................................................... 202 5.11 Key Mapping and Value Mapping............................................................................. 203 6. Extend by customer table or entity type ....................................................................... 204 6.1 Data Model Requirements (Primary Persistence) .................................................... 205 6.1.1 6.1.2 6.2 Table Extensions ......................................................................................... 205 Structure Extensions .................................................................................... 205 Data Model Requirements (Staging) ........................................................................ 205 6.2.1 7. Data Model Extensions ................................................................................ 205 Create own data model with customer object Airline Partner .................................... 214 7.1 Data Model ............................................................................................................... 215 7.1.1 7.1.2 Example 1: Airline and Flights ..................................................................... 215 7.1.3 7.2 MDG Data Model - Details ........................................................................... 215 Example 2: Flight customers ....................................................................... 222 Data Modeling........................................................................................................... 224 7.2.1 7.2.2 Create Entity Types ..................................................................................... 224 7.2.3 Create relationships ..................................................................................... 227 7.2.4 Activate data model ..................................................................................... 229 7.2.5 7.3 Create Data Model ....................................................................................... 224 Generate data model specific structures ..................................................... 230 Primary Persistence (PP) Access Class .................................................................. 231 7.3.1 Implementing the PP Access Class ............................................................. 231
  8. 8. 7.3.2 7.4 Create and assign a reuse area .................................................................. 232 UI configuration......................................................................................................... 234 7.4.1 7.4.2 Portal content ............................................................................................... 242 7.4.3 7.5 Change request ........................................................................................... 234 UI Business Add In ...................................................................................... 242 Process Modeling ..................................................................................................... 246 7.5.1 7.5.2 7.6 Process Modeling - Change Request .......................................................... 246 Process Modeling- Workflow ....................................................................... 247 Data Quality and Search: Validation and derivations based on BRFplus ................ 249 7.6.1 8. Check for Flights With a Customer Discount of 4% or Less ........................ 249 Appendix .......................................................................................................................... 261 8.1 PP Access for custom objects .................................................................................. 261 8.2 UI BAdI implementation ............................................................................................ 261 8.3 IDOC Enhancement ................................................................................................. 262 8.4 Useful links ............................................................................................................... 296
  9. 9. 1. Business Scenario The main focus of this process is the governance of material master data in a Master Data Governance (MDG) hub and the replication of the golden record to connected operational systems, Business Intelligence (BI) systems, or both. You can use this business process to find, create, change, and delete material master data. The subprocesses are workflow-driven. The workflow enables collaboration between users who have different roles in maintaining master data. It can include several approval and revision phases. All changes to master data are documented in the system based on change requests. The system documents changes to master data in the system. This makes governance more effective; transparency is improved, quality master data is ready in time, and the costly creation of duplicate records is avoided. Preconfigured Data Models, UI configurations and workflows enable you to easily set up a governance process involving several users. This guide describes how to extend the preconfigured content of the Master Data Governance for Material, using the model MM. The MDGM 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 predelivered SAP ERP Material Master. Note You can use the described procedure for extending the MM data model as a general guideline for extending the Business Partner Model BP.
  10. 10. 2. Background Information For all the described use cases, consider the following technical background of the solution proposed. Prerequisites for Using Master Data Governance 2.1 Prerequisites for Using Master Data Governance  ERP 6.0 EhP5 (SAP_APPL 605) 2.2 Data Model The preconfigured data model for the business object type Material is MM. You can define new attributes for existing SAP entity types in the Model definition in Customizing for Master Data Governance under General Settings > Data Modeling > Edit Data Model (view cluster VC_USMD001). 1. Navigate to the MM data model. 2. Drill down to the entity type for which you would like to add attributes. 3. Drill down to the attributes. You can add attributes in customer namespaces YY* and ZZ*, in the same way as you do for ABAP Dictionary enhancements. 4. Assign appropriate data elements as the data element controls default field labels in the UI as well as value helps and documentation. Do not duplicate the same data element. 5. Activate the data model. 2.3 Reuse Area versus the Flexible Option / Access class You can assign a reuse active area to a data model or to individual entity types within a data model. In both cases, the master data is actively saved in the database tables specified in the reuse active area.
  11. 11. You can define the reuse area on data model level or on entity type level. To define the reuse area on data model level, complete the following steps: 1. Open Customizing for Master Data Governance under General Settings -> Data Modeling -> Edit Data Model. 2. Open the Reuse Active Area sub view. To define a reuse area for an entity type, complete the following steps: 1. Open Customizing for Master Data Governance under General Settings -> Data Modeling -> Edit Data Model. 2. Open the Entity Type sub view. 3. Choose a Reuse Active Area in the Reuse Area field. Use entry help if necessary.
  12. 12. Important To ensure records are kept in generated tables, select the reuse area MDG the records are kept in the generated tables. 2.4 Entity Relationship Model The Data Model is based on an entity relationship model. The screenshot below shows the available storage /use types:
  13. 13. The entity Types are linked using relationships. Field Name If the relationship type is Leading or Qualifying, the syntax used to derive a field name is as follows: /1MD/<Data Model><Entity Type>. Entity type: Relationships: Generated Table:
  14. 14. Field Name If the relationship type is Referencing, the syntax used to derive a field name is as follows: /1MD/<Data Model><Relationship Name>. Entity type:
  15. 15. Relationships Generated Table:
  16. 16. Relationships: Generated Table:
  17. 17. After you define an entity type and its corresponding data element, and define a relationship involving that entity type, you can generate a data model. The data element name for each field is derived from the to-entity type.
  18. 18. Relationship Type Relationship Types are defined in the table below. 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. Cardinality The following options are possible for the relationship between two entity types:  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. This cardinality is valid only for relationships with the relationship type Referencing. The FromEntity Type is an optional attribute of the To-Entity Type.
  19. 19. Important 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. Example: - The MARA database table can be replicated on several entity types - Database tables MARC and MPOP must not be bundled in one entity type 2.5 UI Creation The UI is be configured with the Floorplan Manager. The Floorplan Manager (FPM) is a Web Dynpro ABAP application that provides a framework for developing new Web Dynpro ABAP application interfaces consistent with SAP UI guidelines. An FPM application is composed of a number of different Web Dynpro components (most of which are instantiated dynamically at runtime). However, the following two components are always present:  A floorplan-specific component (FPM_GAF_COMPONENT or FPM_OIF_COMPONENT)  A component for the Header Area (FPM_IDR_COMPONENT) In simple terms, the configuration of an FPM application is the configuration of these two components.
  20. 20. The following graphics show the schematic structure of a Floorplan Manager application: 2.5.1 UI Configuration You can either extend the SAP configuration with &SAP_CONFIG or copy the SAP configuration and choose Edit Configuration. Note: It is client specific to extend the existing UI configuration using &SAP_CONFIG. The advantage of this method is that no new UI BAdI implementation is necessary. In this Customizing activity, you manage UI configurations, which the system uses for the following purposes: Definition of the Web user interface for individual processing of an entity type (Web Dynpro application USMD_ENTITY TYPE_VALUE2) Use in the Web user interface for creating and processing a change request. You can create and edit different UI configurations for each data model.
  21. 21. Note Currently, it is not possible in Customizing to edit the MDG_MM_APP_BS_MAT_GEN UI configuration. Follow these steps: Run transaction SE80 and select package MDG_BS_MAT_MODEL_GEN Double-click Application Configuration MDG_MM_APP_BS_MAT_GEN. Click Add the following parameter to the end of the URL: SAP-CONFIG-MODE=X:
  22. 22. … &sap-wd-configId=MDG_MM_APP_BS_MAT_GEN&SAP-CONFIG-MODE=X Click the Adapt Configuration link. 2.5.2 UI BAdI 2.5.2.1 Provide completely new BAdI implementation 2.5.2.2 Copy existing MDGM UI BAdI implementation class 2.5.2.3 New UI BAdI implementation, inheriting from existing MDGM UI BAdI implementation class You can also use the UI BAdI and inherit from the class CL_MDG_BS_MAT_UI_BADI. Note: If you only want to extend the UI BAdI implementation of a method (instead of replacing the UI BAdI), you should always call the corresponding super method IF_EX_USMD_UI_EVENT2: MODIFY_DEFINITION. When using this UI BAdI provided by SAP you own less coding and SAP corrections are applied automatically. Advisable if you just want to extend the behavior of the UI BAdI implementation, not completely replace it.
  23. 23. 2.6 UI Entry Point The following UI options exist for accessing preconfigured content in MDG:  Portal  SAP GUI  NetWeaver business client 2.6.1 Portal To extend preconfigured content in Master Data Governance for material, you must assign the following portal roles to your user:  Senior Master Data Manager  Material Master Data Manager The assigned portal roles contain the following preconfigured iViews. The control parameters required to extend preconfigured content in Master Data Governance for Material are as follows:  Application Parameters The PROCESS parameter equals the Business Activity maintained in the Customizing.
  24. 24.  The System parameter represents the system used in your environment. The Change Material screen is shown below. 2.6.2 SAP GUI
  25. 25. You assign the following roles to the business client:  SAP_MDGM  SAP_MDGS
  26. 26. 2.6.3 NetWeaver Business Client You assign the following roles to the NetWeaver business client:  SAP_MDGM  SAP_MDGS
  27. 27. 3. Extend by existing field In this example, the MM data model is extended by the following attributes belonging to the existing entity type MATERIAL:  ZZFORMT  ZZMSTAE These attributes correspond to the fields FORMT and MSTAE of data base table MARA and also display in the UI. The model is extended by the new attributes, all structures are generated, and the (old) application configuration is available (together with its dependent objects).
  28. 28. 3.1 Data Model Requirements (Active Area) 3.1.1 Table Extensions The two attributes already correspond to the fields FORMT and MSTAE of data base table MARA. 3.1.2 Structure Extensions The Service Mapping Tool is a program that it is used in ABAP to fill a target structure with a set of source structures. The target structures that fill the MARA database table are as follows:  MDG_BS_MAT_S_MARA  MDG_BS_MAT_S_MARA_UI  MDG_BS_MAT_S_MARA_X Note Several source structures that used in the Service Mapping Tool (SMT) are already delivered. These have to be extended depending on the use case.
  29. 29. 3.2 Data Model Requirements (Staging Area) 3.2.1 Data Model Extensions In the Edit Data Model Customizing activity, you define and activate a data model to map master data in the system, along with its properties and relationships. The system uses this data model to generate database tables in which the master data can be stored.
  30. 30. 3.2.1.1 Entity Types Note The maintenance of the Data Model is cross client. 1. Select the MM data model and navigate to the entity type for which you would like to add attributes, in this case Material.
  31. 31. 2. Double click Attributes in the dialog structure 3. Add new attributes corresponding to the MARA fields.
  32. 32. Ensure that the customer extension fields consider the customer namespace for DDIC fields. The customer namespace for fields is YY and ZZ. 3.2.1.2 Relationships The relationships do not have to be changed for this scenario. 3.2.2 Generated Tables Activate the extended data model. After the activation the new fields are added to the generated tables. Note If you use your own ABAP Dictionary objects (data elements, domains, check tables) in your data model and you changed their properties after the data model was activated refer to Note 1552474. You can optionally check the generated tables using the USMD_DATA_MODEL report.
  33. 33. The tables of the MM data model display as follows before activation.
  34. 34. The tables of the MM data model display as follows after activation. 3.2.3 Structure Extensions In the Generate Data Model Specific Structures Customizing activity, for each data model and entity type you generate the following technical structures in the ABAP Dictionary.  Structures for PDF-based Forms  Structures for the Service Mapping tool (SMT)  Structures for mapping between active area and staging area  Structures for Enterprise Search  Structures for Field Control The system uses these structures internally for implementing the reuse active area. Note In general if you change a data model (for example, if you change attributes of entity types or relationships), you need to regenerate the structures. Important The data model MM delivered by SAP already includes the corresponding structures. Their namespace is the SAP namespace /MDGMM/. These structures contain a Customizing include. If you change the data model at a later date, you might need to adjust the structures by means of these customer includes. The reason for the manual
  35. 35. adjustment is that delivered structures in namespace /MDG* are not generated as these structures are already delivered by SAP as fixed.
  36. 36. 3.2.3.1 Maintain Customer Includes (Structures in Namespace /MDG*) Call Transaction SE11 and create the customer include for the following structures. The structures are arranged by application usage. The customer includes are as follows:  CI_MDG_S_PMM_MATERIAL
  37. 37.  CI_MDG_S_MM_MATERIAL  CI_MDG_SD_MM_MATERIAL  CI_MDG_S_EMM_MATERIAL Add the components in each include and activate. Note With SAP note 1460857 the customer includes are updated automatically.
  38. 38. 3.2.3.2 Generate structures (structures in customer namespace) Not applicable to this scenario.
  39. 39. 3.3 SMT Mapping 3.3.1 SMT Mapping You extend mappings by creating new transformations (complex transformations, field mappings) and field checks for them or by editing them. Here you work cross-client. Important When the maps are saved the system generates the corresponding coding. You must ensure all relevant structures are already maintained. Create the package Z_MATERIAL_EXTENSION. Extend the mapping step MDG_BS_MAT_MATERIAL in the following Mappings:  MDG_BS_MAT_MAP_2PP  MDG_BS_MAT_MAP_2FC  MDG_BS_MAT_MAP_2STA Open MDG_BS_MAT_MAP_2PP, select Mapping Step MDG_BS_MAT_MATERIAL and click Details.
  40. 40. Select your package In the Transformations tab page, add a new Transformation of Type Field Mapping.
  41. 41. Note Map the two new attributes.
  42. 42. Extend the corresponding Mapping Steps in the Mappings MDG_BS_MAT_MAP_2FC and MDG_BS_MAT_MAP_2STA. You can define the maintenance status in Customizing. The control fields are VPSTA and PSTAT. If you define a field as mandatory in Customizing for Material Master under Field Selection -> Maintain Field Selection for Data Sources you must perform one of the following actions:  Define the field as mandatory in the data model  Set a fixed value for the field using a Transformation Type of Field Mapping  Implement a Transformation Type of Complex Transformation for the field This allows you to implement your own logic.
  43. 43. After you have created the mapping in SMT you should return to the IMG and perform the IMG activity Check Customizing to ensure consistency of the changes. 3.3.2 Mapping Customizing For each Entity Type you must assign an appropriate Where Used setting and an SMT mapping from active area setting. In this use case, you can keep the standard settings because neither the Mapping ID nor the Entity Type was changed.
  44. 44. 3.4 UI Model The new attributes should also be considered in the UI. 3.4.1 Field Control By default, the UI uses a BAdI implementation to evaluate the field control settings made in the Customizing. In the Field Selection section of Customizing for Material Master, you define whether a field is hidden or displayed, or whether an entry is mandatory or optional. This involves assigning the field to a field selection group and then maintaining field selections for data screens. Important The definition has to exist for all fields that are used in the data model. Otherwise the field is hidden from the UI by default.
  45. 45. 3.4.2 Field Control and Data Model Not applicable to this scenario. 3.4.3 UI Configuration For demo purposes we copy the standard UI configuration and extend it. Select the Customizing activity Edit UI Configuration. Select the existing UI Configuration MDG_MM_APP_BS_MAT_GEN for Data Model MM and create a copy.
  46. 46. Enter new values for the Target Configuration IDs. Click Start Deep Copy. In the Manage UI Configuration screen, click Edit and make the required changes.
  47. 47. The attribute we want to add belongs to the entity type Material and the attributes of this entity type are shown in the General Data tab.
  48. 48. Click Configure UIBB. In this example, you want to show the new attributes in an extra group of the General Data tab page called Extensions. To create the extra group, click Add Group. A new group displays in the hierarchy (Group (4)). Note To display the field in an already existing group, skip this step and click the existing group.
  49. 49. Click the Group you created. At the bottom of the right screen you can see the attributes of the group. In the Text field, type Extension.
  50. 50. The new group is marked (otherwise mark it again). Click Add Melting Group. Click Configure Melting Group. In the Configure Melting Group dialog box, move the new fields from Available Fields to Displayed Fields and click OK.
  51. 51. A new screen opens. At the bottom of this screen, the attributes of the newly added elements of the melting group display. Assign the action USMD_ENTER (Event for Entry Key) to the newly added attributes. This action triggers a roundtrip. The information is transported to the staging area, checks are performed, and events can be triggered.
  52. 52. Click save. The UI configuration is complete.
  53. 53. 3.4.4 UI BAdI Implementation The UI BAdI contains already logic that is implemented for the user interface for individual processing of an entity type. It is used for example to control the visibility of fields on the user interface and to set the property that determines if fields are required or display-only. 3.4.4.1 Field Control As mentioned before, the UI is copied for demonstration purposes. Consequently, the UI BAdI has to be copied as well. Then the filter has to be changed to the new UI configuration ID. We now create the UI BAdI implementation ZMDG_BS_MAT_GEN by copying the old one MDG_BS_MAT_GEN: Run transaction SE80, and in package MDG_BS_MAT_MODEL_GEN and copy the implementation. Select enhancement implementation MDG_BS_MAT_GEN, right-click it, and click Copy.
  54. 54. Maintain the name of the new implementation and the package (if not exists) and save. We also create a new Class for our UI- implementation by copying the old one CL_MDG_BS_MAT_UI_BADI: In package MDG_BS_MAT_MODEL_GEN select class CL_MDG_BS_MAT_UI_BADI, right-click it, and click Copy.
  55. 55. Maintain the name of the new class and the package (if not exists) and click Save. Switch to your package.
  56. 56. Now we have to make some changes in the BAdI implementation and its implementing class: 1. Double click the enhancement implementation ZMDG_BS_MAT_GEN, 2. In the right part of the screen, select the implemented class and switch to change mode. 3. In the field Implementing Class, change the value from CL_MDG_BS_MAT_UI_BADI to Z_CL_MDG_BS_MAT_UI_BADI.
  57. 57. Click , and update the value as shown in the screenshot: Double click the newly generated implementing class. In the Attributes tab page, update the value of the attribute GC_USUAL_UI_CONFIG from MDG_MM_APP_BS_MAT_GEN to Z_MDG_MM_APP_BS_MAT_GEN_CP_1. Then activate the class. 3.4.4.2 UI Adjustment In addition to using delivered UI logic, you can use Business Add Ins (BAdIs) to change your user interface for individual processing of an entity type. You have options for making changes in the following areas:  Adjust the definition of attributes or add new attributes
  58. 58.  Initialize the displayed data (when creating a new entity type, for example)  Restrict the values displayed in a dropdown list field or selection field group  Restrict the values displayed in the input help  Dynamically control the visibility of fields on the user interface and of the property that determines if fields are required or display-only  Define navigation destinations of UI elements of the type hyperlink (or pushbutton)  Check if the lead selection of a table may be changed Note To apply the following examples, you must implement a user interface BAdI. If you want to use fields or set default values that do not exist in the data model but that are instead calculated, derived, or defaulted on the UI, you must implement a User Interface BAdI (Business Add In). One use case is adding a derived field to the screen below that shows the difference between gross weight and net weight.  Note The screenshot does not show any new field. Another use case is setting default values for EAN (International Article Number).
  59. 59. In the General Data tab page, you can implement a new column (for example, BaseUOM) In the Units of Measure tab page, you can implement behavior for new buttons. For example, you can implement the Delete Row(s) button to ensure the first row cannot be deleted. You can perform the following actions related to field control:  Implement your own field control settings
  60. 60.  Adjust settings made in Customizing for field control. For more information, see the chapter on Field Control.  Implement BAdI_MAT_F_SPEC_SEL from the backend. You can also implement your own UI configuration.
  61. 61. 3.5 Print Forms Not covered in this version of the guide. 3.6 Search Not covered in this version of the guide.
  62. 62. 3.7 Data Quality 3.7.1 Validation and Derivation In this Customizing activity you define the validations and derivations for a data model. Validations ensure that the master data is consistent. You use derivations to calculate values for resolved attributes from other resolved attributes, thereby simplifying data entry. 4. Select the data model.
  63. 63. 3.7.1.1 Derivation We now create a derivation for the new attribute ZZMSTAE. The system sets a default value of 02. 1. In the Catalog view of the Catalog Browser, right-click the Derivation node and choose Create Object Node -> Create Function as shown in the screenshot below.
  64. 64. 2. In the Node DERIVE_MATERIAL_ZZMS dialog box, name the node using the following notation: DERIVE_<ENTITY TYPE>
  65. 65. 3. In the Properties tab page, under Mode, select Event Mode. 4. In the Signature tab page, choose Add Existing Data Object to add the data object you want to create the derivation for, in this case, MATERIAL.
  66. 66. 5. In the Assigned Rulesets tab page, click Create Ruleset. You can assign several rules to a ruleset.
  67. 67. 6. To insert a rule to the ruleset, under Rules¸ choose Insert Rule -> Create.
  68. 68. 7. Enable the rule and the ruleset. The result is shown in the screenshot below.
  69. 69. 3.7.1.2 Check We now create a check function for the new attribute ZZFORMT. If the Material Type is not initial, you must maintain the ZZFORMT attribute. A warning message should make the user aware of this. 1. In transaction SE91, create a new message class and a new message. 2. Switch to the Customizing of derivations, go to check entity type, and select create function.
  70. 70. 3. In the Node CHECK_MATERIAL dialog box, give the node a Name, making sure you use the following notation: CHECK_<ENTITY TYPE> 4. In the Properties tab page, under Mode, select Event Mode..
  71. 71. 5. In the Signature tab page, add the data object you want to create the check function for. 6. In the Assigned Rulesets tab page, create a ruleset. Several rules can be assigned to one ruleset.
  72. 72. 7. Click Create. Insert a rule to the ruleset called CHECK_FORMT. 8. To create the message, choose Perform Action -> Create.
  73. 73. 9. Click Use Predefined Message and follow the steps shown in the screenshots below.
  74. 74. 10. The following predefined message shows when a user attempts to create a material that is configured to have a Material Type, and no Page Format is maintained.
  75. 75. 3.7.2 BAdI Implementation You can use this BAdI to create customer-specific checks on entities, change requests, and editions. You also can use this BAdI to define that certain field values are to be derived from the values of other fields in the master data:
  76. 76. 3.8 Process Model 3.8.1 Workflow The standard workflow template used by Master Data Governance for material is WS60800086, which is delivered and activated. MDG for material uses advanced workflow capabilities by combining the SAP Business Workflow with the SAP Business Rule Framework plus (BRFplus). In the following Customizing activity you define the rules for the rule-based workflow.
  77. 77. For each change request type, you can provide separate settings. SAP delivers Business Rule Framework plus (BRFplus) decision tables as example content for each change request type. As a customer, this SAP-proposed content is imported into client 000 of your system. To use the content, you export the decision tables from client 000 to an Excel and in your
  78. 78. system, you import the content from this excel. The decision tables in your system are then filled with this example content. It is also still possible to define the decision tables manually. The values with white background color are conditions, and with green background color are results. This decision table is evaluated line by line from top to bottom. The CR Previous Step and the Previous Action determine the next step, the new status and other attributes. In the case of a complex workflow scenario, for example, if there are special functions required in the workflow, you must also have defined the service names for the BAdI implementations that are to be used. The first result column Condition Alias is the link from this table to the other two decision tables to find the agents. The only condition is Condition Alias. For a condition alias, you can define one or more user agent groups.
  79. 79. Example An example of a workflow is shown in the graphic below. Example decision tables are shown in the graphic below.
  80. 80. 3.8.1.1 Extend Rules Based Workflow You can find details regarding extending the Rule Based Workflow.   How to-Master Data Governance for Material: BADI USMD_SSW_DYNAMIC_AGENT_SELECT for More Flexible User Determination How to-Master Data Governance for Material: Set up Parallel Workflow Tasks with BRF+ Note To ensure the master data object is activated at the end of a workflow the change request status must be set to status 05 or 06. 3.8.1.2 Extend Simple Workflow For demo purposes a new simple workflow WS90900008 with several steps was created without using the Business Rule Framework plus (BRFplus) decision tables. The agent determination is handled differently.
  81. 81. 3.8.1.2.1 Create Simple Workflow You introduce a dedicated step to check the new attributes.
  82. 82. You create a new status Extension Fields to be evaluated as shown in the screenshots below:
  83. 83. In this activity you define which statuses the change requests can have and which processing options are enabled for each of those statuses. The standard delivery contains the following statuses:  To be evaluated  To be considered and approved  Changes to be executed  To be revised  Final check to be performed  Final check approved  Final check rejected
  84. 84. Note You must adjust the APPStep numbers in your workflow accordingly.
  85. 85. Note You can analyze a workflow in transaction SWI6.
  86. 86. 3.8.1.2.1 Define Workflow Step Numbers In the Define Workflow Step Numbers Customizing activity you create the workflow step numbers for your workflow and enter a short description for them. For example, to be able to assign different workflow processors at different places to a workflow task that occurs several times in the workflow, you need your own workflow step number for each of these dialog steps (of the workflow tasks). The workflow step numbers you created are then available when you assign the workflow step number and processor.
  87. 87. Before you can start the workflow, you must activate the type linkage.
  88. 88. Add an entry for business object type BUS2250 and set the Type linkage active indicator.
  89. 89. 3.8.1.2.1 Assign Processor to Workflow Step Number (Simple Workflow) In the Assign Processor to Workflow Step Number Customizing activity, you assign processors to the individual workflow step numbers for each type of change request. This determines which tasks the processors need to perform. 3.8.2 Workflow - BAdI Implementation You can implement the BAdIs in the screenshot below for the rule-based workflow. BAdI: Rule Context Preparation for Rule-Based Workflow You can use this BAdI to implement preparation of the Business Rule Framework plus (BRF+) rule context in the rule-based workflow. BAdI: Calling of System Method for Rule-Based Workflow You can use this BAdI to implement the calling of a system method in the rule-based workflow. BAdI: Dynamic Selection of Agent in Rule-Based Workflow You can use this BAdI to implement dynamic agent selection in the rule-based workflow. Therefore in addition to rules that have been predefined, with this BAdI you can change agent values in the workflow by creating your own programs. BAdI: Handling of Parallel Results in Rule-Based Workflow You can use this BAdI to implement the result of a parallel workflow merge in the rule-based workflow.
  90. 90. BAdI: Assign Processor to Workflow Step You can use this BAdI to define rules according to which a processor is allocated to the individual workflow steps for the processing of a change request 3.8.3 Adjustments to Change Request Customizing In this Customizing activity you define the following properties, which are valid for all change requests with the same type:  The data model in which a change request is to be valid  When creating the change request, whether the user needs to specify which entities should be processed with the change request (first-time definition of the object list) Note The status of the change request controls which workflow steps can be used for processing the object list.  Whether only a single entity type can be changed with the change request (single object) and which entity type is the main entity type of the change request in that case  Which workflow template should be used when editing the change request  Which entity types can be changed with the change request  If you set the Single Object indicator, then entity types that you enter in addition to the main entity type are changed with the change request of the main entity type.
  91. 91. These settings have to be adjusted for the following reasons:  A new workflow is used  A new UI configuration is used Note If a change request for a change request type already exists, the UI configuration field is grayed out.
  92. 92. 3.8.4 Process Model - BAdI Implementation For the process modeling there is one BAdI available: BAdI: Customize User Interface for Change Requests You can use this BAdI to change the user interface of applications for creating and editing a change request. You can customize the user interface as follows:
  93. 93. 3.9 Initial Load The initial load of records to MDG considering an extended Data Model is not covered in this guide. 3.10 Data Replication 3.10.1 Replication of Material For MDG for material, ALE communication is used exclusively to replicate data from the MDG hub to target systems and clients. This minimizes the effort for the customers in upgrading the connected systems. For more information on the replication of Material (especially in target systems) using ALE, see Customizing under Application Server IDoc Interface / Application Link Enabling (ALE) SAP Business Workflow. 3.10.2 Replication of Supplier or Business Partner Not covered in this version of the guide. 3.10.3 BAdI Implementation The following BAdIs are used in the Data Replication Framework (CA-MDP-DRF) component. BAdI: Definition of Language-Dependent Texts You use this BAdI to change the default system behavior for transferring texts in various languages. For example, you can use the BAdI to include a text in the messages for non-optional elements. The text can be written in another available language or it can function as a replacement text. This text ensures that the system is able to send the message. BAdI: Prepare Data for Download File You can use this BAdI to prepare the file for downloading data from the Master Data Governance hub. BAdI: Prepare Upload Data This Business Add-In (BAdI) is used for uploading master data, language-dependent texts, and hierarchies to the Master Data Governance hub. BAdI: Creation of MDG Change Pointers from ALE Change Pointer You can use this BAdI to create Master Data Governance change pointers from ALE change pointers for selected message types.
  94. 94. 3.11 Key/ Value Mapping If required, mapping can be defined for elements for example, UoM, industry sector, material type and others. The elements for possible value mapping are predelivered. If you are working with multiple connected systems and did not consolidate the material keys during the initial load phase, key mapping may be required. Not applicable to this scenario.
  95. 95. 3.12 Test Run
  96. 96. 4. Extend by existing table Note The node extensibility (entity type), which is introduced in the following sections covers all segments and fields that are contained in data dictionary structure MDG_BS_MAT_S_MAT_DATA. It does not, however, address additionally accessible tables of the Material Master such as the Production Versions of Material (MKAL), the Inspection Type (QMAT), MRP Area for Material (MDMA) or Production Resource Tool Fields in the Material Master (MFHM). In this example, we extend the (Type1) entity type MATERIAL to include the entity type ZZMARC. ZZMARC includes the following attributes:  LVORM  XCHAR  DISMM  DISPO  DISLS
  97. 97. The entity type and the attributes correspond to fields of table MARC. They should also be displayed in the UI.
  98. 98. 4.1 Data Model Requirements (Primary Persistence) 4.1.1 Table Extensions The new attributes already correspond to the fields of data base table MARC. 4.1.2 Structure Extensions The Service Mapping Tool is a program that it is used in ABAP to fill a target structure with a set of source structures. The structures that are relevant for the target structure of the primary persistence (MARC) are:  MDG_BS_MAT_S_MARC  MDG_BS_MAT_S_MARC_UI  MDG_BS_MAT_S_MARC_X The new attributes shown above already correspond to the fields of these structures. Note There several structures that are relevant for mapping of the primary persistence and are already delivered. These have to be extended depended on the use case.
  99. 99. 4.2 Data Model Requirements (Staging) 4.2.1 Data Model Extensions In this Customizing activity, you define and activate a data model to map master data in the system, along with its properties and relationships. The system uses this data model to generate database tables in which the master data can be stored.
  100. 100. 4.2.1.1 Entity types Note The maintenance of the Data Model is cross client. Select the MM data model and add the new entities and attributes as shown in the screenshots. The details of Entity Type ZZMARC are shown in the screenshot below.
  101. 101. Attributes of Entity Type ZZMARC are shown in the screenshot below. We recommend you only assign a Search Help to a Data Element in exceptional circumstances. If you do this, the input help executes the search help instead of reading the data in the check table or the fixed values of data element’s domain. The following entities are needed to define the key fields via creating relationships. Details for Entity Type ZZT438A are shown in the screenshot below.
  102. 102. Details for Entity Type ZZT024D are shown in the screenshot below.
  103. 103. Details for Entity Type ZZT001W are shown in the screenshot below.
  104. 104. Ensure that the customer extension fields consider the customer namespace for DDIC fields. The customer namespace for fields is YY and ZZ. Ensure that the customer extensions entities consider the customer namespace for DDIC structures. The customer namespace for structures is Y and Z. 4.2.1.2 Relationships Create the relationships as shown in the screenshot below.
  105. 105. 4.2.2 Generated Tables Activate the extended data model. Note If you use your own ABAP Dictionary objects (data elements, domains, check tables) in your data model and you changed their properties after the data model was activated refer to Note 1552474. After the activation, the system creates a new table for the entity type ZZMARC.
  106. 106. The screenshot below shows the generated tables before activation. The screenshot below shows the generated tables after activation.
  107. 107. Note that the system created the following fields only (ZBATCH, ZLVORM, and ZZDISLS) because they are maintained as attributes of entity type ZZMARC. The system creates the other fields based on the defined relationships. 4.2.3 Structure Extensions In this Customizing activity, for each data model and entity type you generate the following technical structures in the ABAP Dictionary.
  108. 108. Structures for PDF-based Forms Structures for the Service Mapping tool (SMT) Structures for mapping between active area and staging area Structures for Enterprise Search Structures for Field Control The system uses these structures internally for implementing the reuse active area. Note In general if you change a data model (for example, if you change attributes of entity types or relationships), you need to regenerate the structures.
  109. 109. 4.2.3.1 Maintain customer includes (structures in namespace /MDG*) Not applicable to this scenario. 4.2.3.2 Generate structures (structures in customer namespace) Create new structures for entity type ZZMARC. When you save your work, the structures are generated automatically and assigned a status of New.
  110. 110. Return to the screen in which you created the structures. Click Generate Structures. This activates the structure.
  111. 111. 4.3 SMT Mapping 4.3.1 SMT Mapping You extend mappings by creating new transformations (complex transformations, field mappings) and field checks for them or by editing them. Here you work cross-client. Important When the mappings are saved the corresponding coding is generated. Make sure that all relevant structures are ready before you start. Create three new mapping steps similar to the mappings for the Material entity type as shown below. Note that PP represents Primary Persistence and FC represents Field Control. The mapping step MAP MM Model from PP to FC is shown below.
  112. 112. The mapping step MAP MM Model from Staging Area to PP is shown below. The mapping step MM Model from PP to Staging Area is shown below MAP MM Model from Staging Area to PP 1. In the Display Mapping screen, choose Mapping -> New
  113. 113. 2. Define a mapping step. Its source structure is the generated data-model-specific structure. Its target structure is the API structure. 3. For the Mapping from staging area to active area you have to define a change structure. This is technically relevant for handling initial values. For the mapping step, insert the name of the Change Structure (X-Structure) from the Material API 4. Define the change structure keys. Select the mapping step and choose Change Structure Keys. When the dialog box is displayed, choose Add.
  114. 114. 5. Enter the key fields of the change structure.
  115. 115. 6. Choose Close to leave the dialog box. The Change structure Keys Exist setting is selected for this step. 7. Continue to define the details of the mapping step. Save the mapping MAP MM Model from PP to Staging Area 1. Assign a source structure and a target structure. The source structure is the API structure (andif applicable- additional input structures from the API). The target structure is the generated data-model-specific structure for usage ‘Primary Persistence Mapping’. For the mapping from the active area to the staging area, you do not have to enter a change structure (this is only required for mapping from the staging area to the active area).
  116. 116. 2. In this example, you define a 1:1 mapping between the fields of the API structure (source) and the fields of the generated data-model-specific structure (target).
  117. 117. After you have created the mapping in SMT you should return to the IMG and perform the IMG activity Check Customizing to ensure consistency of the changes. MAP MM Model from PP to FC Assign a source structure and a target structure. The source structure is the API structure, and, if applicable, additional input structures from the API. The target structure is the generated data-modelspecific structure. The result is the following three mappings. 4.3.2 Mapping Customizing In the backend, you must ensure the Where Used value for the SMT mapping from active area is correct for the Entity Type. For each Entity Type you must assign an appropriate Where Used setting and an SMT mapping from active area setting.
  118. 118. 4.4 UI Model The new attributes should also be considered in the UI. 4.4.1 Field Control By default, the UI uses a BAdI implementation to evaluate the field control settings made in Customizing. In this section, you define whether a field is hidden or displayed, or whether an entry is mandatory or optional in material master maintenance by assigning the field to a field selection group. Important The definition has to exist for all fields that are used in the data model. Otherwise the field is hidden from the UI by default.
  119. 119. 4.4.2 Field Control and Data Model In MDG, you created a new entity type for the ERP table MARC. When you create a record in the MARC table in MDG, the system checks the corresponding ERP Customizing table to verify if the relevant fields are required or optional. This is controlled using the field control described above. This means you could run into a situation that a field is not used in the data model but it is set to required in the field control table. The creation process would be blocked as the fields is now required but cannot be maintained. In such a situation, you have to consider the following options:  Adjust the field control  Add the required fields to your Data Model  Use fixed valued in SMT mapping
  120. 120. In our use case, you enhance the SMT mapping using fixed values, as shown in the screenshot below.
  121. 121. 4.4.3 UI configuration For demo purposes the standard UI configuration was copied and extended. Now we want to extend our previous generated UI-configuration by creating a new tab page corresponding to the new entity type ZZMARC.
  122. 122. 1. Create a new tab.
  123. 123. 2. Expand the Main View node to navigate to the newly created Subview and start editing the Attributes..
  124. 124. 3. Navigate to the UIBB (subscreen).
  125. 125. 4. Apply attribute settings as shown in the screenshot below. 5. Click the . And click Yes in the dialog box. 6. Select a Contained Entity Type of ZZMARC.
  126. 126. 7. Add the columns you would like to show up in the UI.
  127. 127. 8. Maintain the following attributes:  For input fields select  For description fields select:
  128. 128. 9. Click . Mark the last 3 entries of the Chosen Feeder Actions section of the dialog box and click OK. 10. Check the UIBB (subscreen) preview. 4.4.4 UI BAdI Implementation 4.4.4.1 Field Control Since the UI is copied for demonstration purposes, the UI BAdI has to be copied and the Filter has to be changed to the new UI configuration ID. This is already covered in a previous use case. 4.4.4.2 Field Adjustment See the previous use case for an explanation.
  129. 129. 4.5 Print Forms Not covered in this version of the guide. 4.6 Search Not covered in this version of the guide.
  130. 130. 4.7 Data Quality 4.7.1 Validation and Derivation see previous use case for an example. 4.7.2 BAdI Implementation See the previous use case for an explanation.
  131. 131. 4.8 Process Model 4.8.1 Workflow See the previous use case for an explanation. 4.8.2 Workflow - BAdI Implementation See the previous use case for an explanation. 4.8.3 Change Request/ Customizing Adjustments See the previous use case for an explanation. 4.8.4 Process Model - BAdI Implementation See the previous use case for an explanation.
  132. 132. 4.9 Initial Load The initial load of records to MDG considering an extended Data Model is not covered in this guide. 4.10 Data Replication 4.10.1 Replication of Material Master Data See the previous use case for an explanation. 4.10.2 Replication of Supplier or Business Partner Master Data Not covered in this version of the guide. 4.10.3 BAdI Implementation See the previous use case for an explanation.
  133. 133. 4.11 Key/ Value Mapping If required, mapping can be defined for elements for example, UoM, industry sector, material type and others. The elements for possible value mapping are predelivered. If you are working with multiple connected systems and did not consolidate the material keys during the initial load phase, key mapping may be required. Not applicable to this scenario.
  134. 134. 4.12 Test Run
  135. 135. 5. Extend by customer field of existing tables ... Add entity type Add entity type ZZMARC MARC MARC ZZMARC MARC MARC that repr esents tabl e by an existi ng fi elds that repr esents tabl e by an existi ng fi elds Table MARA is extended with the customer specific field ZZLOB (Line of Business). Table MARC is extended with the customer specific field ZCONTROL. The Data Model MM is extended by these attributes. The attributes also display in the UI.
  136. 136. 5.1 Data Model Requirements (Primary Persistence) 5.1.1 Table Extensions Append MARA by using append structure to add fields to table MARA, here field ZZLOB If you want to create an append structure and include your customer owned Z field into table T130F, see SAP note 44410. SAP strongly recommends to consider using the customer namespace YY/ZZ for the append fields. Append MARC by using append structure to add fields to table MARC, here field ZCONTROL
  137. 137. 5.1.2 Structure Extensions The Service Mapping Tool is a program that it is used in ABAP to fill a target structure with a set of source structures. The structures that are relevant for the target structure of the primary persistence (MARA) are:  MDG_BS_MAT_S_MARA  MDG_BS_MAT_S_MARA_UI  MDG_BS_MAT_S_MARA_X The structures that are relevant for the target structure of the primary persistence (MARC) are:  MDG_BS_MAT_S_MARC  MDG_BS_MAT_S_MARC_UI  MDG_BS_MAT_S_MARC_X The new fields are automatically included in structures MDG_BS_MAT_S_MARA and MDG_BS_MAT_S_MARC.
  138. 138. Append the field ZZLOB to the following structures:  MDG_BS_MAT_S_MARA_UI  MDG_BS_MAT_S_MARA_X
  139. 139. Append the field ZCONTROL to the following structures:  MDG_BS_MAT_S_MARC_UI  MDG_BS_MAT_S_MARC_X
  140. 140. Note the following information concerning the structures MDG_BS_MAT_S_MARA_X and MDG_BS_MAT_S_MARC_X: If the X-field-structure of the MDGM-API is extended after the creation of an SMT mapping, the SMT mapping needs to be regenerated. Therefore enter the SMT maintenance and save. 5.2 Data Model Requirements (Staging) 5.2.1 Data Model Extensions In this Customizing activity, you define and activate a data model to map master data in the system, along with its properties and relationships. The system uses this data model to generate database tables in which the master data can be stored.
  141. 141. 5.2.1.1 Entity types Note The maintenance of the Data Model is cross client. Select the MM data model and add the new entities and attributes as shown in the screenshots. The details of the MATERIAL Entity Type are shown in the screenshot below. The details of the ZZMARC Entity Type are shown in the screenshot below.
  142. 142. Ensure that the customer extension fields consider the customer namespace for DDIC fields. The customer namespace for fields is YY and ZZ. Ensure that the customer extensions entities consider the customer namespace for DDIC structures. The customer namespace for structures is Y and Z. 5.2.1.2 Relationships This is already covered in a previous use case. 5.2.2 Generated Tables Activate the extended data model. Note If you use your own ABAP Dictionary objects (data elements, domains, check tables) in your data model and you changed their properties after the data model was activated refer to Note 1552474. After the activation the new fields are added to the generated table, as shown in the screenshot below.
  143. 143. 5.2.3 Structure Extensions In this Customizing activity, for each data model and entity type you generate the following technical structures in the ABAP Dictionary.  Structures for PDF-based Forms  Structures for the Service Mapping tool (SMT)  Structures for mapping between active area and staging area  Structures for Enterprise Search  Structures for Field Control
  144. 144. The system uses these structures internally for implementing the reuse active area. Note In general if you change a data model (for example, if you change attributes of entity types or relationships), you need to regenerate the structures. 5.2.3.1 Maintain Customer Includes For Structures in the /MDG* Namespace Call transaction SE11 and create the customer include for the following structures:
  145. 145. The names of the customer includes are as follows:  CI_MDG_S_PMM_MATERIAL  CI_MDG_S_MM_MATERIAL  CI_MDG_SD_MM_MATERIAL  CI_MDG_S_EMM_MATERIAL
  146. 146. Add the field in each include and activate 5.2.3.2 Generate Structures (Structures in Customer Namespace) Regenerate the structures, as described in the previous use case.:
  147. 147. The structures are extended automatically.
  148. 148. 5.3 SMT Mapping 5.3.1 SMT Mapping You extend mappings by creating new transformations (complex transformations, field mappings) and field checks for them or by editing them. Here you work cross-client. Important When the maps are saved the corresponding coding is generated. Make sure that all relevant structures have been maintained before. As described in the previous use case, extend the Mapping step MDG_BS_MAT_MATERIAL for the following Mappings:  MDG_BS_MAT_MAP_2PP  MDG_BS_MAT_MAP_2FC  MDG_BS_MAT_MAP_2STA
  149. 149. As described in the previous use case extend for the MARC extension in the Mappings:
  150. 150. After you have created the mapping in SMT you should return to the IMG and perform the IMG activity Check Customizing to ensure consistency of the changes. 5.3.2 Mapping Customizing See the previous use case for an explanation.
  151. 151. 5.4 UI Model The new attributes should also be considered in the UI. 5.4.1 Field Control By default, the UI uses a BAdI implementation to evaluate the field control settings made in Customizing. In this section, you define whether a field is hidden or displayed, or whether an entry is mandatory or optional in material master maintenance by assigning the field to a field selection group. Important The definition has to exist for all attributes that are used in the data model. Otherwise the attribute is hidden in the UI by default. Enhance central field table T130F.If you want these fields to be subject to standard field selection, you must add new entries for them to the central field table for material master maintenance (T130F)
  152. 152. 5.4.2 Field control and Data Model See the previous use case for an explanation. 5.4.3 UI configuration In this Customizing activity, you manage UI configurations, which the system uses for the following purposes: Definition of the Web user interface for individual processing of an entity type (Web Dynpro application USMD_ENTITY_VALUE2) Use in the Web user interface for creating and processing a change request. You can create an edit different UI configurations for each data model. For demo purposes the standard UI configuration was copied and extended. As described in the previous use case extend the General Data tab with the ZZLOB field and the Material Plant Data tab with the field ZCONTROL.
  153. 153. 5.4.4 UI BAdI Implementation 5.4.4.1 Field Control Since the UI is copied for demonstration purposes, the UI BAdI has to be copied and the Filter has to be changed to the new UI config ID. This is already covered in a previous use case. 5.4.4.2 Field Adjustment See the previous use case for an explanation.
  154. 154. 5.5 Print Forms Not covered in this version of the guide. 5.6 Search Not covered in this version of the guide.
  155. 155. 5.7 Data Quality 5.7.1 Validation and Derivation see previous use case for an example. 5.7.2 BAdI Implementation See the previous use case for an explanation.
  156. 156. 5.8 Process Model 5.8.1 Workflow See the previous use case for an explanation. 5.8.2 Workflow - BAdI Implementation See the previous use case for an explanation. 5.8.3 Change Request/ Customizing Adjustments See the previous use case for an explanation. 5.8.4 Process Model - BAdI Implementation See the previous use case for an explanation.
  157. 157. 5.9 Initial Load The initial load of records to MDG considering an extended Data Model is not covered in this guide. 5.10 Data Replication 5.10.1 Replication of Material See the previous use case for an explanation. 5.10.2 Replication of Supplier or Business PartnerNot covered in this version of the guide. 5.10.3 BAdI Implementation See the previous use case for an explanation.
  158. 158. 5.11 Key Mapping and Value Mapping If required, mapping can be defined for elements for example, UoM, industry sector, material type and others. The elements for possible value mapping are predelivered. If you are working with multiple connected systems and did not consolidate the material keys during the initial load phase, key mapping may be required. Not applicable to this scenario.
  159. 159. 6. Extend by customer table or entity type A customer table ZZCOUNTRYDETAILS was created in the Data Dictionary. The MM data model is extended by this entity type. Caution To create customer-specific reuse area, you currently require the support of SAP consulting and development. see note 1444616.
  160. 160. 6.1 Data Model Requirements (Primary Persistence) 6.1.1 Table Extensions Create a new data base table ZZCOUNTRYDETAILS 6.1.2 Structure Extensions Not relevant as a customer access class has to be implemented as the delivered API cannot handle this. 6.2 Data Model Requirements (Staging) 6.2.1 Data Model Extensions In this Customizing activity, you define and activate a data model to map master data in the system, along with its properties and relationships. The system uses this data model to generate database tables in which the master data can be stored.
  161. 161. 6.2.1.1 Entity types Note The maintenance of the Data Model is cross client. Select the MM data model and add the new entities and attributes as shown in the screenshots. The details of Entity Type YYCNTRINF are shown in the screenshot below.
  162. 162. The details of Entity Type YYCOUNTRY are shown in the screenshot below.
  163. 163. 6.2.1.2 Relationships 1. Choose a Relationship Type of P Leading for a relationship with a From-Entity Type of MATERIAL and a To-Entity Type of YYCNTRINF 2. Choose a Relationship Type of Q Qualifying for a relationship with a From-Entity Type of YYCOUNTRY and a To-Entity Type of YYCNTRINF
  164. 164. 6.2.1.3 Reuse Area The Reuse Active Area specifies the reuse active area for active data. This is done by establishing the communication between Master Data Governance (MDG) and the tables that should be reused for the active data, using an ABAP class and the ABAP interface IF_USMD_PP_ACCESS. 6.2.1.3.1 Customer Build Reuse area To update database table ZZCOUNTRYDETAILS which is then the active area you would need to implement a new access class. Create a new reuse area called ZExtension and assign the ZCL_MDG_BS_MAT_ACCESS access class to it.
  165. 165. Assign the new Reuse Area to the new entity type
  166. 166. Caution To create a customer-specific reuse area, you currently require the support of SAP consulting and development. See note 1444616. 6.2.1.3.1 Reuse Area MDG You can assign the MDG reuse area to the new entity type In this case, the generated table stores the active data. The status field USMD_ACTIVE handles storage. The original database table ZZCOUNTRYDETAILS is not updated anymore.
  167. 167. Note Since the flexoption is used for the new entity type, records stay in the generated tables and the creation of mapping structures for SMT is not needed
  168. 168. 7. Create own data model with customer object Airline Partner Caution To create a customer-specific reuse area, you currently require the support of SAP consulting and development. See note 1444616.
  169. 169. 7.1 Data Model The first step to define a Master Data Governance Custom Object is to define the data model. The following chapter describes how one can derive from an Entity relationship model the required MDG entities and relationships. We use the example of some parts of the SAP Flight model that is often used for training. The modeling part here has two examples that reflect necessary types of entities and relationships. The first example is not modeled in full detail but gives you and overview what you need to consider if you want to transfer an existing model into a MDG model. The second example shows the basic steps in the Customizing and is the prerequisite of all subsequent steps, for example, the UI modeling. 7.1.1 MDG Data Model - Details Make sure you read the related Customizing Documentation and the respective help.sap.com material before you proceed. In the following we briefly refer to entity types and relationship types of the MDG framework. 7.1.2 Example 1: Airline and Flights
  170. 170. The Airline and Flights data model is shown in the graphic below. The Entity relationship model (ERP) consists of the following entities:  SCARR- Airline  SPFLI -- Flight schedule  SPFLIGHT- Flight
  171. 171. The table below shows the entity types in more detail. SCARR MANDT CARRID CARRNAME CURRCODE URL Data element S_MANDT S_CARR_ID S_CARRNAME S_CURRCODE S_CARRURL 1 0..n 1 0..n 7.1.2.1 Data SPFLI element MANDT S_MANDT CARRID S_CARR_ID CONNID S_CONN_ID COUNTRYFR LAND1 CITYFROM S_FROM_CIT AIRPFROM S_FROMAIRP COUNTRYTO LAND1 CITYTO S_TO_CITY AIRPTO S_TOAIRP FLTIME S_FLTIME DEPTIME S_DEP_TIME ARRTIME S_ARR_TIME DISTANCE S_DISTANCE DISTID S_DISTID FLTYPE S_FLTYPE PERIOD S_PERIOD Data SFLIGHT element MANDT S_MANDT CARRID S_CARR_ID CONNID S_CONN_ID FLDATE S_DATE PRICE S_PRICE CURRENCY S_CURRCODE PLANETYPE S_PLANETYE SEATSMAX S_SEATSMAX SEATSOCC S_SEATSOCC PAYMENTSUM S_SUM SEATSMAXB S_SMAX_B SEATSOCCB S_SOCC_B SEATSMAXF S_SMAX_F SEATSOCCF S_SOCC_F Derive Entities and Relationships to MDG You can scan through the mode from the top down first identifying the leading entity types and relationships, then the qualifying entity types and then the referencing entity types. In our model the object root is the SCARR entity type, which is the leading entity type for entity type SPFLI and SFLIGHT. 1. Entities of type 1 and 4 / Leading Relationships
  172. 172. The Leading relationship models the key attributes SCARR_SPFLI and SCARR_SPFLIGHT into the respective entity type. Entity Type Key Entity type SCARR SPFLI SFLIGHT S_CARR_ID Relationship Relationship Type From To SCARR_SPFLI SCARR_SPFLIGHT Leading Leading SCARR SCARR SPFLI SPFLIGHT 1 4 4 Note The Relationship name becomes the key attribute name in the respective generated table. 2. Qualifying Relationships The SPFLI entity type has one additional key attribute; the field ConnID is qualifying the entity type.
  173. 173. In this case we need to model an entity type of type 3 and a respective relationship type qualifying. Note For demonstration purposes, we create a new data element ZS_CONN_ID that has the same data type and other attributes as S_CONNID. We do not specify a check table for ZS_CONN_ID. As well as the qualifying key CONNID, the entity type SFLIGHT has another key; flight date: FLDATE. Important The MDG Framework has a limitation that entity types with a data element referring to a date or time data type cannot be taken into account.
  174. 174. As a workaround, you can model a field. For example, you can use a CHAR field for the qualifying entity type with a length of 8. Keep the proper date field as a normal attribute in the entity type. Later you can make use of BRF+ and UI modeling to hide the character field and derive a date using the normal attribute. Taking all this into consideration we model the following: Entity Type Key CONNID FLDATE S_CONN_ID Z_SFLIGHT_DATE Relationship CONNID_SPFLI CONNID_SFLIGHT FLDATE_SFLIGT Relationship Type Qualifying Qualifying Qualifying Entity type 3 3 From CONNID CONNID FLDATE To SPFLI SFLIGHT SFLIGHT 3. Referencing Attributes The referencing attributes can be derived using the following logic:  If the attribute that references another entity type uses just one key, you can either model a relationship or you can create a new entry in a table for the entity type  If an attribute that references another entity type uses two keys, you must create two relationships, a leading relationship and a qualifying relationship Let us have a look on our example: SGEOCITY MANDT S_MANDT CITY COUNTRY LATITUDE LONGITUDE S_CITY LAND1 S_LATI S_LONG The attribute CITYFROM refers to the table SGEOCITY via the domain value table. For the reference it is necessary to take city and country into account. Entity Type CITY_FROM COUNT_FRM Key S_FROM_CIT LAND1 Entity type 3 3
  175. 175. Relationship Relationship Type From To CITYFROM CO_FR_2_C Referencing Leading CITY_FROM SPFLI COUNT_FRM CITY_FROM
  176. 176. 7.1.3 Example 2: Flight customers The following Enterprise Relationship Model (ERM), which is represented using ABAP Dictionary tables, is used to build up an MDG application for maintaining flight customers. The tables in this model are in the SAP namespace but the steps and requirements to bring them into governance are the same as they would be in the customer namespace. SCUSTOM MANDT ID NAME FORM STREET POSTBOX POSTCODE CITY COUNTRY REGION TELEPHONE CUSTTYPE DISCOUNT LANGU EMAIL WEBUSER 1 1 SBUSPART MANDANT BUSPARTNUM CONTACT CONTPHONO BUSPATYP Flight customers S_MANDT S_CUSTOMER S_CUSTNAME S_FORM S_STREET S_POSTBOX POSTCODE CITY S_COUNTRY S_REGION S_PHONENO S_CUSTTYPE S_DISCOUNT SPRAS S_EMAIL S_WEBNAME Airline Partner S_MANDT S_BUSPANUM S_CONTACT S_CPHONENO S_BUSPATYP 1 1 STRAVELAG MANDT AGENCYNUM NAME STREET POSTBOX POSTCODE CITY COUNTRY REGION TELEPHONE URL LANGU CURRENCY Travel agency S_MANDT S_AGNCYNUM S_AGNCYNAM S_STREET S_POSTBOX POSTCODE CITY S_COUNTRY S_REGION S_PHONENO S_URL SPRAS S_CURR_AG
  177. 177. The goal is to have a MDG application that uses a simple standard workflow for governance. we want to demonstrate how to adapt the reuse mechanism and show how easy it is to implement basic derivations and validity checks. Noteor usage of the reuse option that requires deep programming and application knowledge see note 1444616. Customer implementations may become obsolete as the interface (see respective chapter) changes. This document shows which steps are required to bring an existing application into governance.
  178. 178. 7.2 Data Modeling According to the ERM in chapter 5.1.3 we have a one type 1 and two type 2 entities. They have a leading relationship to each other. The Master Data Governance Framework handles all other references such as CURRENCY using the domain value table. Furthermore the fields CITY, COUNTRY, REGION are considered as free text and don’t have domain values. The following entity types and relationships need to be modeled: Entity Type SBUSPART SCUSTOM STRAVELAG Key S_BUSPANUM Entity type Relationship IS_FCUST IS_TRAVEL Relationship Type Leading Leading From SBUSPART SBUSPART 7.2.1 1 4 4 To Cardinality SCUSTOM 1:1 STRAVELAG 1:1 Create Data Model Open Customizing for Master Data Governance under General Settings -> Data Modeling -> Edit Data Model Note As an alternative you can directly open the view cluster VC_USMD001S with transaction SM34. You have to specify directly the data model you want to edit. Click new entries and specify a new data model as shown below. Figure 1 Create Data Model 7.2.2 Create Entity Types Select the node Entity types and click New Entries.
  179. 179. Figure 2 Create entity type Specify the entities as shown below. For further explanation of the single attributes one can specify here, refer to the Customizing Help, to the F1 help and to help.sap.com. Figure 3 Entity Type details When you add the other entities, use the following values. Entity type Storage/Use Type SBUSPART 1 Changeable via Change Request … SCUSTOM 4 Changeable via other Entity type… STRAVELAG 4 Changeable via other Entity type… Data Element Key Assignment S_BUSPANUM Key cannot be … Key cannot be … Key cannot be … Description Airline Customers Flight customers Travel agencies Specify the attributes for the entities. Highlight the entity type you want to maintain and navigate to the node attributes.
  180. 180. Figure 4 Attribute Overview Repeat the previous step for the other entities. Entity Type: SBUSPART Attribute Data element BUSPATYP CONTACT CONTPHONO S_BUSPATYP S_CONTACT S_CPHONENO Entity Type: STRAVELAG Attribute Data element CITY COUNTRY CURRENCY NAME POSTBOX POSTCODE REGION STREET TELEPHONE URL ZLANGU CITY S_COUNTRY S_CURR_AG S_AGNCYNAM S_POSTBOX POSTCODE S_REGION S_STREET S_PHONENO S_URL SPRAST
  181. 181. Note The ABAP Dictionary table STRAVELAG (which you can check using transaction SE11) includes the LANGU attribute for the SPRAS data element. The MDG data model cannot implement this attribute. The attribute names MANDT, LANGU, SID, TXTLG, TXTMI, and TXTSH are forbidden. The data element SPRAS is also forbidden but it can be replaced by SPRAST. Entity Type: SCUSTOM Attribute Data element SCITY SCOUNTRY SCUSTTYPE SDISCOUNT SEMAIL SFORM SLANGU SNAME SPOSTBOX SPOSTCODE SREGION SSTREET STELEPHON SWEBUSER CITY S_COUNTRY S_CUSTTYPE S_DISCOUNT S_EMAIL S_FORM SPRAST S_CUSTNAME S_POSTBOX POSTCODE S_REGION S_STREET S_PHONENO S_WEBNAME Note Since an attribute (for example city) can only be assigned to an entity type with a Storage and Use Type of 1 once, we have to rename the attributes of entity type SCUSTOM. To overcome the restriction we put an S as a prefix. This is also true for indirect assignments inherited from leading entity types with a Storage and Use Type of 4. 7.2.3 Create relationships As we saw in the beginning of this chapter we need to model 2 relationships: Relationship IS_FCUST IS_TRAVEL Relationship Type Leading Leading From SBUSPART SBUSPART Highlight the node relationships and press New Entries. To Cardinality SCUSTOM 1:1 STRAVELAG 1:1
  182. 182. Figure 5 Entering new relationships Specify the relationship details Figure 6 Relationship details Note Cardinality S = 1:1 Translation
  183. 183. 7.2.4 Activate data model Now the MDG data model is finished and can be activated Note If you use your own ABAP Dictionary objects (data elements, domains, check tables) in your data model and you changed their properties after the data model was activated refer to Note 1552474. Figure 7 Activate the data model Note The generated tables for your data model one can see with report USMD_DATAMODEL using transaction SE38. Figure 8 Launch Report USMD_DATA_MODEL with Transaction SE38 The report is showing all generated tables for a particular data model. Figure 9 Generated MDG tables
  184. 184. 7.2.5 Generate data model specific structures Full Path: Cross-Application Components -> Master Data Governance -> General Settings -> Data Modeling -> Generate Data Model-specific Structures Choose your data model and highlight the node Structures Figure 10 Data model structures Specify the details of the structures. Figure 11 Structure details
  185. 185. Note If you specify the Entity Type and the Where Used Area, the Prefix Namespace and the Name of Structure are populated automatically. 7.3 Primary Persistence (PP) Access Class By now we modeled a Flexibility Option. Here the active area and the staging area are identical and generated by the MDG. Since we want connect the data to the tables listed below, we need to take care that the active area (primary persistence) of our application is being represented by these tables and the inactive (staging) area still contains the generated tables. Note To create customer-specific reuse area, you currently require the support of SAP consulting and development. See note 1444616. That means for customer projects implementing a custom objects, changes may occur with coming releases. Inside this guide we will nevertheless show how to implement the connection. 7.3.1 Implementing the PP Access Class A Reuse Area has to be defined and an access class has to be implemented and assigned; this usually means considerable effort. Existing APIs may be invoked in the implementation. The implementation rules have to be obeyed, i.e. the returned data must not depend on the user’s authorization and involved objects must be lockable in the separate methods. Note that these are very strong restrictions that are not easy to meet. You need to create a class that implements the IF_USMD_PP_ACCESS interface (Access to Active Area). See the appendix for coding. Note Use the generated structure for the mapping in VC_USMD006
  186. 186. 7.3.2 Create and assign a reuse area In Customizing for Master Data Governance choose General Settings -> Data Modeling -> Edit Data Model. 3. Navigate to the Reuse Active Areas node for your data model 4. Click new entries Figure 12 Reuse Areas 5. Enter SCUSTOM in the Reuse Area column, and Z_PP_SCUSTOM in the Access Class column, Figure 13 Reuse Area Definition 6. Go back to the Data Model node and enter the Reuse Area. Figure 14 Data model --> Reuse Area 7. Navigate to the Entity Types and specify the Reuse Area.
  187. 187. Figure 15 Entity Types - Reuse Area 8. Save and activate your data model. Note As already mentioned to activate the data model, you need to consult note 1444616.
  188. 188. 7.4 UI configuration To make the model we just created visible we need to create a UI configuration and we need to build some portal content to make publish the application in the portal environment. 7.4.1 Change request 1. In Customizing for Master Data Governance, choose General Settings -> UI Modeling ->Edit UI Configuration. 2. Click Create to create a new UI configuration. Figure 16 UI Config Tool 3. Check the deep copy mode, rename the targets, and click Start Deep Copy Figure 17 Deep Copy 4. Specify a package and a transport if the system asks you. After the copy is complete you will get the following notification Figure 18 Copy successful 5. Close the Floorplan Manager browser window and go to the UI Configuration window. Click Refresh.
  189. 189. Figure 19 New Appl. Config created 6. Now you should be able to see your copy. Click Edit. Figure 20 Edit new Appl. Config 7. The UI Configuration needs to be linked to the data model. Click Change Figure 21 Change the UI Config 8. Navigate to the Application Parameters tab strip and specify the Data Model ZO Figure 22 Application Parameters
  190. 190. 9. Click Save and go back to the Structure tab strip. Click Go to Component Configuration Figure 23 Component Configuration 10. Familiarize yourself with the modeling environment. Figure 24 Component Configuration Screen 11. Decide what your next steps should be:  You need to model 3 tab strips, one for each entity type  So you need to model 3 main views. Each main view has a subview, requiring a UI Building Block (UIBB)
  191. 191.  You need to delete the automatically assigned dummy entity type. 12. Create the first tab strip for the entity type SBUSPART. First assign the entity type SBUSPART to the configuration and then delete the dummy entity type that is assigned automatically Figure 25 Add new entity type 13. Choose Entity Type SBUSPART as the first entity type and click Add 14. Delete the entity type Must be deleted.

×