The data that needs to be managed and governed via a governance process is determined by the data model definition.
The standard content provides the option to configure what data needs to be governed based on the available data entities and attributes of the data model. It also provides the option to add additional entities or attributes that aren’t part of the standard data model.
Some common use cases for data model extension are adding industry-specific master data attributes, adding enhanced data fields that already exist in the master data repository tables (extended SAP S/4HANA and SAP ERP tables), adding process-specific attributes, and adding fields that need to exist only in SAP Master Data Governance staging tables and not in SAP S/4HANA and SAP ERP tables (flex option), among others. These requirements can be achieved by adding additional entities or extending the standard entities with new attributes. These new entities can be mapped to the reuse area or can be flex entities. The relationships between the new entities and the existing entities need to be maintained to validate the data. The most common use cases for a data model extension include the following:
- Adding existing standard fields (reuse option): This involves the requirement to extend the standard SAP Master Data Governance data model with standard fields that aren’t part of the SAP Master Data Governance data model. Examples of such fields include those that come with industry-specific solution add-ons, fields related to standard database tables that aren’t in the SAP Master Data Governance standard scope, and so on. Based on the number of fields and the type of fields (check tables, text fields, etc.), these fields could be added as attributes to the standard entities or custom entities in the standard data model.
- Adding custom fields (reuse option): This involves the requirement to extend the standard SAP Master Data Governance data model with custom/enhanced fields that were added to the standard SAP S/4HANA and SAP ERP tables or custom tables that are linked to the standard tables. Based on the number of fields and the type of fields (check tables, text fields, etc.), these fields could be added as attributes to the standard entities or custom entities in the standard data model.
- Adding custom fields (flex option) This involves the requirement to extend the standard SAP Master Data Governance data model with custom fields that need not be mapped to the active area. Examples of such fields include process-specific fields that are used to determine process flows, fields based on user entry, extending data models with additional flex fields, and so on.
The following sections discuss various steps to implement these data model enhancements, from adding attributes to the standard data model to adding new entities to data models.
Adding Attributes to Standard Data Models
Adding attributes to the standard data model can be accomplished by adding attributes to the existing entities or defining an entity relationship. Attributes can be added only to storage type 1 or type 4 entities. The new entities can be flex entities or reuse entities, based on the entity definition and type of data (master, reference, process-specific, etc.). If the newly added field is part of a check table or has foreign keys, then a storage type 3 entity is defined, and a relationship is configured with the linked entity. If the field already exists in the SAP S/4HANA and SAP ERP tables (reuse option), mappings between the staging and active area need to be maintained through the SMT mapping.
For the business partner data model, if the business partner-related field needs to be part of the customer or vendor UI, CVI mapping needs to be defined to map the field from the business partner model to the corresponding customer or vendor field. Because the finance data model (0G), unlike the material master or business partner data model, is based on the flex option, SMT mapping isn’t required.
The customer namespace for adding fields is ZZ or YY. A namespace and custom package need to be provided on configuration; the structures are generated on activation of the data model. They can be visualized in the configuration view to display the graphical model. The generated tables can also be verified by Transaction MDG_DATA_MODEL.
After the data model is extended, the data model is activated and generated so that the extended fields can be used in the governance process. The staging area needs to be adjusted by running report USMD_ADJUST_STAGING, which helps in adjusting the staging area for the linked change requests. The generated structures are used to configure and extend the UIs based on the entity/attribute relationships.
After the attributes to be enhanced or added are identified, the standard data model can be extended. For the business partner data model enhancements, CVI mapping needs to be updated if the business partner fields need to be mapped to the customer/supplier structure. You can extend the model by following these steps:
- Extend the SAP S/4HANA and SAP ERP table (for new reuse fields), if it doesn’t already exist (reuse option for business partner and material master data models).
- Using Transaction MDGIMG, select the data model, and extend it with the new attributes in the corresponding entity definition associated with the SAP S/4HANA and SAP ERP table or with a referencing relationship.
- Activate the date model.
- Generate data model–specific structures. Structures for mapping between staging and active areas (for reuse area models) and field properties are mandatory. Other structure usage types (structures for PDF-based forms, for SAP Enterprise Search, and for field control) may be added as required. Additional metadata structures may need to be extended based on the domain. For example, for the material domain, extend structure MDG_BS_MAT_S_MAT_DATA, and check/adjust corresponding table type structures MDG_BS_MAT_S_<table>* and CMD_BS_MAT_S_<table>*, as needed (for more information, check the help documentation).
- For the reuse option, enhance the access and respective handler classes (for the business partner model) to read and write in the reuse area. Access classes control the handler class calls. Handler classes need to be enhanced to read and save data for custom entities and attributes. A single handler class is responsible for a single object operation.
- Define SMT mapping (for reuse fields). This defines the field mapping between the staging area and primary persistence area in both directions so that, upon activation of the change requests, the data is saved to the reuse area (active area).
- Adjust the staging area for linked change requests.
Adding New Entities to the Data Model
The data model can be extended with additional entities. The data associated with these entities can be stored in SAP Master Data Governance or in SAP S/4HANA and SAP ERP tables upon activation of the change request. The newly defined entities need to be linked to other entities via relationships. The cardinality of the relationship is determined based on the data set.
The steps to extend the standard data model with new entities are the same. For the material data model, the MDG_BS_MAT_API_SEGMENTS_ EXT Business Add-In (BAdI) is also implemented.
After the data model is extended, the UI needs to be enhanced. For the business partner model, the Generic Interaction Layer (GenIL) model is also extended to connect the data model with the GenIL model, which integrates the model fields to the UI. The mapping of the GenIL model to the data model is done through view cluster VC_MDG_BS_GENIL_C (Transaction SM34).
Editor’s note: This post has been adapted from a section of the book SAP Master Data Governance: The Comprehensive Guide by Bikram Dogra, Antony Isacc, Homiar Kalwachwala, Dilip Radhakrishnan, Syama Srinivasan, Sandeep Chahal, Santhosh Cheekoti, Rajani Khambhampati, Vikas Lodha, and David Quirk.
Comments