Extend MDG
-
Upload
amaranathreddy-yg -
Category
Documents
-
view
157 -
download
14
description
Transcript of Extend MDG
-
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 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,
withou t 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 w arranties 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
code change in these components may cause unpredictable
and severe malfunctions and is therefore expressively
prohibited, as is any decompilation of these components.
modified or altered in any way.
-
Document History
Document Version Description
1.00 First official release of this guide
-
Typographic Conventions
Type Style Description
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.
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.
Icons
Icon Description
Caution
Note or Important
Example
Recommendation or Tip
-
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 Reuse Area versus the Flexible Option / Access class ................................................ 6
2.4 Entity Relationship Model ............................................................................................. 8
2.5 UI Creation .................................................................................................................. 15
2.5.1 UI Configuration ............................................................................................. 16
2.5.2 UI BAdI ........................................................................................................... 18
2.6 UI Entry Point .............................................................................................................. 19
2.6.1 Portal .............................................................................................................. 19
2.6.2 SAP GUI......................................................................................................... 20
2.6.3 NetWeaver Business Client ........................................................................... 22
3. Extend by existing field .................................................................................................... 25
3.1 Data Model Requirements (Active Area) .................................................................... 26
3.1.1 Table Extensions ........................................................................................... 26
3.1.2 Structure Extensions ...................................................................................... 26
3.2 Data Model Requirements (Staging Area) ................................................................. 27
3.2.1 Data Model Extensions .................................................................................. 27
3.2.2 Generated Tables .......................................................................................... 31
3.2.3 Structure Extensions ...................................................................................... 33
3.3 SMT Mapping ............................................................................................................. 40
3.3.1 SMT Mapping ................................................................................................. 40
3.3.2 Mapping Customizing .................................................................................... 45
3.4 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 Validation and Derivation ............................................................................... 69
3.7.2 BAdI Implementation ...................................................................................... 84
3.8 Process Model ............................................................................................................ 85
3.8.1 Workflow ........................................................................................................ 85
3.8.2 Workflow - BAdI Implementation ................................................................. 100
3.8.3 Adjustments to Change Request Customizing ............................................ 101
3.8.4 Process Model - BAdI Implementation ........................................................ 104
3.9 Initial Load ................................................................................................................ 105
-
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 Table Extensions ......................................................................................... 114
4.1.2 Structure Extensions .................................................................................... 114
4.2 Data Model Requirements (Staging) ........................................................................ 115
4.2.1 Data Model Extensions ................................................................................ 115
4.2.2 Generated Tables ........................................................................................ 123
4.2.3 Structure Extensions .................................................................................... 125
4.3 SMT Mapping ........................................................................................................... 130
4.3.1 SMT Mapping ............................................................................................... 130
4.3.2 Mapping Customizing .................................................................................. 137
4.4 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 Validation and Derivation ............................................................................. 156
4.7.2 BAdI Implementation .................................................................................... 156
4.8 Process Model .......................................................................................................... 157
4.8.1 Workflow ...................................................................................................... 157
4.8.2 Workflow - BAdI Implementation ................................................................. 157
4.8.3 Change Request/ Customizing Adjustments ............................................... 157
4.8.4 Process Model - BAdI Implementation ........................................................ 157
4.9 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 Table Extensions ......................................................................................... 171
5.1.2 Structure Extensions .................................................................................... 172
5.2 Data Model Requirements (Staging) ........................................................................ 175
5.2.1 Data Model Extensions ................................................................................ 175
-
5.2.2 Generated Tables ........................................................................................ 178
5.2.3 Structure Extensions .................................................................................... 180
5.3 SMT Mapping ........................................................................................................... 188
5.3.1 SMT Mapping ............................................................................................... 188
5.3.2 Mapping Customizing .................................................................................. 192
5.4 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 Validation and Derivation ............................................................................. 200
5.7.2 BAdI Implementation .................................................................................... 200
5.8 Process Model .......................................................................................................... 201
5.8.1 Workflow ...................................................................................................... 201
5.8.2 Workflow - BAdI Implementation ................................................................. 201
5.8.3 Change Request/ Customizing Adjustments ............................................... 201
5.8.4 Process Model - BAdI Implementation ........................................................ 201
5.9 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 Table Extensions ......................................................................................... 205
6.1.2 Structure Extensions .................................................................................... 205
6.2 Data Model Requirements (Staging) ........................................................................ 205
6.2.1 Data Model Extensions ................................................................................ 205
7. Create own data model with customer object Airline Partner .................................... 214
7.1 Data Model ............................................................................................................... 215
7.1.1 MDG Data Model - Details ........................................................................... 215
7.1.2 Example 1: Airline and Flights ..................................................................... 215
7.1.3 Example 2: Flight customers ....................................................................... 222
7.2 Data Modeling ........................................................................................................... 224
7.2.1 Create Data Model ....................................................................................... 224
7.2.2 Create Entity Types ..................................................................................... 224
7.2.3 Create relationships ..................................................................................... 227
7.2.4 Activate data model ..................................................................................... 229
7.2.5 Generate data model specific structures ..................................................... 230
7.3 Primary Persistence (PP) Access Class .................................................................. 231
7.3.1 Implementing the PP Access Class ............................................................. 231
-
7.3.2 Create and assign a reuse area .................................................................. 232
7.4 UI configuration......................................................................................................... 234
7.4.1 Change request ........................................................................................... 234
7.4.2 Portal content ............................................................................................... 242
7.4.3 UI Business Add In ...................................................................................... 242
7.5 Process Modeling ..................................................................................................... 246
7.5.1 Process Modeling - Change Request .......................................................... 246
7.5.2 Process Modeling- Workflow ....................................................................... 247
7.6 Data Quality and Search: Validation and derivations based on BRFplus ................ 249
7.6.1 Check for Flights With a Customer Discount of 4% or Less ........................ 249
8. 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
-
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.
-
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 v ersu s the Fle xible O ption / 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.
SAPEVENT:DOCU_LINK/DS:DE.USMD_PP_DOMAIN -
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.
-
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:
-
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/< Entity Type >.
Entity type:
Relationships:
Generated Table:
-
Field Name
If the relationship type is Referencing, the syntax used to derive a field name is as follows:
/1MD/ .
Entity type:
-
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, you can generate a data model. The data element name for each field is derived from
the to-entity type.
-
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 From-Entity Type is an optional attribute of the To-Entity Type.
SAPEVENT:DOCU_LINK/DS:DE.USMD_USAGE_TYPESAPEVENT:DOCU_LINK/DS:DE.USMD_RELTYPE -
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.
-
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.
SAPEVENT:DOCU_LINK/DS:GLOS.89B12943341FA04591FCEFD81ABB2791 -
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:
-
- 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.
-
2.6 UI Entry Poin t
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.
-
The System parameter represents the system used in your environment.
The Change Material screen is shown below.
2.6.2 SAP GUI
-
You assign the following roles to the business client:
SAP_MDGM
SAP_MDGS
-
2.6.3 Net Weaver Business Client
You assign the following roles to the NetWeaver business client:
SAP_MDGM
SAP_MDGS
-
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).
-
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.
-
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.
-
3.2.1.1 Entity T ype s
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 .
-
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 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.
-
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 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
SAPEVENT:DOCU_LINK/DS:GLOS.43FD33517B2E0B4FE10000000A114B08SAPEVENT:DOCU_LINK/DS:GLOS.47B96C904A74353DE10000000A421391 -
adjustment is that delivered structures in namespace /MDG* are not generated as these structures are already delivered by SAP as fixed.
-
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
-
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.
-
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 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.
-
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 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.
-
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 Map ping 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.
-
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.
SAPEVENT:DOCU_LINK/DS:DE.FGRUPSAPEVENT:DOCU_LINK/DS:DE.FGRUP -
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.
-
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.
-
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.
-
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.
-
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 .
-
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.
-
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.
-
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 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.
-
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.
-
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 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.
-
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
-
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).
-
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
-
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.
-
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 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.
-
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.
-
2. In the Node DERIVE_MATERIAL_ZZMS dialog box, name the node using the following
notation: DERIVE_
-
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.
-
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 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.