Configuring Data Replication
You can replicate master data stored within MDG as well as reference data, stored in configuration tables. The replication process is slightly different in each case.
MDG offers the following options to store active master data (data that has been approved):
The reuse option used by MDG-M and MDG-S stores data in the SAP ERP tables such as MARA or LFA1.
The flex option used by MDG-F and MDG for Custom Objects stores data in generated tables.
In both options, inactive master data (data that has not yet been approved) is stored in the generated tables.
Data that the MDG system replicates to target systems is always active data. The MDG system takes the active data from the SAP ERP tables or from the generated tables depending on the option in use (reuse option or flex option).
MDG applications such as MDG-M, MDG-S, and MDG-F include standard implementations of the Data Replication Framework (DRF) that read the data and send the messages to the target system. The standard implementations support key mapping and value mapping.
Reference data, which is stored in Customizing tables, is typically stable and available for use across an organization. Currency codes, for example, may be stored as reference data. You can model reference data in MDG data models, govern changes, and replicate changes.
Once configured, the replication process for reference data is as follows:
Replication from the MDG hub to Customizing tables in one or more target systems.
Creation and release of transport request in target system.
At least one data model, with entity types, attributes, and relationships is defined using the flex model. The user interface, workflow, and processors are defined.
Prerequisites for the replication of Reference data are as follows:
The target system of replication is a development system.
The user who replicates the data has the same ID in the source system and in the target system.
The RFC destination for the target system has the following settings:
Under Logon & Security
, you have selected Trust Relationship
.
Under , you have selected Current User
.
In the target system, the user who replicates the data is added to the list of RFC Users authorized to execute RFC calls in trusted systems.
Define mapping contexts across clients for the Unified Key Mapping Service (UKMS).
Path: Customizing for Key Mapping
(transaction IDMIMG) underDefine a Mapping Context for UKMS
Define Mapping Contexts
.
Instructions: Copy the default Main Context
to a new table and give the new mapping context a prefix of Z. The system generates a set of tables based on the standard tables. The Z prefix indicates that the objects in those tables belong to the Customer namespace.
Example: Copy table UKMDB_AGC00000
to ZUKMDB_AGCZZSF0
.
Define the business object types to be replicated using outbound implementations and assign the defined business object types to a main context ID that is defined within the UKMS (Unified Key Mapping Service).
Business object types used in data replication are based on entity types with a storage and use type of 1 within data models.
Define business object types to be replicated.
Path: Customizing for Key Mapping
(transaction IDMIMG) under Define Business Objects
Example: Specify business object type ZZSF, which is for the customer implementation of SFLIGHT (Flex).
Assign the business object types you defined to the mapping context for key mapping.
Path: Customizing for Key Mapping
(transaction IDMIMG) under Enhance Key Mapping Content
Assign Business Objects to the Main Context
Example: Assign business object type ZZSF to the main context (defined in the previous step.)
If multiple object identifier types that already belong to the same business object type must belong to the same mapping group, define an object node type. Then assign the object node type to the object identifier types.
Define an object node type.
Path: Customizing for Data Replication
(transaction DRFIMG) under
Specify the object node type in the definitions of the object identifier types.
Path: Customizing for Key Mapping
under
Row for Business Partner Number
Business Object Type
: 147
Business Object Node Type
: 368
Business Object ID Type
: 888
Constant Name for Business Object ID Type
: BPARTNER_UUID.
Row for Business Partner UUID
Same as above, except for the following:
Business Object ID Type
: 889
Constant Name for Business Object ID Type
: BPARTNER_UUID.
Define business object identifier types so it is possible to differentiate an identifier of a business object from other identifiers of the same business object. Assign the business object identifiers types to the relevant business object types.
Create business object identifier types.
Path: Customizing for Key Mapping
(transaction IDMIMG) under
Example: Object ID Type
= ZZSF; Description of Object ID Type
= SFLIGHT - Airline Code; BO Type
= ZZSF; Ob ID Constant Name
= ZZSF_AIRLCODE; Object Node Type
= ZZSF
Assign the business object identifier types to the definition of the business object types.
Path: Customizing for Key Mapping
(transaction IDMIMG) under
Example: Business Object Type
= ZZSF; Description
= SFLIGHT (Flex Option); Constant Name
= ZZSF_AIRLCODE; Object Identifier Type for Key Structure Access
= ZZSF
Create a package in preparation for the generation of data model-specific structures in the ABAP Dictionary. Generate the structures for each entity type that you want to replicate. Verify that the system generated the structures correctly.
Run transaction SE80 and create a package.
Example: Object Name
= ZZ_DRF, Description
= Custom Object SFLIGHT Data Replication
Generate the data model-specific structures.
Path: Customizing for Master Data Governance, Central Governance
(transaction MDGIMG) under
Example: Data Type
= ZXX_S_ZZ_ZDRF_CARR, Where Used
= DRF Structures, Prefix / Namespace
= ZXX, Name of Structure
= ZDRF_CARR
Run transaction SE11 and check the structures for the generated data model-specific structure. Whenever MDG generates structures, it activates them, so the word Active displays beside the structure name.
Example: Data Type
= ZXX_S_ZZ_ZDRF_CARR
Assign a key structure to the object identifier types so the key mapping functions can break down concatenated keys into their constituent parts.
Path: Customizing for Data Replication
(transaction DRFIMG) under
Example: Business Object Type
= ZZSF; Key Structure
= ZXX_S_ZZ_ZDRF_CARR.
Assign an entity type within a data model to a business object type, generate the data model, and verify that the confirmation message returns no errors.
Path: Customizing for Master Data Governance, Central Governance
(transaction MDGIMG) under In the Inactive Data Models
view, select a data model. In the Entity Types
view, select an entity type. In the Business Object Type
view, enter the business object type for the entity type. Then generate the data model.
Example: In the Inactive Data Models
view,: select CARR. In the Entity Types
view, select ZZ. In the Business Object Types
view, enter the following details:Business Object Type
= ZZSF. Choose the Generate Data Model
button.
Prepare for the creation of an outbound interface model by creating a package that contains a function group.
Run transaction SE80.
Create a package.
Example: Package
= Z_ZZ_PACKAGE. Short Description
= Package for Outbound Implementation for ZFLIGHT (ZZ). Software Component
= HOME. Transport Layer
= ZZNE. Package Type
= Not a Main Package
.
Create a function group for the package.
Example: Function Group
= Z_ZZ_FUNC_GROUP. Short Text
= Function Group for Outbound Sflight (ZZ)
Generate an outbound interface model that contains the entities and attributes from a data model that you want to replicate from the Master Data Governance hub to one or more target systems. This model also generates interfaces (RFCs and service interfaces) that can be used for such a data replication. After creating the outbound interface model, you can view the generated function module in transaction SE80
.
Path: Transaction OIF_MAINTAIN or Customizing for Data Replication
(transaction DRFIMG) under
Example: Complete the following steps:
Wizard step: Enter Header Data
.
Specify and describe an identifier for the interface model, an object type code, a package name, a name for the outbound interface model, and a description for the interface model. If you want to replicate reference data, so triggering the generation of a function module enabling the replication of such data, select the Configuration Data
checkbox.
Note
You can adjust the generated function module according to your needs, for example, in the case of reference data, you can omit the release of the transport request in order to enable data enrichment. The user can then release the transports manually.
Example
Select the CARR entity type and all of its attributes. Choose the Name ABAP Dictionary Objects button. Enter the following details for the new structure:
Interface Model ID
= ZZ_SFLIGHT
Interface Model Description
= SFlight Outbound Model (ZZ)
Object Type Code
= ZZSF
Package Name
= Z_ZZ_FUNC_GROUP
Name
= ZZ_SFLIGHT
Description
= Generated RFC for SFlight Outbound Model (ZZ)
Wizard step: Select Entity Types and Attributes
. Select entity types and attributes you want to include in the interface model. Then enter names for the resulting dictionary objects, by choosing the Name ABAP Dictionary Objects
button.
Example: Select the CARR entity type and all of its attributes. Choose the Name ABAP Dictionary Objects button. Enter the following details for the new structure:
Structure Name
= ZZSF_S_CARR
Structure Description
= Structure for CARR
Table Type Name
= ZZSF_T_CARR
Table Type Description
= ZZSF_T_CARR
Wizard Step: Review and Submit
. Review and submit your work. Create a transport request or assign an existing transport request. You can use the same transport to transfer the function module to the target system later on.
Wizard Step: Check Application Log
. Check the application log that displays after you review your submitted work..
Review the code of the function module. Run transaction SE80
. Open the Repository Browser
and browse by the Function Group
you created earlier. Open the Function Modules
folder, and review the system-generated function module for the outbound interface model.
The outbound implementation you define in the data replication framework calls this function module to replicate the data.
Create an outbound implementation to define how specific business object data is replicated. The creation of the outbound implementation involves specifying business object data to be transmitted, a class that retrieves and sends the data, and a communication channel.
When defining an outbound implementation, use the generic outbound implementation class (CL_MDG_OIF_DRF_OUTBOUND_IMPL). You can copy this class to allow additional capabilities that are not supported by default such as key mapping and value mapping. For more information, you can refer to the standard outbound implementations that SAP delivers for other objects.
Path: Customizing for Data Replication
(transaction DRFIMG) under .
Example:Outbound Implementation
= ZZSF_01; Outbound Implementation Class
= CL_MDG_OIF_DRF_OUTBOUND_IMPL; Communication Channel
= 4 Replication via iDoc; Business Object Type
= ZZSF; Outbound Interface Model ID
= ZZ_SFLIGHT.
Create a filter object to restrict the data can be selected and transferred to a target system during data replication through the use of filters. Define filters for the filter object.
Path: Customizing for Data Replication
(transaction DRFIMG) under .
Enter data in the Define Filter Objects
view and select the relevant row.
Example: Filter Object
= ZZSF_FROOT; Description
= Filter SFlight (ZZ) - Root. Leave the Table Name
field blank.
Note
A complex filter such as the one in the example does not require a table name. The system only requires table names for simple filters. Such filters are only available for standard applications that are built using the reuse option.
Define the filters for the filter object in the Assign Filters
subview.
If required, you can define your own structure to include all relevant fields from the generated table. In the Assign Filters
view, apply the following settings.
For the Filter
field, use codes between 80 and 99. This range is assigned to the customer namespace.
Specify a filter class. Example: Use the generic Filter Class
CL_MDG_OIF_DRF_FILTER.
Assign a filter object to a business object type (specific filtering) or to an outbound implementation.
Assignment of a filter object to a business object type (specific filtering).
Path: Customizing for Data Replication
(transaction MDGIMG) under
Assignment of a filter object to an outbound implementation:
Path: Customizing for Data Replication
(transaction MDGIMG) under
Example: Business Object Type
= ZZSF; Filter Object
= ZZSF_FR00T; Outbound Interface Model ID
= ZZ_SFLIGHT
Create a filter to indicate precisely what data you want to replicate.
Run transaction DRFF.
Select the Business Object for which you want to define filter criteria.
Example: SFLIGHT (Flex Option).
Define a filter.
Example: Under Filter Criteria to Include Business Objects
, choose Airline local currency is EUR.
Create a replication model, assign the outbound implementation to the replication model, and assign the business systems that act as target systems for replication to the combination of the outbound implementation and the replication model. Each replication model specifies one or more outbound implementations.
Create a replication model.
Client-Specific Path: Customizing for Data Replication
(transaction MDGIMG) under
Example:
In the Define Replication Model
view, create a new entry with the following settings:
Replication Model
= ZZSF; Description
= Replication Model for SFLIGHT; Log -Days
: 15.
Select the new entry.
Assign an outbound implementation to the replication model.
Example: In the Assign Outbound Implementation
view, apply the following settings: Outbound Implementation
= ZZSF_01; Communication Channel
= 4 Replication via RFC; Replication via RFC
; Filter Time
= 2 Filter After Change Analysis.
Select the assigned Outbound Implementation.
Assign the business system or business systems to which you want to replicate data using the combination of the replication model and the outbound implementation.
Example: Open the Assign Receiver Systems
view, and enter the following value: Business System
= QV5_410
Activate the replication model.
Choose the Activate Replication Model
pushbutton.
Generate an outbound interface model that contains the entities and attributes from a data model that you want to replicate from the Master Data Governance hub to one or more target systems. This model also generates interfaces (RFCs and service interfaces) that can be used for such a data replication. After creating the outbound interface model, you can view the generated function module in transaction SE80
.
Path: Transaction OIF_MAINTAIN or Customizing for Data Replication
(transaction DRFIMG) under
Example: Complete the wizard as follows:
Wizard step: Enter Header Data
.
Specify and describe an identifier for the interface model, an object type code, a package name, a name for the outbound interface model, and a description for the interface model. To trigger the generation of a function module enabling the replication of such data, select the Configuration Data
checkbox.
Note
You can adjust the generated function module according to your needs, for example you can omit the release of the transport request in order to enable data enrichment. The user can then release the transports manually.
Example
Select the CARR entity type and all of its attributes. Choose the Name ABAP Dictionary Objects button. Enter the following details for the new structure:
Interface Model ID
= ZZ_SFLIGHT
Interface Model Description
= SFlight Outbound Model (ZZ)
Object Type Code
= ZZSF
Package Name
= Z_ZZ_FUNC_GROUP
Name
= ZZ_SFLIGHT
Description
= Generated RFC for SFlight Outbound Model (ZZ)
Wizard step: Select Entity Types and Attributes
. Select entity types and attributes you want to include in the interface model. Then enter names for the resulting dictionary objects, by choosing the Name ABAP Dictionary Objects
button.
Example: Select the CARR entity type and all of its attributes. Choose the Name ABAP Dictionary Objects
pushbutton. Enter the following details for the new structure:
Structure Name
= ZZSF_S_CARR
Structure Description
= Structure for CARR
Table Type Name
= ZZSF_T_CARR
Table Type Description
= ZZSF_T_CARR
Wizard Step: Review and Submit
. Review and submit your work. Create a transport request or assign an existing transport request. You can use the same transport to transfer the function module to the target system later on.
Wizard Step: Check Application Log
. Check the application log that displays after you review your submitted work.
Review the code of the function module. Run transaction SE80. Open the Repository Browser
and browse by the Function Group
you created earlier. Open the Function Modules
folder, and review the system-generated function module for the outbound interface model.
The outbound implementation you define in the data replication framework calls this function module to replicate the data.
Create a mapping using the service mapping tool to map data from the staging area in the source system to the reuse table in the target system.
Ensure the following:
The source structure is the data model-specific structure for the outbound interface model.
The source structure uses the flex option and the target structure uses the reuse option.
Path: Customizing for Master Data Governance, Central Governance
(transaction MDGIMG) under
Maintain a mapping table to map the tables to the objects.
Run transaction SM30.
Example:
Table Name
: ZFX_S_ZT024E.
Specified when you created an outbound interface model.
Object
: V_T024E
The target business object stored in Customizing.
Type
: view.
SMT_Mapping
: ZF_PO_MAP.
Created previously in the Service Mapping Tool (SMT).