Thursday 23 December 2021

Standard Table Addition in MDC

Master Data consolidation and Mass Process Enhancement with standard table.

Consolidation and Mass processing are two major applications of SAP MDG system. It’s an out-of-the-box solution. While implementing these application if one follows standard configuration guide it can be smoothly implemented.

This blog is written for audience who needs to enhance MDC with standard table and are new to these application.

Enhancement of process model:

Path for process model: MDCIMG>Configure Process Model.

◉ Create copy of standard table in se11 that  you want to add with Z* prefix as direct addition to of standard table does not generate resultant artifacts.

◉ We are taking example of table KNKK. Add table in process model as shown below.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

◉ Maintain join with the superior table, in our case superior table is KNA1.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

◉ Create Join between the fields as shown below screen shot. The Process indicator and the Active indicator show whether a field is used in the process data model or in the active data model.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

◉ Select the table fields node. If the table you added does not contain any fields, click on synchronize fields. This will pull all the relevant fields of the table from DDIC table and the join we maintained in previous step.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

◉ Now Save the  process model configuration changes and go to resultant artifacts by selecting against the business object.

◉ On entering inside the resultant artifacts enter package name and select the required table name that needs to be be made available. At first these check boxes against your addition of table will be unchecked.

◉ Click on apply missing and apply selected as guided in standard document for struct. And table type generation.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

◉ On Successful generation of structure you can also view and check it in SE11.

Code Enhancements:


Apart from configuring the process model we have to write custom code for achieving the complete functionality. We need to create two custom class with super class as CL_MDC_MODEL_BP AND CL_MDC_DATA_BP.

Model class is responsible for reading, Mapping of data and update data to the data base tables.

Data class is responsible for validation and generation of backend structures used during the process.

NOTE: For code related to below methods refer the super class code.

Model class created in example: ZCL_MDG_MODEL.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs
model class

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

The methods shown in above screen shots are minimum required methods to be reimplemented.

1. MAP_EXTENSIONS_2API: It populated the data from PRC structure to required format of API structure.

2. READ_ALL_DATA: It is required to read the data from backend tables based on source ID.

3. SAVE_BUISNESS_PARTNER_ACTIVE: This method is required to save data to particular data base table by using update function module or BAPI.

Data class created in example: ZCL_MDC_DATA_BP

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

◉ The 5 methods in below screen shot are the required methods to be implemented.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

Now you can Test your enhancement.

Bonus:

An issue arises for consolidation and mass processing of records more than 100. System does not accept the records if file is having records more than 100, that because the system designed for data processing more than 100 follows different approach and that is not supported for custom enhancements of process model in MDC.

Below is the class and method at which post exit needs to be written.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs
Enhancement for processing records more than 100

Below is the reference code needs to be written in post exit of method highlighted.

SAP ABAP Certification, SAP ABAP Guides, SAP ABAP Career, SAP ABAP Learning, SAP ABAP Preparation, SAP ABAP Skills, SAP ABAP Jobs

Source: sap.com

No comments:

Post a Comment