0% found this document useful (0 votes)
149 views

MDG Data Model Doc

Uploaded by

Ranjith Narayan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
149 views

MDG Data Model Doc

Uploaded by

Ranjith Narayan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

PUBLIC

How-To: Extend MDG-S / MDG-C by a new


custom-defined field (reuse option)

Applicable Releases:
From EhP6 for SAP ERP 6.0 and from S/4HANA 1511

Version 3.0
August 2022
Document History

Document Version Description

1.0 First official release of this guide (March 2012)


2.0 Layout (July 2020)
3.0 Additional information (August 2022)
1. BUSINESS SCENARIO 4
1.1. DATA MODEL 4
2. STEP BY STEP EXPLANATION 5
2.1. EXTENDED FIELD EXISTS IN BUSINESS PARTNER ONLY 5
2.1.1. Extend the BUT000 Data Model 6
2.1.2. Extend the MDG Data Model 8
2.1.3. Generate Data Model-Specific Structures for MDG 11
2.1.4. Define SMT Mapping 13
2.1.5. Check Customizing 18
2.1.6. Define Field Properties for UI 19
2.1.7. Custom Handler Class 19
2.1.8. Define Field Mapping for SAP HANA-based search 20
2.1.9. Enhance Search UIBB 22
2.1.10. Adjust Staging Area of Linked Change Requests 24
2.1.11. Test Your Configuration 24
2.2. EXTENDED FIELD EXISTS IN VENDOR / CUSTOMER ONLY 26
2.2.1. Extend the MDG Data Model 27
2.2.2. Generate Data Model-Specific Structures for MDG 30
2.2.3. Define SMT Mapping 32
2.2.4. Test Your Configuration 37
2.3. EXTENDED FIELD EXISTS IN BUSINESS PARTNER AND IN VENDOR / CUSTOMER 39
2.3.1. Extend LFA1 40
2.3.2. Implement Enhancement Spot CVI_CUSTOM_MAPPER 43
2.3.3. Test Your Configuration 45
2.4. USER INTERFACE CONFIGURATION 46
2.4.1. Adaptation Options in Floorplan Manager 46
2.4.2. Adding a New Field to UI for Single Maintenance (BUT000 Extension Case) 47
2.4.3. Adding a New Field to the UI for Single Maintenance (Extended Field Exists in Vendor / Customer Only)
49
3. ADDITIONAL INFORMATION 51
3.1. FURTHER READING 51
3.2. SAP NOTES 51
4. APPENDIX 52
4.1. EXAMPLE CODING FOR CLASS ZCL_CUSTOM_BP_HANDLER 52

3
1. BUSINESS SCENARIO
SAP Master Data Governance provides business processes to find, create, change, and mark master data
for deletion. It supports the governance of master data in a central hub and the distribution to connected
operational and business intelligence systems.

Domain-specific content (data models, user interfaces, workflows) is provided as part of the standard for
several application areas. It is a common requirement from customers to adapt the MDG data models to their
specific needs.

This How To Guide describes how to extend the data model BP by adding attributes that already exist as
database fields in the appropriate customer includes.

1.1. Data Model


In SAP Master Data Governance data can be stored in the staging area or in the active area. The staging
area temporarily stores the working version of master data that is undergoing change within a change
request process. The active area permanently stores active instances of master data after changes have
been approved by a change request process.

Extending the data model in SAP Master Data Governance with custom attributes involves changes to the
data structures in the active area and in the staging area. It also involves defining a mapping between these.

You can extend the data model BP by adding attributes that already exist as database fields in the
appropriate ERP tables. This method of extending the data model is called the MDG reuse option.

Your implementation of the reuse option depends on the ERP tables that store the master data after it is
activated. The following options are available:

• Extended field exists in Business Partner


• Extended field exists in Vendor / Customer
The new field is only extended as a database field in the customer include Ext. Interface:
Central Vendor Data / Data Fields (VMDS_EI_VMD_CENTRAL_DATA) for the vendor data
model as well as in either the customer include Ext. Interface: Central Vendor Data / X-
Fields (VMDS_EI_VMD_CENTRAL_DATA_XFLAG) for the vendor data model or in the
equivalent customer include for the customer data model.
• Extended Field Exists in Business Partner and in Vendor / Customer
The new field is extended as a database field in both the Business Partner and in customer
includes for vendor / customer.

Each of the sections in this document contains detailed step-by-step implementation instructions. Follow the
steps in the section that is appropriate for your scenario.

These cases are also shown in the figure below.

Add field
( reuse )

Field only in Field in both BP


Field only in
Vendor / and Vendor /
Business Partner
Customer Customer

Note:
You can create new attributes in the customer namespace, for example, under ZZ* and YY*.

4
2. STEP BY STEP EXPLANATION
Even though we have to distinguish three cases for the field extension, the implementation steps are very
similar. The implementation involves the following main tasks:
• Extending the ERP data model
• Extending the MDG data model
• Generating the MDG data model specific structures
• Defining SMT mapping
• Implement CVI mapping (if applicable)
The main differences in the implementation approaches can be identified from the table below. During the
step “define SMT mapping” it is important to map to the right structures. If the field extension was made in
both business partner and vendor / customer you must additionally implement the CVI mapping (but only
SMT mapping to BP is necessary).

Implementation Steps Field only in Field only in Field in both BP and


Business Partner Vendor/Customer Vendor/ Customer
Extend ERP data model   
Extend MDG data model   
Generate MDG data model   
Define SMT mapping 1 2 1
Implement CVI mapping 
Table: Implementation steps for extending the MDG-S/C data model by a new field

SMT Mappings
1
MDG staging ↔ Business Partner
2
MDG staging ↔ Vendor / Customer

2.1. Extended Field Exists in Business Partner Only


You want to extend the MDG data model for Business Partner by additional fields. The fields are added to
the Central Data entity type as shown in the figure below.

5
In this section, you learn how to add a new attributes ZZLOB and ZZSTAGE to the MDG BP data model. You
also must have extended the BUT000 table on the MDG hub and client systems.

Field Short Scenario Backend BUT000 MDG BP on BP_CENTRL


Description
Field Data Element Attribute Data Element
Line of same field name ZZLOB ZZ9_BUT000_LOB ZZLOB ZZ9_BUT000_LOB
Business and same data
element
Ext. BP Stage different field ZZ1_ZEXT_WKF1_BUS ZZ1_ZEXT_WKF1 ZZSTAGE ZZ1_ZEXT_WKF1
name, but same
data element

Note:
Make sure that at least the data elements in the backend and MDG are identical.

This section is subdivided in to one sub-section for each implementation step. Take a look at the table below
to get an overview of the steps involved.

In order to facilitate data transfer between the MDG staging area and the BUT000 table on the MDG hub you
have to extend the SMT mapping.

Implementation Steps Field only in Field only in Field in both BP and


Business Partner Vendor/Customer Vendor/ Customer
Extend ERP data model   
Extend MDG data model   
Generate MDG data model   
Define SMT mapping  1
 2
1
Implement CVI mapping 

SMT Mappings
1
MDG staging ↔ Business Partner
2
MDG staging ↔ Vendor / Customer

2.1.1. Extend the BUT000 Data Model


Extending a backend table with a custom field is not described in this guide. References on how this can be
achieved are listed below.

Custom fields can be created not only using the SAP Fiori app Custom Fields and Logic but also using back-
end transactions to create database fields.

Custom Fields App and Custom Logic App:


More Information can be found in the SAP Online Help and blogs.
Documentation Title Link
SAP Online Help Custom Fields App and Custom https://help.sap.com/docs/ABAP_PLATFORM_NEW/ed0e
11412f9841e7ac5cd9a6799368d4/57909455bf7c4fdd8bcf4
Logic App 8d76c1eae33.html?version=latest
SAP Online Help App Extensibility: App Extensibility: https://help.sap.com/docs/SAP_S4HANA_ON-
PREMISE/74b0b157c81944ffaac6ebc07245b9dc/5f32875
Manage Customer Master Data 7efd43925e10000000a4450e5.html?version=latest
SAP Online Help App Extensibility: Manage Supplier https://help.sap.com/docs/SAP_S4HANA_ON-
PREMISE/74b0b157c81944ffaac6ebc07245b9dc/862f875
Master Data 7efd43925e10000000a4450e5.html?version=latest

6
Back-end transactions:
More Information can be found in the SAP Online Help and blogs. Consider using existing extension
includes.
Documentation Title Link
SAP Online Help Enabling Custom Database Fields for https://help.sap.com/docs/ABAP_PLATFORM_NEW/ed0
e11412f9841e7ac5cd9a6799368d4/4accfedc4d2e49c1b
Usage in SAP Fiori Applications
321b6ebf288a430.html?version=latest
SAP Online Help SAP Business Partner Extensibility https://help.sap.com/docs/BS_CA/725b6ad626684262b8
d74a55fc8ed089/a6af8d5377a0ec23e10000000a174cb4
.html?version=latest
Blog SAP S/4HANA Cookbook https://support.sap.com/content/dam/SAAP/SAP_Activat
e/S4H.0781%20SAP%20S4HANA%20Cookbook%20Cu
Customer/Vendor Integration stomer%20Vendor%20Integration.pdf

You can extend the tables listed below using the corresponing customer include.
Table Description Customer Include Customer Include
BUT000 General INCL_EEW_BUT000 INCL_EEW_BUT000_X
KNA1 Customer General INCL_EEW_KNA1 INCL_EEW_KNA1_X
KNB1 Company Code (Customer) INCL_EEW_KNB1 INCL_EEW_KNB1_X
KNVV Sales Data INCL_EEW_KNVV INCL_EEW_KNVV_X
LFA1 Supplier General INCL_EEW_LFA1 INCL_EEW_LFA1_X
LFB1 Company Code (Supplier) INCL_EEW_LFB1 INCL_EEW_LFB1_X
LFM1 Purchasing Org Data INCL_EEW_LFM1 INCL_EEW_LFM1_X

The screenshots below show the extension with custom field ZZLOB and ZZ1_ZEXT_WKF1_BUS (field was
created using the Key User Extensibility) for general data of business partner (BUT000 and structure
BUS_EI_BUPA_CENTRAL_DATA_XFLAG). This concerns the structure INCL_EEW_BUT000 and
INCL_EEW_BUT000_X.

7
Consider enabling existing custom database fields for usage in SAP Fiori applications
(https://help.sap.com/docs/SAP_NETWEAVER_AS_ABAP_752/b4367b1cec3243c4989f0ff3d727c4ab/4accf
edc4d2e49c1b321b6ebf288a430.html?version=latestl ) and run transaction SCFD_EUI.

2.1.2. Extend the MDG Data Model

1 Log into system for cross-client


maintenances.

8
2 Start Customizing for Master Data
Governance (transaction MDGIMG).

Choose General Settings > Data


Modeling > Edit Data Model.

3 Select the BP data model.

4 Choose Entity Types.

Select Entity Types BPBP_CENTRL.

5 Choose Attributes.

Choose the New Entries pushbutton


to add a new attribute to the
BP_CENTRL entity type.

9
6 Enter the attribute name
ZZLOB, the same data
element used in the backend
table, the used structure and
field name. Enter the attribute
name ZZSTAGE (differs from
backend), but the same data
element used in the backend
table, the used structure and
field name.
Note: Make sure that at
least the data element in the
backend and MDG is
identical.

7 Save and activate the changes.

8 Start transaction SE38.


Run program USMD_DATA_MODEL
and choose Data Model: BP

9 Locate entity type BP_ CENTRL


and choose it to see the generated
table.

10
10 Verify that the generated table
contains the added field
/1MD/BPZZLOB and
/1MD/BPZZSTAGE.

2.1.3. Generate Data Model-Specific Structures for MDG


In this Customizing activity, you generate the following technical structures in the ABAP Dictionary for each data
model and entity type. If you have generated the data model specific structures using the data model activation
of the Customizing activity Edit Data Model, then you do not need to use the Customizing activity Generate Data
Model-Specific Structures for the generation of data model-specific structures. SAP delivers both data models and
corresponding structures. The namespace of these structures is /MDG*/. These structures also contain a
customizing include. If you change the data model later, you need to adjust the structures by means of these
customizing includes.

Note:
In general if you change a data model (for example, if you change attributes of entity types or relationships); you need
to regenerate the structures.

1 Log into the system for cross-client


maintenance.
2 Start Customizing for Master Data
Governance (transaction MDGIMG).

Choose General Settings > Data


Modeling > Generate Data Model-
Specific Structures.

11
3 Select the row with BP Data Model.
Remember the development
package.

Choose Structures in the left-hand


panel. Select the structures of the
corresponding entity types.

Choose the Generate Structures


pushbutton.

4 Assign development package


/MDGBP/MDG_BS_BP_STRUCTURES,
if a dialog box appears (several
times).

The structures in namespace /MDG*


will not be generated again, but
customer include structures are
activated.

5 In the following steps, you verify that


your field extension was
successfully added to the Customer
Include of the structures.

Start transaction SE11.

Display structures
/MDGBP/_S_BP_PDF_BP_CENTRL,
/MDGBP/_S_BP_PP_BP_CENTRL,
/MDGBP/_S_BP_ES_BP_CENTRL,
/MDGBP/_S_BP_FP_BP_CENTRL by
entering the details as shown.

6 The new field has been generated in


the Customer Include of the mapping
structure.

12
2.1.4. Define SMT Mapping
The Service Mapping Tool (SMT) is a program that enables you to fill target structures by using sets of
source structures (in ABAP). It supports simple mappings, mappings with field transformations, complex
transformations, and field checks.
You need to perform the following mappings:
• Mapping Central Data to the API (BP_BP_CENTRL_2API)
o Central Business Partner Data
o X Structure for Central Business Partner Data
• Mapping Business Partner general data to MDG staging (MDG_BS_BP_MAP_2STA)
o Central Business Partner Data

1 Log into system for cross-client


maintenance.

2 Start Customizing for Master


Data Governance (transaction
MDGIMG).

Choose General Settings >


Data Modeling > Extend
Mappings > Extend Mappings.

Choose Mapping > Open.

Enter BP_BP_CENTRL_2API.

3 You have opened the mapping


of BP central data from MDG
staging area to the service API.

You see a table with mapping


steps.

You start by extending the


mapping for the Central
Business Partner Data.

13
4 Select the first mapping step as
shown.

Choose the Details pushbutton.

5 Select the Transformations tab.

6 Change to edit mode by


choosing the Edit pushbutton.

Above the transformations


table, choose the Add
pushbutton to add a new
transformation, assign your
development package and
choose Field Mapping.

14
7 Choose the Add pushbutton
above the Field Mapping table.

Enter the mapping for ZZLOB/


ZZ1_ZEXT_WKF1_BUS as
shown.

Save the changes.

8 Return to the Mapping Step


table for the mapping
BP_BP_CENTRL_2API.

You have opened the mapping


of BP central data from MDG
staging area to the service API.

You see a table with mapping


steps.

You will now extend the


mapping for the Central
Business Partner Data X
structure.

Select the *_XFLAG mapping


step and choose the Details
pushbutton.

15
9 Select the Transformations tab.

10 Change to edit mode by


choosing the Edit pushbutton.

Above the Transformations


table choose the Add
pushbutton to add a new
transformation and select Field
Mapping.

11 Choose the Add pushbutton


above the Field Mapping table
and enter the mapping for
ZZLOB/
ZZ1_ZEXT_WKF1_BUS as
shown.

16
12 Save the changes.

13 Select Mapping -> Open.

Enter
MDG_BS_BP_MAP_2STA. You
have opened the mapping of
BP general data from the
service API to the MDG staging
area.

You see a table with mapping


steps.

You need to extend the


mapping for the Central Data.
Choose the Detials pushbutton.

14 Select the Transformations tab.

Choose the Edit pushbutton.


Select the package.

Choose the Add pushbutton to


add a new transformation and
select Field Mapping.

17
15 Choose the Add pushbutton
above the Field Mapping table.

Enter the mapping for ZZLOB/


ZZ1_ZEXT_WKF1_BUS as
shown.

Save your changes.

2.1.5. Check Customizing

1 Start transaction MDGIMG.


Navigate to General
Settings > Data
Modeling > Create and Edit
Mappings > Check
Customizing.

2 Enter mapping
BP_BP_CENTRL_2API
(you might use the value
help). Choose Execute.
Check that no error
message is issued.

18
3 Repeat this for mapping
BP_BP_CENTRL_2STA.
Check that no error
message is issued.

2.1.6. Define Field Properties for UI

1 Log into system for cross-client


maintenances.

2 Start transaction MDGIMG.


Navigate to General
Settings > UI Modeling > Define
Field Properties for UI.

Select data model BP and


choose Field Names.

Add the new fields for entity


BP_CENTRL.

Save your changes.

2.1.7. Custom Handler Class


A custom handler class is necessary if you have custom fields and you want to use the file download
application or the query method.

Ensure these SAP Notes already implemented:


3223641 MDG-BP/C/S: Invalid execution of the Query Methods of SAP owned Handler Classes
3223718 MDG-BP/C/S: Type-casted Mapping for SAP owned Handler Classes (1)
3223776 MDG-BP/C/S: Type-casted Mapping for SAP owned Handler Classes (2)

To create a custom handler class follow the guide here: Create and Register a Custom Handler Class on the
MDG Community How-to Information for SAP Master Data Governance.

19
1 Log into system for cross-client
maintenances and follow the instructions
in the above mentioned guide to create a
custom handler class for example
ZCL_CUSTOM_BP_HANDLER (inheritance
from CL_MDG_BS_FND_HANDLER)

2 Redefine method
IF_MDG_BS_BP_ACCESS_HANDLER~EXE
CUTE_QUERY.

See Appendix 524.1 Example coding for


class ZCL_CUSTOM_BP_HANDLER.

3 Specify handler classes for your own data


to be processed by Master Data
Governance in MDGIMG > Central
Governance for Business Partner >
Specify Handler Processed by Access
Class.

2.1.8. Define Field Mapping for SAP HANA-Based Search


To use SAP HANA-based search as a search provider, search views are created using the Create Search View
function.For data model BP you need to define the mapping between the MDG model entities and attributes, and
the reuse attributes.
More information for Configuring SAP HANA-Based Search for MDG:
https://help.sap.com/viewer/6d52de87aa0d4fb6a90924720a5b0549/latest/en-
US/7293f8516599a060e10000000a44176d.html

1 Log into system for cross-client


maintenances.
2 Start transaction MDGIMG.
Navigate to General
Settings > Data Quality and
Search > Search and Duplicate
Check > Define Joins, Field
Mapping, and Authorizations for
Reuse Tables. Choose Field
Mapping and choose New
Entries. Add the new fields for

20
entity BP_CENTRL. Save your
changes.

3 Start transaction MDGIMG.


Navigate to General
Settings > Data Quality and
Search > Search and Duplicate
Check > Create Search View.

Add the new fields to your search


view in step 2 Select Entities and
Attributes. Review and Generate.

4 Optional: Start transaction


MDGIMG. Navigate to General
Settings > Data Quality and
Search > Search and Duplicate
Check > Define Search
Applications. Choose Search
Mode HA, choose search help
MDG_BS_CUS_CUSTOMER
and Allocation of Fuzziness of
Attribute in SearchHelp.

21
5 You can add an Entity Type and
Attribute and then specify the
Fuzziness you would like for non-
key fields. The fuzziness
threshold ranges from greater
than 0.7 to less than or equal to
1.0. The default value for
fuzziness is 0.7 for non-key fields
when you have not maintained
an entry in the customizing table,
excluding special cases. Defining
a fuzziness threshold of 1.0
means that only exact matches
will be returned in the search
results when using the EQUAL
TO operator.

2.1.9. Enhance Search UIBB


In this Customizing activity, you add the custom fields as selection criteria to the search UI. The configuration ID
for search method Customer Search (HANA) is BS_CU_DQUERY_HA, the configuration ID for search method
Supplier Search (HANA) is BS_SP_DQUERY_HA.

1 Log into system for cross-


client maintenances.
2 Start SE80 for Web
Dynpro component:
FPM_SEARCH_UIBB
and open Component
Configurations.

3 Select config ID
BS_CU_DQUERY_HA
and choose Start
Configurator and
choose Display.

22
4 Choose Create
Customizing, enter a
description and choose
a transport.

5 Choose +Search
Criteria and select your
custom fields. Move the
fields to the desired
place. Save your
customizing.

6 Move the fields to the


desired place. Save
your customizing.

23
7 Check the Search
Customers UI for
Search Method:
Customer Search
(HANA).

2.1.10. Adjust Staging Area of Linked Change Requests

1 Log into system for which change


request adjustment is required.
2 Start Customizing for Master Data
Governance (transaction
MDGIMG).

Select General Settings> Data


Modeling> Edit Data Model.

Select data model BP and


choose the button Adjust Staging
Area of Linked Change Requests
as shown in the screenshot.
3 Close the pop-up.

2.1.11. Test Your Configuration


To test your configuration you need to add your new fields to the MDG single maintenance UI. Section 2.4
User Interface Configuration explains how to add the new fields to the UI.

Create a new change request in MDG and enter values for the new fields. Then process the change request
until it is activated. Write down the ID of the new customer after activation.

24
Run transaction SE16 and find your newly created Business Partner in table BUT000. Make sure the fields
ZZLOB and ZZ1_ZEXT_WKF1_BUS is there and contain the right value.

25
2.2. Extended Field Exists in Vendor / Customer Only
In this section you will learn how to add a new field License to the MDG BP data model. In the figure below
you can see that it is necessary to extend the MDG BP data model. You also must have extended the
Vendor / Customer table on the MDG hub and client systems. In order to facilitate data transfer between the
MDG staging area and the LFA1 / KNA1 table on the MDG hub you have to extend the SMT mapping.

Figure: Field is added only to Vendor / Customer

This section is subdivided in to one sub-section for each implementation step. Take a look at the table below
to get an overview of the steps involved.

Implementation Steps Field only in Field only in Field in both BP and


Business Partner Vendor/Customer Vendor/ Customer
Extend ERP data model   
Extend MDG data model   
Generate MDG data model   
Define SMT mapping  1
 2
1
Implement CVI mapping 

SMT Mappings
1
MDG staging ↔ Business Partner
2
MDG staging ↔ Vendor / Customer

Since this scenario contains several similarities to the one explained in section Extended Field Exists in
Business Partner and the one explained in section Extended Field Exists in Vendor / Customer on the
detailed instructions below focus only on the additional steps.

For the extension of LFA1 follow the steps in section Extend the
Extend ERP data model
BUT000 Data Model above.
Extend MDG data model To extend the MDG data model, follow the steps below.

26
Generate MDG data model To generate the MDG data model, follow the steps below.
specific structures
Adjust Staging Area of Linked Follow steps in the section Adjust Staging Area of Linked
Change Requests Change Requests above.
Define SMT mapping To define SMT mapping between MDG staging and vendor,
follow the steps below.

2.2.1. Extend the MDG Data Model


1 Log into system for cross-client
maintenances.

2 Start Customizing for Master


Data Governance (transaction
MDGIMG).
Select General Settings ->
Data Modeling -> Edit Data
Model.

3 Select data model BP.

27
4 Double-click entity types.
Select entity BP_VENGEN.

5 Double-click Attributes.

Choose New Entries to add a


new attribute to the entity
BP_VENGEN.

6 Enter the field name ZZLICVEN


and an appropriate data
element (for example,
ZZ_LICENSE).

28
7. Activate the changes.

8 Start transaction SE38.


Run program
USMD_DATA_MODEL.

9 Locate entity type BP_VENGEN


and double-click it to see the
generated table.

29
10. Verify that the generated table

contains the added field


/1MD/BPZZLICVEN.

2.2.2. Generate Data Model-Specific Structures for MDG


Whenever you change the MDG data model, you need to regenerate the tables. In this customizing activity,
you generate technical structures and tables in the ABAP Dictionary for each data model and entity type. The
system uses these structures internally for implementing the staging area. To generate these data
modelspecific structures follow the steps below.

Note:
In general if you change a data model (for example, if you change attributes of entity types or relationships), you
need to regenerate the structures.

1 Log into system for cross-client


maintenances.

30
2 Start Customizing for Master Data
Governance (transaction MDGIMG).
Select General Settings -> Data
Modeling -> Generate Data Model-
Specific Structures.

3 Select the row with Data Model BP

Double-click Structures in the left hand


panel.

Choose the Generate Structures


pushbutton.

31
4 In the following steps you will verify that
your field extension was successfully
added to the Customer Include of the
mapping structure.

Start transaction SE11.

Display structure
/MDGBPX/_S_BP_PP_BP_VENGEN by
entering the details as shown.

5 The new field has been generated in the


Customer Include of the mapping
structure.

2.2.3. Define SMT Mapping


The Service Mapping Tool (SMT) is a program that enables you to fill target structures by using sets of
source structures (in ABAP). It supports simple mappings, mappings with field transformations, complex
transformations, and field checks.
You need to perform the following mappings:
• Mapping Central Data -> API (SUPPL_BP_VENGEN_2API)
Central Business Partner Data
• Mapping Central Data -> Staging(SUPPL_BP_VENGEN_2STA)
Central Business Partner Data

32
1 Log into system for cross-client
maintenances.

2 Start Customizing for Master Data


Governance (transaction
MDGIMG).

Select General Settings -> Data


Modeling -> Extend Mappings ->
Extend Mappings.

Select Mapping -> Open.

Enter SUPPL_BP_VENGEN_2API.

3 Select mapping structure


VMDS_EI_VMD_CENTRAL_DATA.

Choose the Details pushbutton


above the Mapping Steps table.

33
4 Select the Transformations tab.

Change to edit mode by clicking


the Edit pushbutton.

Above the transformations table


choose the Add pushbutton to
add a new transformation of type
Field Mapping.

5 Choose the Save pushbutton.

34
6 Select Mapping
SUPPL_BP_VENGEN_2API.

7 Select the mapping step Update


flag for vendor central data.

35
8 Choose the Save pushbutton.

9 Start Customizing for Master


Data Governance (transaction
MDGIMG).

Select General Settings -> Data


Modeling -> Extend Mappings -
> Extend Mappings.

Select Mapping -> Open.

Enter SUPPL_BP_VENGEN_2STA.

36
10 Select mapping structure
MDG_BS_SUPPL_BP_VENGEN.

Choose Details above the


Mapping Steps table.

11 Select the Transformations tab.

Change to edit mode by clicking


the Edit pushbutton.

Above the transformations table


choose the Add pushbutton to
add a new transformation of type
Field Mapping.

2.2.4. Test Your Configuration


To test your configuration you should first add your new field to the MDG single maintenance UI. Section
User Interface Configuration provides some instructions on how to add the new field to the UI.
Create a new change request in MDG and enter a value for the new field in the ERP Vendor Control Data
section. Then process the change request until it is activated. Write down the ID of the new Supplier after
activation.

37
Run transaction SE16 and find your newly created Vendor in table LFA. Make sure the field ZZ_LICENSE is
there and contains the right value.

38
2.3. Extended Field Exists in Business Partner and in Vendor / Customer
In this section you will learn how to add a new field “License” to the MDG BP data model. In the figure below
you can see that it is necessary to extend the MDG BP data model. You also must have extended the
BUT000 and LFA1 / KNA1 tables on the MDG hub and client systems. In order to facilitate data transfer
between the MDG staging area and the BUT000 on the MDG hub you have to extend the SMT mapping. To
facilitate data transfer from BUT000 on the hub and the LFA1 / KNA1 tables on the MDG hub you have to
implement CVI mapping. You find more information about Customer Vendor Integration in this FAQ Note
2713963 FAQ: CVI - Customer Vendor Integration for system conversion to SAP S/4HANA.

In this scenario the Customer Vendor Integration (CVI) is taking care of the data transfer between BUT000
and LFA1 / KNA1 data structures. For a better understanding you can take a look at the CVI architecture
overview shown in the figure below.

39
This section is subdivided in to one sub-section for each implementation step. Take a look at the table below
to get an overview of the steps involved.

Implementation Steps Field only in Field only in Field in both BP and


Business Partner Vendor/Customer Vendor/ Customer
Extend ERP data model   
Extend MDG data model   
Generate MDG data model   
Define SMT mapping 1 2 1
Implement CVI mapping 

SMT Mappings
1
MDG staging ↔ Business Partner
2
MDG staging ↔ Vendor / Customer

Since this scenario contains several similarities to the one explained in section Extended Field Exists in
Business Partner and the one explained in section Extended Field Exists in Vendor / Customer on the
detailed instructions below focus only on the additional steps.
Extend ERP data model For the extension of BUT000 follow steps in section Extend the
BUT000 Data Model starting.
To extend LFA1 follow the steps outlined in the next section.
Extend MDG data model Follow the steps in section Extend the MDG Data Model above
Generate MDG data model
Follow the steps in section Generate Data Model above.
specific structures
Define SMT mapping Follow steps in the section Define SMT Mapping above.
Adjust Staging Area of Follow steps in the section Adjust Staging Area of Linked Change
Linked Change Requests Requests above.
Implement CVI mapping For implementing the CVI mapping follow the steps below.

2.3.1. Extend LFA1


In this section you extend the append structures for vendor (LFA1). You add the field ZZ_LICENSE to
structures LFA1, VMDS_EI_VMD_CENTRAL_DATA and VMDS_EI_VMD_CENTRAL_DATA_XFLAG

1 Log into system for cross-client


maintenances.

40
2 Start transaction SE11.
Open structure
ZMDG_SUPPLIER_EHP6_TEST_S
UPL1.

Add the new field ZZ_LICENSE to


the structure.

Activate the changes.

3 Verify that the appended field


appears in structure
VMDS_EI_VMD_CENTRAL_DATA.

4 Start transaction SE11.


Open structure
ZMDG_SUPPLIER_EHP6_TEST_S
UPL2.

Add the new field ZZ_LICENSE to


the structure.

Activate the changes.

41
5 Verify that the appended field
appears in structure
VMDS_EI_VMD_CENTRAL_DATA_
XFLAG.

6 Start transaction SE11.


Open structure LFA1.

Create an append structure and


add the new field ZZ_LICENSE to
the append structure.

Activate the changes.

42
7 Verify that the appended field
appears in structure LFA1.

2.3.2. Implement Enhancement Spot CVI_CUSTOM_MAPPER


To map our custom field from business partner to vendor and back you must implement interface
IF_EX_CVI_CUSTOM_MAPPER of enhancement spot CVI_CUSTOM_MAPPER. You should at least implement
the methods highlighted in the figure below.

1 Log into system for cross-


client maintenances.

2 Start transaction SE18.

Enter
CVI_CUSTOM_MAPPER and
choose the Display
pushbutton.

43
3 Double-click
Implementations.

4 Create a new BAdI


implementation
ZZ_EXTENSIBILITY_TEST

5 You will need to implement


the interface methods
MAP_BP_TO_VENDOR and
MAP_VENDOR_TO_BP.

44
6 MAP_BP_TO_VENDOR c_vendor-central_data-central-data-zz_license
= i_partner-central_data-common-data-zz_license.

c_vendor-central_data-central-datax-
zz_license = i_partner-central_data-common-
dataxzz_license.
7 MAP_VENDOR_TO_BP c_partner-central_data-common-data-
zz_license = i_vendor-central_data-central-
data-zz_license.

c_partner-central_data-common-datax-
zz_license
= i_vendor-central_data-central-datax-zz_license.

2.3.3. Test Your Configuration


To test your configuration you should first add your new field to the MDG single maintenance UI. At the end
of this document you will find a section that provides some instructions on how to add the new field to the UI.
Create a new change request in MDG and enter a value for the new field. Then process the change request
until it is activated. Write down the ID of the new Supplier after activation. Check BUT000 and LFA1 the
value for the new License field should appear in both tables.

45
2.4. User Interface Configuration
The UI is configured using the Floorplan Manager. The Floorplan Manager (FPM) is a Web Dynpro ABAP
application that provides a framework for developing new Web Dynpro ABAP application interfaces
consistent with SAP UI guidelines.

The entry point you need for starting an application is the application configuration, which is tied to a single
Web Dynpro application. The necessary information needed to start the application is divided between the
following two entities:

• Web Dynpro ABAP Application: Contains the information about the main component and window
of the application
• Web Dynpro ABAP Application Configuration: Contains the information about the configuration
used for starting the main component

There are only 3 different main components used in FPM-based applications. Each one corresponds to one
of the supported floorplans:

• OIF (Object Instance Floorplan): component FPM_OIF_COMPONENT

• GAF (Guided Activity Floorplan): component FPM_GAF_COMPONENT

• OVP (Overview Page Floorplan): component FPM_OVP_COMPONENT


In the screenshot below application BS_OVP_SP is using component FPM_OVP_COMPONENT. Here, it is
specified that FPM_OVP_COMPONENT will start with component configuration BS_SP_OVP. As component
FPM_OVP_COMPONENT is the component providing the floorplan’s functionality and layout, we will use the
term 'floorplan component' for it and the term 'floorplan configuration' for the configuration used to start it.

2.4.1. Adaptation Options in Floorplan Manager


A Floorplan Manager UI can be adapted using different techniques. The figure below shows how the options
configuration, customizing and personalization are related to each other. Context-Based-Adaptation is
another way the user interface can be customized for specific use cases.

46
In the context of MDG you would typically choose to customize the SAP delivered configuration. Only if
customizing is not feasible you would copy the SAP delivered UI configuration to the customer namespace
and change the copy.
In the following cases the UI should be copied rather than customized:
• Code changes are required
• The UI needs to be changed for all users in the system and not only client specific
• The changes to the UI are extensive

Note:
For more details regarding options for floorplan manager user interface adaptation, advantages, disadvantages
and steps required please familiarize yourself with SAP Note 1619534 and Blog and SAP Online Help
(“Adapting FPM Applications” https://help.sap.com/viewer/9c91640bf34c49d8bad6bc560bedd707/latest/en-
US/a895eb30653c4a82b675d9258f9ca4d5.html ).

2.4.2. Adding a New Field to UI for Single Maintenance (BUT000 Extension Case)
At this stage you have to make a decision whether you want to extend the standard UI configuration or
create a copy. If you are only going to make small changes to the UI configuration (for example adding a
field) you can follow the steps described below to extend the standard configuration. In case you need to
make significant adjustments to the UI configuration it is recommended to modify a copy.

1 Open application
configuration BS_OVP_SP
or component configuration
BS_BP_DETAILS (or the
corresponding configurations
for MDG-C/S) and create
Customizing. Enter a
description and assign a
transport request.

47
2 You can now continue to
make the necessary
adjustments. Add field
ZZLOB as element.

3 Maintain the attributes for


the new field.

Save your component


customizing.

4 Start the UI for Supplier


Governance and check your
new field.

48
Note:
If you want an overview of the UI Customizing settings or if you need to delete UI Customizing settings, refer to the
following Web Dynpro applications: WD_ANALYZE_CONFIG_USER (user perspective),
WD_ANALYZE_CONFIG_COMP (component perspective), and WD_ANALYZE_CONFIG_APPL (application
perspective).

Note:
UI customizing is client specific.

2.4.3. Adding a New Field to the UI for Single Maintenance (Extended Field Exists in Vendor /
Customer Only)
At this stage you have to make a decision whether you want to extend the standard UI configuration or
create a copy. If you are only going to make small changes to the UI configuration (for example adding a
field) you can follow the steps described below to extend the standard configuration. In case you need to
make significant adjustments to the UI configuration it is recommended to modify a copy.

Run transaction SE80. And open the WDR_CFGE_EDITOR Web Dynpro Component. Start the
customize_component Web Dynpro Application

To customize the Web Dynpro component, complete the following entries and choose the New pushbutton:
• Component Name: FPM_OVP_COMPONENT
• Configuration ID: BS_SP_OVP

49
Enter a description and assign a transport request. If you have extended the data model and you want to
display additional fields on the user interface, you can now continue to make the necessary adjustments.

FIGURE: SELECTING THE PAGE BS_SP_GENERAL_DATA (ERP VENDOR) TO ADD THE NEW FIELD

FIGURE: ADDING THE NEW FIELD TO THE BS_SP_GENERAL_DATA (ERP VENDOR) PAGE

50
3. ADDITIONAL INFORMATION
3.1. Further Reading
SAP Master Data Governance Online help:
https://help.sap.com/viewer/product/SAP_MASTER_DATA_GOVERNANCE/latest/en-US

SAP MDG on S/4HANA Online help:


https://help.sap.com/viewer/6d52de87aa0d4fb6a90924720a5b0549/latest/en-
US/56a57357f2b1aa6be10000000a4450e5.html

MDG in SAP Community:


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

MDG Presentations:
https://blogs.sap.com/2020/07/21/sap-master-data-governance-at-a-glance/

MDG Extensibility:
https://wiki.scn.sap.com/wiki/display/SAPMDM/Documentation%3A+Customer%2C+Supplier%2C+and+
Business+Partner+Data

Floorplan Manager for Web Dynpro ABAP:


https://help.sap.com/viewer/9c91640bf34c49d8bad6bc560bedd707/latest/en-
US/9f95467bbefc4a808fffeba4c5177258.html

How to Adapt FPM:


https://help.sap.com/viewer/9c91640bf34c49d8bad6bc560bedd707/latest/en-
US/a895eb30653c4a82b675d9258f9ca4d5.html

FPM Blog:
https://blogs.sap.com/2021/03/02/how-to-create-enhance-and-adapt-floorplan-manager-applications-for-
sap_ui-7.55/

Service Mapping Tool (SMT):


https://help.sap.com/viewer/53ed66c164434d3c93bab39678435a1b/2021.000/en-
US/7dde4a610003482ebdcfa42285c10912.html

SAP S/4HANA Cookbook CVI:


https://support.sap.com/content/dam/SAAP/SAP_Activate/S4H.0781%20SAP%20S4HANA%20Cookboo
k%20Customer%20Vendor%20Integration.pdf

3.2. SAP Notes


In addition to the detailed explanations written in this document, please see the following SAP Notes for
further important information about creating a user interface for multiple-record processing:

2313368 Functional restrictions in MDG for Business Partner / Customer / Supplier with SAP Master Data
Governance 9.0
2472845 Functional restrictions in MDG for Business Partner / Customer / Supplier with SAP Master Data
Governance 9.1
2656712 Functional restrictions in MDG for Business Partner / Customer / Supplier in SAP Master Data
Governance 9.2 and on SAP S/4HANA 1809
2816557 Functional restrictions in MDG for Business Partner / Customer / Supplier on SAP S/4HANA 1909
2925030 Functional restrictions in MDG for Business Partner / Customer / Supplier on SAP S/4HANA 2020
3070003 Functional restrictions in MDG for Business Partner / Customer / Supplier on SAP S/4HANA 2021
2713963 FAQ: CVI - Customer Vendor Integration for system conversion to SAP S/4HANA
3163839 MDG: Issue with Length of Fieldnames in Highlight Changes API

51
4. APPENDIX
4.1. Example coding for class ZCL_CUSTOM_BP_HANDLER
Redefinition for IF_MDG_BS_BP_ACCESS_HANDLER~EXECUTE_QUERY.

METHOD if_mdg_bs_bp_access_handler~execute_query.
*! Execute search queries (e.g. triggered by file download).
*
* IT_SEL can contain multiple and different selection criteria.
* Still, all criteria relates to the given IV_ENTITY.
*
* ET_DATA can have a generic structure. It does not need to
* contain all attributes of the given IV_ENTITY.
DATA:
lr_data TYPE REF TO data,
lt_value TYPE usmd_ts_val_list,
lv_value TYPE usmd_value.

ef_handled = abap_true.

"The MDG framework executes non-supported queries multiple times


"(e.g. a second call with less nor no selection criteria). This
"cannot be handled since it might cause a selection of all existing
"business partners!
IF me->mv_prev_query_not_supported = abap_true
AND it_sel IS INITIAL
AND iv_num_entries = 0.
ef_not_supported = me->mv_prev_query_not_supported.
RETURN.
ELSE.
CLEAR me->mv_prev_query_not_supported.
ENDIF.

"Handle the queries for the given entity type


CLEAR lt_value.
CASE iv_entity.
WHEN if_mdg_bp_constants=>gc_bp_model_entity-central.
"The examples relates to attributes of entity type BP_CENTRL.
"Since the existing code in class CL_MDG_BS_BP_HANDLER in
"method QUERY_BP_CENTRL cannot handle the custom attributes,
"the SAP owned class returns a 'ef_not_supported = abap_true'.
"Thus the custom handler class is the place to handle that query.
"The code of the SAP owned class can used as template. It needs
"to be enhanced with the custom attributes.
DATA: lt_but000 TYPE TABLE OF but000.

"Each supported selection criterion needs a range and a line.


DATA:
lr_augrp TYPE RANGE OF but000-augrp,
lr_augrp_line LIKE LINE OF lr_augrp,
lr_birthdt TYPE RANGE OF but000-birthdt,
lr_birthdt_line LIKE LINE OF lr_birthdt,
lr_birthdt_status TYPE RANGE OF but000-birthdt_status,
lr_birthdt_status_line LIKE LINE OF lr_birthdt_status,
lr_birthpl TYPE RANGE OF but000-birthpl,
lr_birthpl_line LIKE LINE OF lr_birthpl,
lr_bpext TYPE RANGE OF but000-bpext,

52
lr_bpext_line LIKE LINE OF lr_bpext,
lr_bpkind TYPE RANGE OF but000-bpkind,
lr_bpkind_line LIKE LINE OF lr_bpkind,
lr_bu_langu TYPE RANGE OF but000-bu_langu,
lr_bu_langu_line LIKE LINE OF lr_bu_langu,
lr_bu_sort1 TYPE RANGE OF but000-bu_sort1,
lr_bu_sort1_line LIKE LINE OF lr_bu_sort1,
lr_bu_sort2 TYPE RANGE OF but000-bu_sort2,
lr_bu_sort2_line LIKE LINE OF lr_bu_sort2,
lr_cndsc TYPE RANGE OF but000-cndsc,
lr_cndsc_line LIKE LINE OF lr_cndsc,
lr_contact TYPE RANGE OF but000-contact,
lr_contact_line LIKE LINE OF lr_contact,
lr_deathdt TYPE RANGE OF but000-deathdt,
lr_deathdt_line LIKE LINE OF lr_deathdt,
lr_emplo TYPE RANGE OF but000-emplo,
lr_emplo_line LIKE LINE OF lr_emplo,
lr_found_dat TYPE RANGE OF but000-found_dat,
lr_found_dat_line LIKE LINE OF lr_found_dat,
lr_initials TYPE RANGE OF but000-initials,
lr_initials_line LIKE LINE OF lr_initials,
lr_jobgr TYPE RANGE OF but000-jobgr,
lr_jobgr_line LIKE LINE OF lr_jobgr,
lr_langu_corr TYPE RANGE OF but000-langu_corr,
lr_langu_corr_line LIKE LINE OF lr_langu_corr,
lr_legal_enty TYPE RANGE OF but000-legal_enty,
lr_legal_enty_line LIKE LINE OF lr_legal_enty,
lr_legal_org TYPE RANGE OF but000-legal_org,
lr_legal_org_line LIKE LINE OF lr_legal_org,
lr_liquid_dat TYPE RANGE OF but000-liquid_dat,
lr_liquid_dat_line LIKE LINE OF lr_liquid_dat,
lr_location_1 TYPE RANGE OF but000-location_1,
lr_location_1_line LIKE LINE OF lr_location_1,
lr_location_2 TYPE RANGE OF but000-location_2,
lr_location_2_line LIKE LINE OF lr_location_2,
lr_location_3 TYPE RANGE OF but000-location_3,
lr_location_3_line LIKE LINE OF lr_location_3,
lr_marst TYPE RANGE OF but000-marst,
lr_marst_line LIKE LINE OF lr_marst,
lr_mc_name1 TYPE RANGE OF but000-mc_name1,
lr_mc_name1_line LIKE LINE OF lr_mc_name1,
lr_mc_name2 TYPE RANGE OF but000-mc_name2,
lr_mc_name2_line LIKE LINE OF lr_mc_name2,
lr_namcountry TYPE RANGE OF but000-namcountry,
lr_namcountry_line LIKE LINE OF lr_namcountry,
lr_nameformat TYPE RANGE OF but000-nameformat,
lr_nameformat_line LIKE LINE OF lr_nameformat,
lr_namemiddle TYPE RANGE OF but000-namemiddle,
lr_namemiddle_line LIKE LINE OF lr_namemiddle,
lr_name_first TYPE RANGE OF but000-name_first,
lr_name_first_line LIKE LINE OF lr_name_first,
lr_name_grp1 TYPE RANGE OF but000-name_grp1,
lr_name_grp1_line LIKE LINE OF lr_name_grp1,
lr_name_grp2 TYPE RANGE OF but000-name_grp2,
lr_name_grp2_line LIKE LINE OF lr_name_grp2,
lr_name_last TYPE RANGE OF but000-name_last,
lr_name_last_line LIKE LINE OF lr_name_last,

53
lr_name_last2 TYPE RANGE OF but000-name_last2,
lr_name_last2_line LIKE LINE OF lr_name_last2,
lr_name_lst2 TYPE RANGE OF but000-name_lst2,
lr_name_lst2_line LIKE LINE OF lr_name_lst2,
lr_name_org1 TYPE RANGE OF but000-name_org1,
lr_name_org1_line LIKE LINE OF lr_name_org1,
lr_name_org2 TYPE RANGE OF but000-name_org2,
lr_name_org2_line LIKE LINE OF lr_name_org2,
lr_name_org3 TYPE RANGE OF but000-name_org3,
lr_name_org3_line LIKE LINE OF lr_name_org3,
lr_name_org4 TYPE RANGE OF but000-name_org4,
lr_name_org4_line LIKE LINE OF lr_name_org4,
lr_name1_text TYPE RANGE OF but000-name1_text,
lr_name1_text_line LIKE LINE OF lr_name1_text,
lr_natio TYPE RANGE OF but000-natio,
lr_natio_line LIKE LINE OF lr_natio,
lr_natpers TYPE RANGE OF but000-natpers,
lr_natpers_line LIKE LINE OF lr_natpers,
lr_nickname TYPE RANGE OF but000-nickname,
lr_nickname_line LIKE LINE OF lr_nickname,
lr_not_released TYPE RANGE OF but000-not_released,
lr_not_released_line LIKE LINE OF lr_not_released,
lr_partgrptyp TYPE RANGE OF but000-partgrptyp,
lr_partgrptyp_line LIKE LINE OF lr_partgrptyp,
lr_partner TYPE RANGE OF but000-partner,
lr_partner_line LIKE LINE OF lr_partner,
lr_prefix1 TYPE RANGE OF but000-prefix1,
lr_prefix1_line LIKE LINE OF lr_prefix1,
lr_prefix2 TYPE RANGE OF but000-prefix2,
lr_prefix2_line LIKE LINE OF lr_prefix2,
lr_print_mode TYPE RANGE OF but000-print_mode,
lr_print_mode_line LIKE LINE OF lr_print_mode,
lr_source TYPE RANGE OF but000-source,
lr_source_line LIKE LINE OF lr_source,
lr_title TYPE RANGE OF but000-title,
lr_title_line LIKE LINE OF lr_title,
lr_title_aca1 TYPE RANGE OF but000-title_aca1,
lr_title_aca1_line LIKE LINE OF lr_title_aca1,
lr_title_aca2 TYPE RANGE OF but000-title_aca2,
lr_title_aca2_line LIKE LINE OF lr_title_aca1,
lr_title_let TYPE RANGE OF but000-title_let,
lr_title_let_line LIKE LINE OF lr_title_let,
lr_title_royl TYPE RANGE OF but000-title_royl,
lr_title_royl_line LIKE LINE OF lr_title_royl,
lr_xblck TYPE RANGE OF but000-xblck,
lr_xblck_line LIKE LINE OF lr_xblck,
lr_xdele TYPE RANGE OF but000-xdele,
lr_xdele_line LIKE LINE OF lr_xdele,
lr_xsexf TYPE RANGE OF but000-xsexf,
lr_xsexf_line LIKE LINE OF lr_xsexf,
lr_xsexm TYPE RANGE OF but000-xsexm,
lr_xsexm_line LIKE LINE OF lr_xsexm,
lr_zzlob TYPE RANGE OF but000-
zzlob, "CUSTOM ATTRIBUTE
lr_zzlob_line LIKE LINE OF lr_zzlob, "CUSTOM ATTRIBUTE
lr_zz1_zext_wkf1_bus TYPE RANGE OF but000-
zz1_zext_wkf1_bus, "CUSTOM ATTRIBUTE

54
lr_zz1_zext_wkf1_bus_line LIKE LINE OF lr_zz1_zext_wkf1_bus. "CUSTOM A
TTRIBUTE

FIELD-SYMBOLS:
<ls_but000> TYPE but000,
<ls_data> TYPE any,
<ls_sel> TYPE usmd_s_sel,
<lv_value> TYPE any.

"map selection to SQL range


LOOP AT it_sel ASSIGNING <ls_sel>.
CASE <ls_sel>-fieldname.
WHEN 'REF_CEN'.
MOVE-CORRESPONDING <ls_sel> TO lr_augrp_line.
APPEND lr_augrp_line TO lr_augrp.
WHEN 'BIRTHDT'.
MOVE-CORRESPONDING <ls_sel> TO lr_birthdt_line.
APPEND lr_birthdt_line TO lr_birthdt.
WHEN 'BIRTHDTST'.
MOVE-CORRESPONDING <ls_sel> TO lr_birthdt_status_line.
APPEND lr_birthdt_status_line TO lr_birthdt_status.
WHEN 'BIRTHPL'.
MOVE-CORRESPONDING <ls_sel> TO lr_birthpl_line.
APPEND lr_birthpl_line TO lr_birthpl.
WHEN 'BPEXT'.
MOVE-CORRESPONDING <ls_sel> TO lr_bpext_line.
APPEND lr_bpext_line TO lr_bpext.
WHEN 'BPKIND'.
MOVE-CORRESPONDING <ls_sel> TO lr_bpkind_line.
APPEND lr_bpkind_line TO lr_bpkind.
WHEN 'BU_LANGU'.
MOVE-CORRESPONDING <ls_sel> TO lr_bu_langu_line.
APPEND lr_bu_langu_line TO lr_bu_langu.
WHEN 'BU_SORT1'.
MOVE-CORRESPONDING <ls_sel> TO lr_bu_sort1_line.
APPEND lr_bu_sort1_line TO lr_bu_sort1.
WHEN 'BU_SORT2'.
MOVE-CORRESPONDING <ls_sel> TO lr_bu_sort2_line.
APPEND lr_bu_sort2_line TO lr_bu_sort2.
WHEN 'CNDSC'.
MOVE-CORRESPONDING <ls_sel> TO lr_cndsc_line.
APPEND lr_cndsc_line TO lr_cndsc.
WHEN 'CONTACT'.
MOVE-CORRESPONDING <ls_sel> TO lr_contact_line.
APPEND lr_contact_line TO lr_contact.
WHEN 'DEATHDT'.
MOVE-CORRESPONDING <ls_sel> TO lr_deathdt_line.
APPEND lr_deathdt_line TO lr_deathdt.
WHEN 'EMPLO'.
MOVE-CORRESPONDING <ls_sel> TO lr_emplo_line.
APPEND lr_emplo_line TO lr_emplo.
WHEN 'FOUND_DAT'.
MOVE-CORRESPONDING <ls_sel> TO lr_found_dat_line.
APPEND lr_found_dat_line TO lr_found_dat.
WHEN 'INITIALSB'.
MOVE-CORRESPONDING <ls_sel> TO lr_initials_line.
APPEND lr_initials_line TO lr_initials.

55
WHEN 'JOBGR'.
MOVE-CORRESPONDING <ls_sel> TO lr_jobgr_line.
APPEND lr_jobgr_line TO lr_jobgr.
WHEN 'LNGU_CORR'.
MOVE-CORRESPONDING <ls_sel> TO lr_langu_corr_line.
APPEND lr_langu_corr_line TO lr_langu_corr.
WHEN 'LGAL_ENTY'.
MOVE-CORRESPONDING <ls_sel> TO lr_legal_enty_line.
APPEND lr_legal_enty_line TO lr_legal_enty.
WHEN 'LEGAL_ORG'.
MOVE-CORRESPONDING <ls_sel> TO lr_legal_org_line.
APPEND lr_legal_org_line TO lr_legal_org.
WHEN 'LQUID_DAT'.
MOVE-CORRESPONDING <ls_sel> TO lr_liquid_dat_line.
APPEND lr_liquid_dat_line TO lr_liquid_dat.
WHEN 'LOCATION1'.
MOVE-CORRESPONDING <ls_sel> TO lr_location_1_line.
APPEND lr_location_1_line TO lr_location_1.
WHEN 'LOCATION2'.
MOVE-CORRESPONDING <ls_sel> TO lr_location_2_line.
APPEND lr_location_2_line TO lr_location_2.
WHEN 'LOCATION3'.
MOVE-CORRESPONDING <ls_sel> TO lr_location_3_line.
APPEND lr_location_3_line TO lr_location_3.
WHEN 'MARST'.
MOVE-CORRESPONDING <ls_sel> TO lr_marst_line.
APPEND lr_marst_line TO lr_marst.
WHEN 'MCNAME1'.
MOVE-CORRESPONDING <ls_sel> TO lr_mc_name1_line.
APPEND lr_mc_name1_line TO lr_mc_name1.
WHEN 'MCNAME2'.
MOVE-CORRESPONDING <ls_sel> TO lr_mc_name2_line.
APPEND lr_mc_name2_line TO lr_mc_name2.
WHEN 'REF_CENTR'.
MOVE-CORRESPONDING <ls_sel> TO lr_namcountry_line.
APPEND lr_namcountry_line TO lr_namcountry.
WHEN 'REFCENTRL'.
MOVE-CORRESPONDING <ls_sel> TO lr_nameformat_line.
APPEND lr_nameformat_line TO lr_nameformat.
WHEN 'NANMIDDLE'.
MOVE-CORRESPONDING <ls_sel> TO lr_namemiddle_line.
APPEND lr_namemiddle_line TO lr_namemiddle.
WHEN 'NAM_FIRST'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_first_line.
APPEND lr_name_first_line TO lr_name_first.
WHEN 'NAME_GRP1'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_grp1_line.
APPEND lr_name_grp1_line TO lr_name_grp1.
WHEN 'NAME_GRP2'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_grp2_line.
APPEND lr_name_grp2_line TO lr_name_grp2.
WHEN 'NAME_LAST'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_last_line.
APPEND lr_name_last_line TO lr_name_last.
WHEN 'NAM_LAST2'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_last2_line.
APPEND lr_name_last2_line TO lr_name_last2.

56
WHEN 'NAME_LST2'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_lst2_line.
APPEND lr_name_lst2_line TO lr_name_lst2.
WHEN 'NAME_ORG1'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_org1_line.
APPEND lr_name_org1_line TO lr_name_org1.
WHEN 'NAME_ORG2'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_org2_line.
APPEND lr_name_org2_line TO lr_name_org2.
WHEN 'NAME_ORG3'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_org3_line.
APPEND lr_name_org3_line TO lr_name_org3.
WHEN 'NAME_ORG4'.
MOVE-CORRESPONDING <ls_sel> TO lr_name_org4_line.
APPEND lr_name_org4_line TO lr_name_org4.
WHEN 'NME1_TEXT'.
MOVE-CORRESPONDING <ls_sel> TO lr_name1_text_line.
APPEND lr_name1_text_line TO lr_name1_text.
WHEN 'NATIO'.
MOVE-CORRESPONDING <ls_sel> TO lr_natio_line.
APPEND lr_natio_line TO lr_natio.
WHEN 'NATPERS'.
MOVE-CORRESPONDING <ls_sel> TO lr_natpers_line.
APPEND lr_natpers_line TO lr_natpers.
WHEN 'NICK_NAME'.
MOVE-CORRESPONDING <ls_sel> TO lr_nickname_line.
APPEND lr_nickname_line TO lr_nickname.
WHEN 'NTRLEASED'.
MOVE-CORRESPONDING <ls_sel> TO lr_not_released_line.
APPEND lr_not_released_line TO lr_not_released.
WHEN 'PRTGRPTYP'.
MOVE-CORRESPONDING <ls_sel> TO lr_partgrptyp_line.
APPEND lr_partgrptyp_line TO lr_partgrptyp.
WHEN 'BP_HEADER'.
MOVE-CORRESPONDING <ls_sel> TO lr_partner_line.
APPEND lr_partner_line TO lr_partner.
WHEN 'PREFIX1_B'.
MOVE-CORRESPONDING <ls_sel> TO lr_prefix1_line.
APPEND lr_prefix1_line TO lr_prefix1.
WHEN 'PREFIX2_B'.
MOVE-CORRESPONDING <ls_sel> TO lr_prefix2_line.
APPEND lr_prefix2_line TO lr_prefix2.
WHEN 'PRINT_MOD'.
MOVE-CORRESPONDING <ls_sel> TO lr_print_mode_line.
APPEND lr_print_mode_line TO lr_print_mode.
WHEN 'SOURCE'.
MOVE-CORRESPONDING <ls_sel> TO lr_source_line.
APPEND lr_source_line TO lr_source.
WHEN 'TITLE_BP'.
MOVE-CORRESPONDING <ls_sel> TO lr_title_line.
APPEND lr_title_line TO lr_title.
WHEN 'TTLE_ACA1'.
MOVE-CORRESPONDING <ls_sel> TO lr_title_aca1_line.
APPEND lr_title_aca1_line TO lr_title_aca1.
WHEN 'TTLE_ACA2'.
MOVE-CORRESPONDING <ls_sel> TO lr_title_aca2_line.
APPEND lr_title_aca2_line TO lr_title_aca2.

57
WHEN 'TITLE_LET'.
MOVE-CORRESPONDING <ls_sel> TO lr_title_let_line.
APPEND lr_title_let_line TO lr_title_let.
WHEN 'TTLE_ROYL'.
MOVE-CORRESPONDING <ls_sel> TO lr_title_royl_line.
APPEND lr_title_royl_line TO lr_title_royl.
WHEN 'XBLCK'.
MOVE-CORRESPONDING <ls_sel> TO lr_xblck_line.
APPEND lr_xblck_line TO lr_xblck.
WHEN 'XDELE'.
MOVE-CORRESPONDING <ls_sel> TO lr_xdele_line.
APPEND lr_xdele_line TO lr_xdele.
WHEN 'GENDER'.
CASE <ls_sel>-option.
WHEN 'EQ' OR 'LE' OR 'NE' OR 'GT' OR 'LT'.
CASE <ls_sel>-low.
WHEN '1'.
MOVE-CORRESPONDING <ls_sel> TO lr_xsexf_line.
lr_xsexf_line-low = abap_true.
APPEND lr_xsexf_line TO lr_xsexf.
WHEN '2'.
MOVE-CORRESPONDING <ls_sel> TO lr_xsexm_line.
lr_xsexm_line-low = abap_true.
APPEND lr_xsexm_line TO lr_xsexm.
WHEN OTHERS.
ENDCASE.
WHEN 'BT' OR 'CP' OR 'NB' OR 'NP'.
ef_not_supported = abap_true.
WHEN OTHERS.
ef_not_supported = abap_true.
ENDCASE.
WHEN 'ZZLOB'. "CUSTOM ATTRIBUTE
MOVE-CORRESPONDING <ls_sel> TO lr_zzlob_line.
APPEND lr_zzlob_line TO lr_zzlob.
WHEN 'ZZSTAGE'. "CUSTOM ATTRIBUTE
MOVE-CORRESPONDING <ls_sel> TO lr_zz1_zext_wkf1_bus_line.
APPEND lr_zz1_zext_wkf1_bus_line TO lr_zz1_zext_wkf1_bus.
WHEN OTHERS.
"there a selection criterion that is not supported
ef_not_supported = abap_true.
me->mv_prev_query_not_supported = ef_not_supported.
RETURN.
ENDCASE.
ENDLOOP.

"select the data


CLEAR lt_but000.
SELECT * FROM but000 INTO CORRESPONDING FIELDS OF TABLE lt_but000
WHERE augrp IN lr_augrp
AND birthdt IN lr_birthdt
AND birthdt_status IN lr_birthdt_status
AND birthpl IN lr_birthpl
AND bpext IN lr_bpext
AND bpkind IN lr_bpkind
AND bu_langu IN lr_bu_langu
AND bu_sort1 IN lr_bu_sort1
AND bu_sort2 IN lr_bu_sort2

58
AND cndsc IN lr_cndsc
AND contact IN lr_contact
AND deathdt IN lr_deathdt
AND emplo IN lr_emplo
AND found_dat IN lr_found_dat
AND initials IN lr_initials
AND jobgr IN lr_jobgr
AND langu_corr IN lr_langu_corr
AND legal_enty IN lr_legal_enty
AND legal_org IN lr_legal_org
AND liquid_dat IN lr_liquid_dat
AND location_1 IN lr_location_1
AND location_2 IN lr_location_2
AND location_3 IN lr_location_2
AND marst IN lr_marst
AND mc_name1 IN lr_mc_name1
AND mc_name2 IN lr_mc_name2
AND namcountry IN lr_namcountry
AND nameformat IN lr_nameformat
AND namemiddle IN lr_namemiddle
AND name_first IN lr_name_first
AND name_grp1 IN lr_name_grp1
AND name_grp2 IN lr_name_grp2
AND name_last IN lr_name_last
AND name_last2 IN lr_name_last2
AND name_lst2 IN lr_name_lst2
AND name_org1 IN lr_name_org1
AND name_org2 IN lr_name_org2
AND name_org3 IN lr_name_org3
AND name_org4 IN lr_name_org4
AND name1_text IN lr_name1_text
AND natio IN lr_natio
AND natpers IN lr_natpers
AND nickname IN lr_nickname
AND not_released IN lr_not_released
AND partgrptyp IN lr_partgrptyp
AND partner IN lr_partner
AND prefix1 IN lr_prefix1
AND prefix2 IN lr_prefix2
AND print_mode IN lr_print_mode
AND source IN lr_source
AND title IN lr_title
AND title_aca1 IN lr_title_aca1
AND title_aca2 IN lr_title_aca2
AND title_let IN lr_title_let
AND title_royl IN lr_title_royl
AND xblck IN lr_xblck
AND xdele IN lr_xdele
AND xsexf IN lr_xsexf
AND xsexm IN lr_xsexm
AND zzlob IN lr_zzlob "CUSTOM ATTRIBUTE
AND zz1_zext_wkf1_bus IN lr_zz1_zext_wkf1_bus. "CUSTOM ATTRIBUTE
IF lt_but000 IS INITIAL.
RETURN.
ENDIF.

"map selected data to the result table

59
CREATE DATA lr_data LIKE LINE OF et_data.
IF lr_data IS BOUND.
ASSIGN lr_data->* TO <ls_data>.
ENDIF.
IF <ls_data> IS NOT ASSIGNED.
RETURN.
ENDIF.
CLEAR lt_value.
LOOP AT lt_but000 ASSIGNING <ls_but000>.
"type-casted mapping
gs_mapper-direction = gc_mapper_direction-query.
gs_mapper-entity = if_mdg_bp_constants=>gc_bp_model_entity-central.
gs_mapper-table = if_mdg_bp_constants=>gc_bp_table-bp.
go_mapper->map(
EXPORTING is_source_structure = <ls_but000>
CHANGING cs_target_structure = <ls_data> ).
CLEAR gs_mapper.
"special handling for the gender
ASSIGN COMPONENT 'GENDER' OF STRUCTURE <ls_data> TO <lv_value>.
IF sy-subrc = 0.
IF <ls_but000>-xsexf = abap_true AND <ls_but000>-xsexm = abap_false.
<lv_value> = '1'.
ELSEIF <ls_but000>-xsexf = abap_false AND <ls_but000>-
xsexm = abap_true.
<lv_value> = '2'.
ELSE.
CLEAR <lv_value>.
ENDIF.
ENDIF.
"collect mapped data
INSERT <ls_data> INTO TABLE et_data.
lv_value = <ls_but000>-partner.
INSERT lv_value INTO TABLE lt_value.
ENDLOOP.

"filter the result


me->filter_query_result(
EXPORTING it_value = lt_value
CHANGING ct_data = et_data ).

WHEN OTHERS.
"means the query is not handled by this class, but maybe other handlers
CLEAR ef_handled.
ENDCASE.

IF lt_value IS NOT INITIAL AND et_data IS NOT INITIAL.


me->filter_query_result(
EXPORTING it_value = lt_value
CHANGING ct_data = et_data ).
ENDIF.

IF ef_handled = abap_true.
me->mv_prev_query_not_supported = ef_not_supported.
ENDIF.
ENDMETHOD.

60
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.

61

You might also like