SAP How-To Guide: Extend The MDG Business Partner - Node .

Transcription

SAP How-To Guide: Extend theMDG Business Partner – NodeExtension (Reuse Option)Applies to:SAP MDG-S / MDG-C running on SAP ECC 6 EhP 6 Master Data Governance. For more information, visitthe Master Data Management homepage. (http://www.sdn.sap.com/irj/sdn/nw-mdm )SummarySAP Master Data Governance provides out-of-the box solutions for the central management of master dataobjects. Domain-specific solutions include supplier governance, material governance, and financialsgovernance. If your domain-specific solution does not fully meet requirements, you can customize andextend it. You can use this guide to extend the data model for supplier governance (MDG-S) or for customergovernance (MDG-S) by creating a new node, using the reuse entity type.Authors:Michael Theis, Lars RueterCompany: SAP AGCreated on: July 2012Version: 1.0SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com1

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)Table of ContentsIntroduction . 3Scenario . 4Technical Background . 5Step by Step Implementation Guide . 61.Extend structure VMDS EI VMD COMPANY . 62.Create table for storing secret numbers in the reuse area . 93.Extend the MDG-S data model with your new table like entity. 10Create New Entity Types . 12Relationships . 13Generate Data Model-Specific Structures . 144.Create and Implement Your Own Handler Class . 15Create Your Own Handler Class . 15Implement Your Own Handler Class . 15Re-implement Methods . 165.Extend the genIL model . 16Create Data Dictionary Objects . 16genIL Component Class for Custom Table . 17genIL Model Enhancement for Custom Table . 17Connect the MDG Data Model with the genIL Data Model . 196.Extending the MDG-S User Interface . 19GUIBB Feeder for Supplier Secret Numbers . 20Copy Component Configuration FPM LIST UIBB . 20Enhancement of UI Configuration . 20Result 22Appendix . 23Source Code for Custom Handler Class . 23Re-Implement methods . 23Helper Methods. 41Function Modules. 51Data Dictionary Objects for Extension of VMDS EI VMD COMPANY . 52Table Types . 52Structures. 53Data Elements . 56Domains . 58Data Dictionary Objects for genIL Model Extension . 60Structures. 60Source Code for genIL Model Class . 61Copyright. 65SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com2

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)IntroductionThis document explains how to add a new node to Customer Governance (MDG-C) or Supplier Governance(MDG-S) using a reuse entity.The given scenario is complex.We recommend you study the following How-To Guides before working with this one:1. Extensibility Options for SAP Master Data Governance - Customer / Supplier Data - How-to Guide:Extending the MDG Business Partner - Overview2. Extensibility Options for SAP Master Data Governance - Customer / Supplier Data - How-to Guide:Create and Register a Custom Handler Class3. Extensibility Options for SAP Master Data Governance - Customer / Supplier Data - How-to Guide:Create or Redefine a UI Feeder ClassSAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com3

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)ScenarioIn addition to managing company code data within supplier governance, you want to manage a secretnumber and a comment. During processing of the change request, you want the additional attributes to bestored in the MDG staging area. After activation, you want the attributes to be stored in a custom Z-table.SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com4

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)Technical BackgroundBefore a new table-like entity type can be handled properly in MDG, you must extend the following: The MDG data model The structures used by a custom handler class The Business Object Layer (BOL) / Generic Integration Layer (genIL) model The User Interface.SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com5

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)To handle an additional table-like entity type in the custom handler class, you must extend structureMDG BS BP TT ECC EXTERN.CL MDG BS ECC HANDLERIn structure MDG BS BP TT ECC EXTERN identify and extend the relevant substructure. If you want to adddata below the company element, you must extend the structure as shown below.VMDS EI VMD COMPANY.MDG BS BP TT ECC EXTERN MDG BS BP TT MLT AS SUPPL VMDS EI EXTERN VMDS EI VMD COMPANYThe new substructure must adhere to a certain format. It is a good practice to follow the pattern used forexisting structures which are also located below VMDS EI VMD COMPANY such as DUNNING or WTAX TYPE.Step by Step Implementation GuideThe following steps provide details how-to extend the MDG-S model by a new table-like entity type.1. Extend structure VMDS EI VMD COMPANYAs a starting point you will create the necessary DDIC object to create the structureZTEST SECRET NUMBERS.ZTEST SECRET NUMBERSSAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com6

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)For details of the individual objects in the data dictionary, refer to the Appendix section Data DictionaryObjects for Extension of VMDS EI VMD COMPANY.Table TypesNameDescriptionZEI SECRET NUMBER TVendors: Secret NumbersStructuresNameDescriptionZEI SECRET NUMBERSecret NumbersZEI SECRET NUMBER SSecret NumbersZSECRET NUMBER KEYSecret Numbers / Key FieldsZVENDOR SECRET NUMBER DATASecret Number Data / Data-FieldsZVENDOR SECRET NUMBER DATA XSecret Number Data / X-FieldsZTEST SECRET NUMBERSSecret Numbers (Append)SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com7

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)Data ElementsNameDescriptionZSECRET NUMBER TASKChange Indicator Secret NumberZZSECRET NUMBERSecret NumberZZSECRET NUMBER COMMENTSecret Number CommentDomainsNameDescriptionZSECRET NUMBER TASKChange Indicator Secret NumbersZZSECRET NUMBERSecret NumberZZSECRET NUMBER COMMENTSecret Number CommentNow you are ready to extend structure VMDS EI COMPANY by creating an append calledZTEST SECRET NUMBERS using component type ZEI SECRET NUMBER S as shown below.SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com8

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)2. Create table for storing secret numbers in the reuse areaYou still need a table where the secret numbers are stored after activation of the change request.Database TablesNameDescriptionZSECRET NUMBERTable used to store the secret numbers entered viaMDG change request.SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com9

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)ZSECRET NUMBER (Fields)ZSECRET NUMBER (Entry help / check)3. Extend the MDG-S data model with your new table like entityWhile change requests are in process, your secret numbers are stored in the MDG staging area. Therefore,you must extend the BP data model accordingly. The necessary steps are outlined in this section.You start by creating two new entity types; one for your secret number and another for the associateddescription. In the next step, you establish a relationship between these entity types and to theBP COMPANY entity type. In the last step of this section, you generate additional data model-specificstructures.SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com10

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com11

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)Create New Entity TypesSAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com12

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)RelationshipsSAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com13

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)Generate Data Model-Specific StructuresSAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com14

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)4. Create and Implement Your Own Handler ClassCreate Your Own Handler ClassTo create your own handler class by inheriting from class CL MDG BS ECC HANDLER, follow the steps ofuse case Extensibility Options for SAP Master Data Governance - Customer / Supplier Data - Create andRegister a Custom Handler ClassImplement Your Own Handler ClassSince the superclass is abstract, create redefinitions for all methods belonging to the interfaceIF MDG BS BP ACCESS HANDLER. The redefinitions itself can be empty at first. It is sufficient to implementonly those methods that are required to fulfill the needs of your process.In this scenario you must implement the methods listed below. In addition you must create a function modulethat we call SAVE ADDITIONAL OBJECT DATA in our example with the option “IN UPDATE TASK” toensure transactional consistency.A detailed source code example is provided in the Appendix sectionSource Code for Custom Handler Class.SAP COMMUNITY NETWORK 2012 SAP AGscn.sap.com15

SAP How-To Guide: Extend the MDG Business Partner – Node Extension (Reuse Option)Re-implement MethodsYou can look at the code from CL MDG BS SUPPL HANDLER to get an idea what should be done in thesemethods.NameDescriptionMAP DATA 2APIMapping data to the APIMAP DATA 2STAMapping data to stagingPREPARE EI HEADER MAP 2APIREAD OBJECT DATARead dataSAVE ADDITIONAL OBJECT DATASave dataS

MAP_DATA_2API Mapping data to the API MAP_DATA_2STA Mapping data to staging PREPARE_EI_HEADER_MAP_2API READ_OBJECT_DATA Read data SAVE_ADDITIONAL_OBJECT_DATA Save data SORT_ENTITIES Sort data Function Modules Name Description Z_SECRET_NUMBER_UPDATES Save data to Z* table 5. Extend the genIL model In