Using Data Replication Framework - SAP

13
PUBLIC How To... Master Data Governance for Material: Using Data Replication Framework Applicable Releases: From EHP6 FOR SAP ERP 6.0 and from SAP S/4HANA 1511 Version 3.0 May 2021

Transcript of Using Data Replication Framework - SAP

PUBLIC

How To... Master Data Governance for Material: Using Data Replication Framework

Applicable Releases: From EHP6 FOR SAP ERP 6.0 and from SAP S/4HANA 1511

Version 3.0

May 2021

Document History

Document Version Description

1.00 First official release of this guide

1.10 Additional SAP notes and hints

1.20 Background information for using DRF for Materials

1.30 Update for RBWF

1.40 Updates to chapter 3.5 Key Mapping (including ALE Audit), new chapter

3.6

1.50 Updates to chapter 3.3 IDoc Reduction

1.60 Small corrections

1.70 Updates to 3.1 and new chapter 3.9

1.80 Updates for MDG 9.0

1.90 Validity update

2.0 SAP note 2268203

3.0 Deletion of chapter 5

3

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

2. PREREQUISITES ..................................................................................................................................................................... 5

3. BACKGROUND INFORMATION/TROUBLESHOOTING ON DRF FOR MATERIAL ....................................................................... 5

3.1. RESTRICTIONS ................................................................................................................................................................... 5 3.2. DRF SET UP, CUSTOMIZING, ONLINE HELP, SAP BEST PRACTICES EXPLORER .................................................................................... 6 3.3. WEB DYNPRO APPLICATIONS ................................................................................................................................................ 6 3.4. IDOC REDUCTION ............................................................................................................................................................... 7 3.5. REPLICATION OF DELETION ................................................................................................................................................... 7 3.6. KEY MAPPING (INCLUDING ALE AUDIT) ................................................................................................................................... 8

3.6.1. Key mapping .......................................................................................................................................................... 8 3.6.2. How to customize ALE Audit ................................................................................................................................... 8 3.6.3. ALE audit and classification IDoc’s .......................................................................................................................... 8

3.7. VALUE MAPPING ............................................................................................................................................................... 9 3.8. FILTER CRITERIA ................................................................................................................................................................. 9 3.9. CHANGE POINTER HANDLER ............................................................................................................................................... 10

4. STEP-BY-STEP EXPLANATION FOR IMMEDIATE REPLICATION WITH MDG 9.0 AND SAP S/4HANA 1610 .............................. 11

5. RELATED CONTENT ............................................................................................................................................................. 11

4

1. BUSINESS SCENARIO

SAP Master Data Governance for Material (MDG-M) provides business processes to find, create, change, and mark material master data for deletion. It supports the governance of material master data on a central hub and the distribution of material master data to connected operational and business intelligence systems. The processes are workflow-driven and can include several approval and revision phases, including collaboration between all users participating in master data maintenance. The data replication framework (DRF) can be used to replicate data from the Master Data Governance (MDG) hub to target systems. You can replicate master data changes carried out centrally either manually or automatically in the background using the data replication framework (DRF). Filters allow you to configure replication settings. You can replicate data between the Master Data Governance hub and operational systems by means of enterprise services, IDoc’s, or file download functions. This guide provides background information about the data replication framework (DRF) valid for the domain material. The guide also describes how to set up the system to enable immediate distribution of changes in the material master during activation of the material. With MDG 9.0 and SAP S/4HANA 1610 it is configurable, if you would like to distribute immediately or using change pointer.

5

2. PREREQUISITES

Makes sure that the following SAP Notes are implemented in the system if required: 1910800 Error in replication using different replication models 1933608 Error in filtering objects while replication with DRF based Web UI 1934302 Segment filters do not get applied from DRFF when doing DRF based replication for Material 1935559 Issue in replication of material to multiple business system with different replication models 1947942 performing DRF replication, MDG change pointer gets reset for materials which are not indexed in ESH 1952654 Materials which gets delayed in indexing in enterprise search are not getting filtered for DRF replication 2080421 DRF: Reduced IDoc message types cannot be sent 2084728 Reduced IDoc message types for MDG implementations 2093396 Reduced Message Type 2245651 Distribution of valuation data with different material ledger settings 2290691 Error during activation of material changes without direct distribution 2302817 Incomplete change information when you send material masters 2318497 Too many change pointers are created 2302809 QMAT not in UPDATE TASK 2288694 Context of current Change Request in DRF 2281192 MDG_BS_CLF_KEY_OBJKEY: Switch OBJKEY and KLART 2245651 Distribution of valuation data with different material ledger settings 2268203 Not possible to Update / Transfer MRP Area when using Message Type MATMAS 3. BACKGROUND INFORMATION/TROUBLESHOOTING ON DRF FOR MATERIAL

3.1. Restrictions

1517867 Functional restrictions in MDG-M in EhP5 1571467 Functional restrictions in MDG-M in EhP6 1701437 Functional restrictions in MDG-M in MDG6.1 1806108 Functional restrictions in MDG-M in MDG7 (incl. SP02) 2129261 Functional restrictions in MDG-M in MDG8 2284745 Functional Restrictions in MDG for Material with SAP Master Data Governance 9.0 2461516 Functional Restrictions in MDG for Material with SAP Master Data Governance 9.1 2656693 Functional Restrictions in MDG for Material in SAP Master Data Governance 9.2 and on SAP

S/4HANA 1809 2816571 Functional Restrictions in MDG for Material on SAP S/4HANA 1909 2948873 Functional Restrictions in MDG for Material on SAP S/4HANA 2020 The DRF material outbound implementation I_MAT supports only ALE message types MATMAS (with PRODVERSION) and CLFMAS. With MDG 9.0 and outbound implementation I_MAT_V2 also ALE message types for quality inspection setup (MATQM), change number and revision level (ECMREV) and documents (DOLMAS) are supported. If you want to replicate change states/revision levels using IDoc ECMREV, you must also activate the ALE change pointers using SALE -> IDoc Interface / Application Link Enabling (ALE) -> Modeling and Implementing Business Processes-> Master Data Distribution-> Activate Change Pointers for Message Types (transaction BD50). The DRF material outbound implementations do not support ALE message DOCMAS. For distribution of DOCMAS you can use the standard ALE distribution. ALE and DRF distribution for MRP Areas is not possible as no IDoc exists for distribution of MRP Areas (MDMA). See also SAP Note 2268203: Not possible to Update / Transfer MRP Area when using Message Type MATMAS.

Only in S/4HANA it is also possible to use outbound implementation 194_3 for replication via services. https://help.sap.com/viewer/bc6b9325fedd4344a84412b2195064fa/latest/en-US/f758dc3b2f444f3fb6c6cabc8ebd1689.html

6

Flex entities are not supported by the DRF material outbound implementation. 3.2. DRF Set Up, Customizing, Online Help, SAP Best Practices Explorer

For more information, see the section Set Up Data Replication Using ALE with DRF in Configuring Master Data

Governance for Material topic Set Up Data Replication

https://help.sap.com/viewer/6d52de87aa0d4fb6a90924720a5b0549/latest/en-

US/64a5cb5285135721e10000000a423f68.html as well as the Data Replication topic in Working with MDG, Central

Governance https://help.sap.com/viewer/6d52de87aa0d4fb6a90924720a5b0549/latest/en-

US/104bf4bff9c54d7796d266605a4111fd.html.

For more information about the data replication framework in SAP S/4HANA, see the Data Replication Framework

topic https://help.sap.com/viewer/8308e6d301d54584a33cd04a9861bc52/latest/en-

US/88e3f5577c84bc12e10000000a4450e5.html.

For more information about the integration of SAP S/4HANA Cloud to SAP Master Data Governance, see SAP Best

Practices Explorer https://rapid.sap.com/bp/#/scopeitems/1RO.

3.3. Web Dynpro Applications

Web Dynpro applications can be found here on the material governance homepage:

Or you can use transaction DRFOUT in SAPGUI. For scheduled distribution with a background job you should use a variant of transaction DRFOUT.

7

3.4. IDoc Reduction

Scenario: You have defined a reduced IDoc type, which creates a new message type. You have also registered it for a target system, but DRF does not create an IDoc. Solution: Implement the following SAP Notes:

• SAP Note 2080421: DRF: Reduced IDoc message types cannot be sent

• SAP Note 2084728: Reduced IDoc message types for MDG implementations

• SAP Note 2093396: Reduced Message Type Workaround: If you can’t implement these SAP Notes, you can use this as a workaround. The message type MATMAS is hard coded in method SEND_MATMAS_IDOC of class CL_MDG_MAT_IDOC_DRF. This class is used in the outbound implementation I_MAT for DRF.

Search for the usage IF_MDG_MAT_DRF_CONSTANTS=>GC_MATMAS. You must replace the hard-coded message type using an overwrite exit on this method, or by creating your own outbound implementation (inheriting from class CL_MDG_MAT_IDOC_DRF). 3.5. Replication of Deletion

Scenario: You have replicated a material with several descriptions and long texts. You then delete some descriptions/long texts (or any other segment where deletion is possible) and replicate the material again using IDoc and DRF. The deletions do not reach the target system. Root cause: DRF for material does not support message function ‘003’ (deletion). DRF for material always sends the full material. ALE/DRF filters are of course considered. Solution options: Using only ALE: Sending a segment deletion is supported in standard ALE (transaction BD21). This option doesn’t need additional coding. Using DRF or ALE: This option needs additional coding in the target systems. If it is possible to determine which data gets deleted in the target system, you can also implement the IDoc inbound BAdI IDOC_DATA_MAPPER in the target system. In this BAdI, set the segment’s message function (MSGFN) to ‘003’ (deletion). This enables the IDoc inbound (usually function module IDOC_INPUT_MATMAS01) to delete the data. This above case works for segments that are solely maintained on the hub (no data added in the target system). If one such segment exists in the target system’s database but not in the IDoc, then this could be considered an indication that this segment must be deleted. These rules and the implementation are project specific so no example coding is provided.

8

3.6. Key Mapping (Including ALE Audit)

If possible, harmonized material numbers in your landscape are considered best practice. This would avoid key mapping completely, but is not always possible (legacy systems with non-harmonized material numbers …). In this case, MDGM also supports key mapping. 3.6.1. Key Mapping For key mapping of material numbers, IDoc types MATMAS01..5 and CLFMAS01..2 use the ‘Object Identifier Type Code’ number 20 “Material ID (internal format) (ERP)”. MDG-M supports the following three options, based on the settings in “Define Technical Settings for Business Systems”

1. “Harmonized IDs”: Key mapping not considered 2. “Key Mapping” and (“Update KM via ALE audit” unchecked or BD10 outbound):

o Key mapping needed for material o DRF/ALE outbound fails if key mapping is missing

3. DRF only: “Key Mapping” and “Update KM” (via ALE audit) checked: o Key mapping considered if available o Otherwise, the hub sends its material number; client can

▪ Either accept it and confirm via ALE audit ▪ Or provide new, internally assigned material number;

this material number gets returned via ALE Audit and the key mapping gets updated on Hub; for IDoc inbound with internal numbering, check http://scn.sap.com/thread/1954090

3.6.2. How to Customize ALE Audit You can configure your client and hub systems so that your client systems send confirmation of replicated materials back to the MDG hub. The technology that is used for this is called ALE auditing. The customizing for ALE audit is described in the section Customizing for ALE Audit (Optional) in Adapting Master Data Governance for Material → Key Mapping https://help.sap.com/viewer/db97296fe85d45f9b846e8cd2a580fbd/MDG92.latest/en-US 3.6.3. ALE Audit and Classification IDoc’s Scenario: Option 3 (ALE audit) is used to replicate material with classification, key mapping required, update via ALE Audit active (key created in target system) Challenge: The CLFMAS IDoc’s must not be sent until ALE audit has returned the material number of the target system and updated the key mapping. To ensure this, the classification outbound will fail with an error message in the ALE replication log (BD87) if no key mapping was found. Thus, the MDG change pointers will be set to processed but the CLFMAS IDoc will not be sent but instead get an error status. Note that no message is written into the DRF log, only the ALE log (as it was there where the replication failed). After the ALE audit has updated the key mapping, the CLFMAS IDoc’s need to be replicated again. Unfortunately, this replication can’t be automated from the ALE audit. Solution:

9

Prerequisite is SAP Note 2030807.

Type Solution Initial Load Retrigger replication for materials whose CLFMAS IDoc’s have failed – check BD87. No work list

available. Delta Delta is driven by change pointers → new change pointers created for failed classification IDoc’s

→ for next periodic replication, material including CLFMAS will be sent again Manual Restart replication for materials whose CLFMAS IDoc’s have failed – check BD87. No work list

available. CR Activation

Custom coding: WAIT task until DRF replication status indicates that the ALE Audit was finished, then restart replication

Note that the restart sends CLFMAS IDoc as well as the corresponding MATMAS IDoc, which is somewhat redundant. 3.7. Value Mapping

For value mapping see How To Guide How to... MDG-M: Use the Data Import Framework (http://scn.sap.com/docs/DOC-47519), chapter Value Mapping. The customizing is valid for inbound and outbound. 3.8. Filter Criteria

Filter Object - Defines the selection criteria used to determine the data objects which should be replicated. It combines one or more filters. Maintenance of the selection criteria is done by the master data steward. Filter - Carries out the comparison of a given set of objects against the maintained filter criteria. It returns the list of objects that match the filter criteria. To apply filters sequentially on the same object list, they can be combined in Filter Objects. Filter types available: Explicit (simple and complex) and implicit. Segment Filters are special filters that generally do not limit the number of objects but the amount of data in the object itself.

Explicit filters are configured explicitly by the customer

• Simple filters are defined per attributes on a single ERP or S/4HANA entity root table - e.g. fields MATNR, MATKL and MTART of table MARA. The evaluation of simple filters is generic in the way that it can be easily enhanced just by adding another attribute to the filter using append technology (no code change necessary).

• Complex filters are not directly related to the ERP or S/4HANA entity root table but need to get evaluated by certain function modules or methods like selected nodes of the article hierarchy or merchandise category hierarchy. The semantically interpretation of complex filters is coded using the corresponding APIs. To enhance complex filters code changes are necessary.

Implicit filters are offered by the system

• In addition to simple and complex filter the system offers implicit filters (reusable APIs). They are executed by the system and can only be switched on or off using the configuration on the Replication Model/Outbound Implementation level.

• Examples are checks of certain material/store combinations due to listing conditions or selling periods

Segment filters are used to exclude parts (“segments”) of the Business Object from replication. The delivered outbound implementation I_MAT has the following filter criteria’s, which you can find in the MDG customizing: General Settings->Data Replication->Enhance Default Settings for Outbound Implementations->Define Outbound Implementations.

• Main filter in outbound implementation with Filter Object MDG_BS_MAT

• Segment filters F_MAT1 bis F_MAT6

If these filters are not sufficient you can create your own outbound implementation with own filters. Filters are defined in the MDG customizing: General Settings->Data Replication->Enhance Default Settings for Outbound Implementations-> Define Filter Objects.

10

3.9. Change Pointer Handler

Scenario: You want to have change pointers only if certain fields have changed. This can be done easily in ALE (using ALE change pointers). But MDGM writes MDG change pointers instead, which are always created on any changes of material or its classification. Solution: The MDG change pointer creation is triggered by a BTE (Business Transaction Event) as stored in table TBE31. To prevent this creation, you should exchange/remove the two entries for MDG_BS_MAT_DRF_CP and MDG_BS_CLF_DRF_CP. This is a modification. In addition, different change pointer should be written. This could be achieved by:

• Alternative 1: Copy function module MDG_BS_MAT_DRF_CP and change the coding according to your requirements. Then exchange the function module in table TBE31.

• Alternative 2: Use ALE-BAdI BDCP_BEFORE_WRITE. There you can create MDG change pointers if ALE change pointers are created for the ALE-Message type. Prerequisite is the assignment of ALE-Message Type to the Business Object.

11

4. STEP-BY-STEP EXPLANATION FOR IMMEDIATE REPLICATION WITH MDG 9.0 AND SAP S/4HANA 1610

From MDG 9.0 and SAP S/4HANA 1610 it is possible to configure pooled or direct replication.

See configuration Guide MDG-M Set Up Data Replication https://help.sap.com/viewer/6d52de87aa0d4fb6a90924720a5b0549/latest/en-US/64a5cb5285135721e10000000a423f68.html 5. RELATED CONTENT

For more information, visit the SAP Master Data Governance homepage. (https://www.sap.com/products/master-data-governance.html )

Configuration and Enhancement of SAP Master Data Governance homepage

(https://wiki.scn.sap.com/wiki/display/SAPMDM/Documentation%3A+Configuration+and+Enhancement+of+SAP+Master+Data+Governance )

Product Release Highlights https://www.sap.com/products/master-data-governance.html#release-

highlights

What’s New Viewer – SAP S/4HANA https://help.sap.com/doc/474a13c5e9964c849c3a14d6c04339b5/100/en-US/8880de6dbfb94ea3b0de1f26b40816dc.html?lob=Cross%20Applicatio

ns with Line of Business: Cross Applications and Search Term: MDG

MDG Community https://community.sap.com/topics/master-data-governance

Key Presentations https://blogs.sap.com/2012/03/14/find-the-up-to-date-presentations-on-sap-master-data-governance/

Online Help SAP MDG in S/4HANA https://help.sap.com/viewer/6d52de87aa0d4fb6a90924720a5b0549/latest/en-US/56a57357f2b1aa6be10000000a4450e5.html

Online Help SAP MDG on ECC https://help.sap.com/viewer/product/SAP_MASTER_DATA_GOVERNANCE/latest/en-US

Road Map Explorer https://roadmaps.sap.com/board?PRODUCT=901B0ED1A0641EDA9FF75276E440C0EF&range=FIRST-LAST#Q3%202020

12

www.sap.com/contactsap © 2021 SAP SE or an SAP affiliate company. 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 SE or an SAP affiliate company. The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company 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. In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names mentioned are the trademarks of their respective companies. See www.sap.com/trademark for additional trademark information and notices.