MDG Data Model Doc
MDG Data Model Doc
Applicable Releases:
From EhP6 for SAP ERP 6.0 and from S/4HANA 1511
Version 3.0
August 2022
Document History
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.
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:
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.
Add field
( reuse )
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).
SMT Mappings
1
MDG staging ↔ Business Partner
2
MDG staging ↔ Vendor / Customer
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.
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.
SMT Mappings
1
MDG staging ↔ Business Partner
2
MDG staging ↔ Vendor / Customer
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.
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.
8
2 Start Customizing for Master Data
Governance (transaction MDGIMG).
5 Choose Attributes.
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.
10
10 Verify that the generated table
contains the added field
/1MD/BPZZLOB and
/1MD/BPZZSTAGE.
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.
11
3 Select the row with BP Data Model.
Remember the development
package.
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.
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
Enter BP_BP_CENTRL_2API.
13
4 Select the first mapping step as
shown.
14
7 Choose the Add pushbutton
above the Field Mapping table.
15
9 Select the Transformations tab.
16
12 Save the changes.
Enter
MDG_BS_BP_MAP_2STA. You
have opened the mapping of
BP general data from the
service API to the MDG staging
area.
17
15 Choose the Add pushbutton
above the Field Mapping table.
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.
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.
20
entity BP_CENTRL. Save your
changes.
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.
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.
23
7 Check the Search
Customers UI for
Search Method:
Customer Search
(HANA).
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.
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.
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.
27
4 Double-click entity types.
Select entity BP_VENGEN.
5 Double-click Attributes.
28
7. Activate the changes.
29
10. Verify that the generated table
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.
30
2 Start Customizing for Master Data
Governance (transaction MDGIMG).
Select General Settings -> Data
Modeling -> Generate Data Model-
Specific Structures.
31
4 In the following steps you will verify that
your field extension was successfully
added to the Customer Include of the
mapping structure.
Display structure
/MDGBPX/_S_BP_PP_BP_VENGEN by
entering the details as shown.
32
1 Log into system for cross-client
maintenances.
Enter SUPPL_BP_VENGEN_2API.
33
4 Select the Transformations tab.
34
6 Select Mapping
SUPPL_BP_VENGEN_2API.
35
8 Choose the Save pushbutton.
Enter SUPPL_BP_VENGEN_2STA.
36
10 Select mapping structure
MDG_BS_SUPPL_BP_VENGEN.
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.
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.
40
2 Start transaction SE11.
Open structure
ZMDG_SUPPLIER_EHP6_TEST_S
UPL1.
41
5 Verify that the appended field
appears in structure
VMDS_EI_VMD_CENTRAL_DATA_
XFLAG.
42
7 Verify that the appended field
appears in structure LFA1.
Enter
CVI_CUSTOM_MAPPER and
choose the Display
pushbutton.
43
3 Double-click
Implementations.
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.
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:
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.
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
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
FPM Blog:
https://blogs.sap.com/2021/03/02/how-to-create-enhance-and-adapt-floorplan-manager-applications-for-
sap_ui-7.55/
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.
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.
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.
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.
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.
WHEN OTHERS.
"means the query is not handled by this class, but maybe other handlers
CLEAR ef_handled.
ENDCASE.
IF ef_handled = abap_true.
me->mv_prev_query_not_supported = ef_not_supported.
ENDIF.
ENDMETHOD.
60
www.sap.com/contactsap
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