Data Model by New Fields in SAP MDG by Michael Theis PDF
Data Model by New Fields in SAP MDG by Michael Theis PDF
Applicable Releases:
All
Version 1.5
October 2022
Document History
3
1. BUSINESS SCENARIO
SAP Master Data Governance for Financials (MDG-F) provides business processes to find, create, change, and mark
financial master data for deletion. It supports the governance of financial master data in a central hub and the
distribution to connected operational and business intelligence systems.
The processes are workflow-driven and can include several approval and revision phases, and the collaboration of all
users participating in the master data maintenance.
This How to Guide describes the solution to extend an existing entity type with storage and use type 1 with some new
fields. It covers the key concepts and implementation details in general and includes a real-life example of the MDG-F
data model 0G.
4
2. SAP NOTES AND LINKS
In addition to the detailed explanations written in this document, please see the following SAP Notes and
links for further important information:
5
3. BACKGROUND INFORMATION
MDG offers a domain specific solution for financial governance (MDG-F). The current MDG-F data model is called 0G.
It covers entity types of the accounting, controlling and consolidation components of financial master data as indicated
by the examples below:
In SAP ECC systems a Cost Center can be used for Joint Venture Accounting. Joint venture accounting has been an
add-on to SAP ECC before SAP ECC 6.0. Starting with SAP ECC 6.0 it is a built-in feature that needs activation via
business function(s). It adds some field to the SAP ECC cost center master data:
• Joint Venture
• Recovery Indicator
• Equity Type
• Joint Venture Object Type
• JIB/JIBE Class & Subclass A
The fields cannot be pre-defined by SAP within MDG-F data model 0G. They are valid only if both the MDG-F and Joint
Venture Accounting business functions are active.
In S/4 HANA, from release 1610 on, the business function for Joint Venture Accounting is already active (Always-On
business function).
The scenario assumes that you have activated Joint Venture Accounting in your system and now want to add the fields
to MDG-F, too.
6
4. STEP BY STEP EXPLANATION
The implementation consists of several steps. The list below relates to the planned scenario of the current how-to
guide. It may differ for your use case.
1. Preparation of the extension by collecting all required information about the fields to be added from the source
system.
a. Analyze the field attributes in the source system. Ask the following questions:
i. Which data element is used?
ii. Does the field use a check table?
iii. If yes, how is the table structured (single or multiple key fields)?
b. Translate the field attributes into the MDG-F specific format. Decide whether the field be modeled as
an attribute or whether a relation (e.g. entity type with SU Type 3) needed.
c. Identify further development items according to the source system. Ask the following questions:
i. How are the fields represented in the backend user interface?
ii. Are the fields already part of data replication technologies or is an extension required?
2. Extension of the MDG-F data model 0G.
a. Add attributes and/or relations.
b. Activate the data model and generate the model-specific structures.
3. Extension of the User Interface.
a. Add new fields to an existing UIBB or a new UIBB (optional).
4. Validation (optional).
a. Implement new checks in USMD_RULE_SERVICE.
5. Replication (optional).
a. Replicate using ALE IDocs or SOA Services.
Joint Venture VNAME JV_NAME T8JV Check table uses the company code as
CHAR (6) foreign key.
Recovery RECID JV_RECIND T8JJ Check table uses the company code as
Indicator CHAR (2) foreign key.
Equity Type ETYPE JV_ETYPE T8JG Check tables uses the company code and
CHAR (3) joint venture as foreign keys. Further key
component is a valid from date
Joint Venture JV_OTYPE JV_OTYPE - -
Object Type CHAR (4)
JIB/JIBE Class JV_JIBCL JV_JIBCL T8J6A Check table uses the company code as
CHAR (3) foreign key.
JIB/JIBE JV_JIBSA JV_JIBSA T8J6C Check table uses the company code and
Subclass A CHAR (4) the JIB/JIBE Class as foreign keys.
7
4.1.2. Translate the Field Attributes into the MDG-F Specific Format
Fields Joint Venture, Recovery Indicator, Equity Type and the JIB/JIBE classes all have a check table using the
company code and, in some cases, further fields as foreign keys. You cannot model these fields as simple attributes
within the MDG data model. You must use entity type with SU Type 3 and relations instead.
Field Joint Venture Object Type has no check table. You can model this field as a simple attribute within the MDG data
model.
Decide whether the fields are relevant for data transfer scenarios, or not.
You are now using the MDG data modeling workbench. Each of the following steps must be performed using the
workbench for data model 0G.
Add field Joint Venture Object Type as a simple attribute to the Cost Center entity type in the MDG data model.
8
1. In the MDG data modeling workbench mark data model 0G and double click Entity Types in the tree menu on
the left.
2. Locate and select entity type CCTR (Cost Center).
3. Double click Attributes in the tree menu on the left.
4. Click the New Entries (F5) button.
You have successfully added the new field Joint Venture Object Type as a simple attribute to the Cost Center in data
model 0G.
4.2.3. Add fields using entity types with SU Type 3 and relations
Entity types with SU Type 3 are usable for “complex” fields. These fields have a check table that consists of multiple
key fields using foreign keys. The actual key depends on other fields (which might have to be added as entity types
with SU Type 3 to the data model, too). Relations are required to link the entities with each other.
Add fields Joint Venture, Recovery Indicator, Equity Type and the JIB/JIBE classes as entity types with SU Type 3. Use
relation to link the entities with their foreign keys as well as the cost center.
1. In the MDG data modeling workbench mark data model 0G and double click Entity Types in the tree menu on
the left.
2. Choose button New Entries (F5) to create new entity types for each field to be added. Define the following
values for field Joint Venture:
Entity Type ZVNAME Re-use the field’s name. If you add an SAP field, use the
customer namespace.
Storage / Use Not Changeable via MDG; This defines a entity types with SU Type 3 type that is
Type No Generated Tables used for foreign key relations in check tables.
Data Element JV_NAME Re-use the data element of the field to be added.
Hierarchies No Hierarchy Not supported for entity types with SU Type 3.
Validity / Hierarchy is not Edition Not supported for entity types with SU Type 3.
Hierarchy Dependent
Key Assignment Key Cannot Be Changed; No Not supported for entity types with SU Type 3.
Internal Key Assignment
Description Joint Venture Re-use the field’s description
Others Space It is not recommended to maintain other attributes for
Entity types with SU Type 3.
9
a. Recovery Indicator
b. Equity Type
c. JIB/JIBE Class
d. JIB/JIBE Subclass A
4. You have added the new fields as entity types with SU Type 3.
5. Optional: relations for foreign keys require that the actual foreign key field exists in the data model.
a. Check if all foreign key fields exist.
b. If fields are missing, add the same as entity types with SU Type 3 by repeating step 2 for the foreign
key.
c. The Joint Venture Accounting scenario uses the company code as a foreign key. The company code is
already part of the data model 0G. It is represented by the COMPCODE entity type (SU Type 3).
6. Switch to the Relationships view of the MDG data modeling workbench.
7. Choose the New Entries (F5) button to create new relations for foreign keys. Define the following values for the
relation from the Company Code to the Joint Venture:
From-Entity Type COMPCODE Defines the entity type for the foreign key field.
Relationship ZCCVNAME Define a name for your relationship (CHAR 9)
To-Entity Type ZVNAME Define the entity type with SU Type 3 representing your new
field.
Relation. Type Leading The foreing key “leads” the relation to your new field.
Cardinality 1:N The same foreign key may “lead” multiple relations (e.g.
company code 0001 can lead multiple joint ventures).
No Existence Space The generic existence check provided by the MDG framework is
Check mandatory for leading relations
Description Company Codes You can maintain any description.
for Joint Ventures
Others Space It is not recommended to maintain other attributes for relations.
From-Entity Type ZVNAME Defines the entity type for the new field.
10
Attri but e Val u e Exp l an ati on
4.2.4. Activate the data model and generate the model-specific structures
As soon as you have added all fields to the data model, you must activate the same. The activation of the data model
usually triggers the re-generation of the model-specific structures automatically. Nevertheless, the following steps
describe what needs to be done if the automated re-generation does not happen.
1. Switch back to the Inactive Data Models view of the MDG data modeling workbench.
2. Mark data model 0G and choose the Check (Ctrl+Shift+F1) button. The activation of the data model only works if
there are no error messages.
3. Choose the Activate (Ctrl+Shift+F3) button. The activation may take some time.
4. If the activation issues the message “Change requests must be adjusted because data model 0G has been
modified (USMD1B040)”, confirm the message choose the button Adjust Staging Area of Linked Change
Requests (Ctrl+F12).
5. If a pop-up “Possible loss of Data – Was the mapping between the reuse active area and the data model
adjusted?” is issued by the system, confirm by clicking Yes.
6. You have successfully enhanced the data model 0G.
7. To check if everything worked fine, the following steps are recommended.
8. Choose button Visualize Data Model (Ctrl+Shift+F6).
9. Choose button Active Version (Ctrl+F2).
10. Locate your enhanced entity type (CCTR) and check that your fields are visible.
11. Start transaction SE80 for package /MDG/FIN_MDGF_STRUCTURES.
12. Locate the generated structures for your enhanced entity type, e.g. structure /MDG/_S_0G_PP_CCTR named
Source Structure for PP Mapping of the Cost Center.
13. Check that your fields are visible within the custom include of the structure. The custom include’s name starts
with CI_MDG_S_*.
14. If your fields are not visible within the custom include, re-generate the structures.
15. Start transaction MDGIMG.
16. In the MDGIMG menu tree navigate to General Settings → Data Modeling → Generate Data Model-Specific
Structures.
17. Mark data model 0G and double click Structures in the tree menu on the left.
11
18. Mark all entries of your enhanced entity type (in our scenario CCTR) and choose button Generate Selected
Structures (Ctrl+Shift+F3). The structure generation may take some time.
19. Repeat the visibility check as described in steps 8 to 10.
20. You have re-generated the data mode-specific structures.
Adjustments of the data model are not required. Your enhancements of the data model are still valid and re-used within
the new user interfaces. Nevertheless, it is mandatory that the data model-specific structures are generated at least
once within MDG-F 7.0 (usually this has already been done as a recommended step during the general upgrade
process from older MDG-F releases to MDG-F 7.0).
4.3.2. Adding new fields to an existing UIBB vs. creating a new UIBB for the new fields
You can either add new fields to the user interface either by adding them to existing SAP-defined UIBBs or to new
custom UIBBs. There is no general recommendation for the one or the other possibility. The required effort is
comparable. The following questions might help to find a decision:
• How many fields are you adding? If you are only adding one or two fields, it is easier to add them to an existing
• Do the fields require a custom feeder class? Such a feeder class may be necessary for complex search helps or
specific field handling. If you need a custom feeder class, it could make sense to use a custom UIBB too.
However, it is also possible to maintain a custom feeder class for an SAP-defined UIBB.
• How do you want the final user interface to look?
The how-to guide describes the required steps for both approaches. In your implementation, choose only one. Adding
the fields twice to the same user interface does not make any sense. SAP development would use a custom, specific
UIBB for the Joint Venture scenario.
• If a new field is a simple text field a custom feeder class is not required.
• If a new field uses a check table with a single key field only, a custom feeder class is not required.
12
• Following the Joint Venture Accounting scenario field Joint Venture Object Type does not require a custom
feeder class. It can re-use the existing functionality of the cost center feeder class CL_MDGF_GUIBB_CCTR.
Since the other fields require a complex search help due to the dependency on the company code, the
implementation of a custom feeder class is required.
To simplify the implementation of custom feeder classes, SAP provides some generic feeder classes for MDG-F. You
should make yourself familiar with their supported functionality before creating your own feeder.
It is strongly recommended that your custom feeder class inherits from one of the mentioned classes depending on the
related UIBBs type.
The following steps are required for the creation of a custom feeder class.
1. Start transaction SE80 and navigate to the package that shall contain the new class.
2. Create class ZCL_MDGF_GUIBB_CCTR_JVA using the description Form Feeder for MDGF Cost Center – Joint
Venture Accounting. It’s a usual ABAP class with public instantiation. It should not be final.
3. Switch to tab Properties and choose button Superclass to define the class inheritance.
a. Since the fields must be included in a form UIBB, one option for inheritance is the generic form feeder
class CL_MDGF_GUIBB_FORM.
b. The Joint Venture Accounting scenario uses class CL_MDGF_GUIBB_CCTR instead! The cost
center’s feeder class already implements some logic that is re-usable for the Joint Venture Accounting,
too (e.g. the determination of the currently selected company code and its storage in class attribute
MV_COMPANY_CODE).
13
4. Activate the custom feeder class.
You have created a custom feeder class that is usable for a form UIBB. Re-definitions and or new methods are
implemented in a later point in time.
The Joint Venture Account scenario needs transient field for the input fields Joint Venture, Recovery Indicator, Equity
Type, and JIB/JIBE classes.
You have enhanced the field catalog with transient text fields.
3. Replace the pre-defined SAP feeder class with the previously created custom feeder class.
14
a. Choose button Feeder Class on the General Settings tray (you might have to expand the tray to see
the button).
b. Enter Feeder Class ZCL_MDGF_GUIBB_CCTR_JVA and choose button Edit Parameters.
c. Confirm the pop-up Confirm changed feeder class with Yes. A data loss cannot happen since the
custom feeder class inherits from the cost center feeder class that we have just replaced.
d. Confirm the pop-up Edit Parameters with OK. The editor re-uses the previously defined parameters.
Changing them not required.
e. Save your changes.
4. Add a new group for the Joint Venture Accounting fields.
a. Groups can be added in various ways. It is possible to use the trays Preview and Form UIBB Schema.
i. On the Preview tray mark any empty line below the existing group for Lock Indicators choose
button Add Group (Ctrl+G).
ii. On the Form UIBB Schema tray choose button Add Element and choose Add Group.
b. Use the Attributes of Group frame to define the Group Header as Joint Venture Accounting.
c. Save your changes.
5. Add the fields to the group.
a. Fields can be added in various ways using the Form UIBB Schema.
i. Use Navigation & Repositories to select fields (you might have to enable the frame by
choosing the related button in the top menu bar). Drag and drop selected fields into the group.
ii. On the Form UIBB Schema tray select the group, choose button Add Element and choose Add
Element on Next Level. Select the fields to be added from the resulting pop-up.
15
b. Adjust the layout of the group as well as the field attributes.
i. Selecting each field and use the Attributes of Element frame.
ii. Ensure that common input fields always use FPM_REFRESH as FPM Event ID for onEnter.
c. Save your changes.
You have added the fields to your user interface. The screenshot below shows a possible result.
16
8. Enter any description for your customizing and choose the OK button.
17
b. Image Source = ~Icon/Edit
c. FPM Event ID = FPM_LOCAL_EDIT (use the F4 Help for selection)
d. Save your changes.
14. The edit button is available.
15. Finally, it is required to add the UIBB into the OVP’s wire schema. Otherwise the UIBB would remain read-only
all the time.
16. Switch to tab Wire Schema.
17. Choose the Add Wire button.
The custom UIBB for Joint Venture Accounting is added to the OVP. If you start the cost center user interface the UIBB
is visible. You might notice that some fields do not yet offer a value help. This implementation is realized by the next
step.
1. Redefine method IF_FPM_GUIBB_FORM~GET_DEFINITION to add the feeder class as OVS search help
implementation for the fields.
a. Inherit from the parent implementation.
b. Change the field attributes for the above-mentioned fields.
i. Add the current class as OVS implementation.
ii. Allow the deletion (clearance) of the field values.
c. The source code is available in the appendix.
2. Create method OVS_OUTPUT_ZCTRVNAME to implement the search for the Joint Venture.
a. Use a protected instance method with the description OVS Search: Joint Venture.
b. Define the following parameters:
i. Importing IR_QUERY_PARAMETER type ref to DATA as “User Input to be searched for”.
ii. Importing IV_FIELD_NAME type NAME_KOMP as “Field triggering the OVS”.
iii. Exporting ER_OUTPUT type ref to DATA as “Search Result”.
c. Prepare the result reference.
i. You can use the generic type usmdz10_ts_ovs_output.
ii. This type displays a simple table of name-value pairs.
d. Check that the class attribute for the company code contains a value.
i. The company code is mandatory for the selection of values.
ii. If no company code is defined yet, show an appropriate error message and skip the search.
18
e. Select the values from the customizing table(s).
f. Handle the result.
i. Map the selected values into the result reference.
ii. Filter the selected values according to the user’s search input.
iii. …
g. The source code is available in the appendix.
3. Repeat step 2 for the fields listed below accordingly.
a. Method OVS_OUTPUT_ZCTRJIBCL for the JIB/JIBE Class.
b. Method OVS_OUTPUT_ZCTRRECID for the Recovery Indicator.
4. Field Equity Type requires a more complex OVS since the field relates to both the company code and the actual
joint venture. The example shows the power of OVS. It implements the following use cases:
a. If the Joint Venture is not yet defined, the search displays all valid combinations of joint ventures and
equity types. Selecting a single result sets both values in the user interface.
b. If the Joint Venture is already defined, the search displays only those equity types that are defined for
the current joint venture.
c. Define each a protected structure and table type for the OVS as class types.
i. TY_S_OVS_ZCTRETYPE as “OVS Structure for Equity Types”
TYPES:
BEGIN OF ty_s_ovs_zctretype,
vname TYPE jv_name,
vname_txt TYPE usmdz10_description,
etype TYPE jv_etype,
etype_txt TYPE usmdz10_description,
END OF ty_s_ovs_zctretype .
ii. TY_TS_OVS_ZCTRETYPE as “OVS sorted table type for Equity Types”
TYPES:
ty_ts_ovs_zctretype TYPE SORTED TABLE OF ty_s_ovs_zctretype
WITH UNIQUE KEY vname etype .
d. Define a protected instance class attribute MV_JOINT_VENTURE of type JV_NAME as “Current Joint
Venture”.
e. Redefine method IF_FPM_GUIBB_OVS~HANDLE_PHASE_1 to check the current value of the joint
venture.
i. If a value is set, buffer it in MV_JOINT_VENTURE. Call the parent for further processing.
ii. If no value is set, clear buffer MV_JOINT_VENTURE. Define the input structure for the OVS
search using structure type TY_S_OVS_ZCTRETYPE.
iii. The source code is available in the appendix.
f. Create method OVS_OUTPUT_ZCTRETYPE to implement the search for the Equity type.
i. Use a protected instance method with the description OVS Search: Equity Types.
ii. Define the following parameters:
1. Importing IR_QUERY_PARAMETER type ref to DATA as “User Input to be searched
for”.
2. Importing IV_FIELD_NAME type NAME_KOMP as “Field triggering the OVS”.
3. Exporting ER_OUTPUT type ref to DATA as “Search Result”.
iii. Prepare the result reference according to the current joint venture.
1. If a joint venture is defined, use the generic type usmdz10_ts_ovs_output.
2. If no joint venture is defined, use the previously created type
TY_TS_OVS_ZCTRETYPE.
iv. Check that the class attribute for the company code contains a value.
1. The company code is mandatory for the selection of values.
2. If no company code is defined yet, show an appropriate error message and skip the
search.
v. Select the values from the customizing table.
1. If a joint venture is defined, select all equity types belonging to the joint venture.
19
2. If no joint venture is defined, select all combinations of joint ventures and equity types.
vi. Map the selected values into the result reference.
vii. The source code is available in the appendix.
g. Redefine method OVS_HANDLE_PHASE_3 to transfer the user’s selection of the complex OVS
search help to the related fields in the user interface.
i. If a joint venture is defined, the user has selected the equity type only.
ii. If a joint venture is not defined, the user has selected both the joint venture and an equity type.
iii. The source code is available in the appendix.
5. Implement the OVS for field JIB/JIBE Subclass A in a similar way as done for field Equity Type .
a. Define each a protected structure and table type for the OVS as class types.
i. TY_S_OVS_ZCTRJIBSA as “OVS Structure for Subclasses A”
TYPES:
BEGIN OF ty_s_ovs_zctrjibsa,
jibcl TYPE jv_jibcl,
jibcl_txt TYPE usmdz10_description,
jibsa TYPE jv_jibsa,
jibsa_txt TYPE usmdz10_description,
END OF ty_s_ovs_zctrjibsa .
ii. TY_TS_OVS_ZCTRJIBSA as “OVS sorted table type for Subclasses A”
TYPES:
ty_ts_ovs_zctrjibsa TYPE SORTED TABLE OF ty_s_ovs_zctrjibsa
WITH UNIQUE KEY jibcl jibsa .
b. Define a protected instance class attribute MV_CLASS of type JV_JIBCL as “Current Class”.
c. The source code is available in the appendix.
6. Redefine method OVS_HANDLE_PHASE_2 to call the previously created methods if an OVS search is triggered
for the related fields.
a. Implement a case statement on the field name.
b. Dispatch the Joint Venture Accounting fields to their specific methods.
c. Call the parent class for all other fields.
d. The source code is available in the appendix.
e. Save and activate your implementation.
The OVS is implemented and working for the Joint Venture Accounting fields.
4.3.8. Optional: Implement the text retrieval for transient text fields in the feeder class
If you have added the transient description fields to your user interface, some coding is required to provide the related
description.
1. Redefine method GET_ENTITY_DATA to fill the descriptions into the transient fields.
a. Since all fields require the company code, check if it is already defined. If not, skip processing.
b. Determine the descriptions according to the given key values.
20
5. REMARKS ON DATA TRANSFER
Data transfer in MDG is separated into the following phases:
1. The Initial Load of master data from client system to the MDG system.
2. The Data Replication of master data from the MDG system to its client system
MDG-F provides standard content for both. Unfortunately, this content cannot cover custom fields. If your
enhancements are part of data transfer, additional steps are required to ensure a fully working scenario. These steps
strongly depend on the actual data transfer technology that you are using for your system landscape.
Note that this is not always the case for other entity types in MDG-F. Some extract only a limited set of fields. In that
case, you must enhance the selection criteria of MDMGX (refer to the related how-to guide for further details).
The import of the extracted XML file into the MDG system using the Data Import Framework (DIF) does not cover any
custom enhancements. The following steps are required to enhance the functionality:
21
12. Mark the object type that you have enhanced (e.g. CCTR Cost Center) and double-click on node Detailed
Information for Object Types.
13. Replace the entry in column Transformations with your custom transformation (e.g. MDG_COST_CENTER
with ZMDG_COST_CENTER).
14. Save your changes.
Joint Venture fields are not part of the cost center SOA service CostCentreReplicationBulkRequest. If the SOA Service
is used for data replication, you are required to extend the SOA Service is for both the MDG-F outbound and for the
SAP ECC inbound.
Other custom fields always require the extension of the desired data replication technology.
22
6. APPENDIX – SOURCE CODE OF ZCL_MDGF_GUIBB_CCTR_JVA
* attributes:
DATA:
FIELD-SYMBOLS:
"Inherit the field catlog of the cost center. The catalog already
super->create_struct_rtti( ).
lt_components = me->mo_struct_rtti->get_components( ).
"Add the transient text fields one after the other as defined above.
<ls_component>-type = cl_abap_elemdescr=>get_string( ).
<ls_component>-type = cl_abap_elemdescr=>get_string( ).
23
<ls_component>-name = |ZCTRJIBSA{ cl_usmd_generic_genil_text=>gv_text_suffix }|.
<ls_component>-type = cl_abap_elemdescr=>get_string( ).
<ls_component>-type = cl_abap_elemdescr=>get_string( ).
<ls_component>-type = cl_abap_elemdescr=>get_string( ).
ENDMETHOD.
*! This method is used to change the field definition for the Joint Venture
FIELD-SYMBOLS:
super->if_fpm_guibb_form~get_definition(
IMPORTING
es_message = es_message
eo_field_catalog = eo_field_catalog
et_field_description = et_field_description
24
et_action_definition = et_action_definition
et_special_groups = et_special_groups
ev_additional_error_info = ev_additional_error_info
et_dnd_definition = et_dnd_definition ).
"Change the fields to add the current feeder class as OVS implementation
CASE <ls_field_description>-name.
<ls_field_description>-ovs_name = me->mv_my_classname.
<ls_field_description>-is_nullable = abap_true.
WHEN OTHERS.
CONTINUE.
ENDCASE.
ENDLOOP.
ENDMETHOD.
*! This method is used to read the entity. It adds the texts for fields
DATA:
FIELD-SYMBOLS:
25
<lv_key> TYPE any,
"Inherit from the parent first. This set all key values.
super->get_entity_data(
EXPORTING
io_access = io_access
CHANGING
cs_data = cs_data ).
IF me->mv_company_code IS INITIAL.
RETURN.
ENDIF.
ASSIGN COMPONENT:
ENDIF.
26
ASSIGN COMPONENT:
ENDIF.
ASSIGN COMPONENT:
ENDIF.
ASSIGN COMPONENT:
27
IF <lv_key> IS ASSIGNED AND <lv_key> IS NOT INITIAL
lv_class = <lv_key>.
ENDIF.
ASSIGN COMPONENT:
ENDIF.
ENDIF.
ENDMETHOD.
28
* Using the parameter IO_OVS_CALLBACK it is possible to determine
* values entered by the user that might be helpful for the search. In
DATA:
"A redefinition of the common logic is only needed for a few fields.
CASE iv_field_name.
CLEAR me->mv_joint_venture.
io_ovs_callback->context_element->get_attribute(
EXPORTING
name = 'ZCTRVNAME'
IMPORTING
value = me->mv_joint_venture ).
IF me->mv_joint_venture IS INITIAL.
"The joint venture is not yet selected. The OVS shall allow
"equity types.
io_ovs_callback->context_element->get_attribute(
EXPORTING
name = 'ZCTRVNAME'
IMPORTING
value = ls_search_equity-etype ).
io_ovs_callback->set_input_structure(
29
EXPORTING
input = ls_search_equity
display_values_immediately = abap_true ).
ELSE.
super->if_fpm_guibb_ovs~handle_phase_1(
iv_field_name = iv_field_name
io_ovs_callback = io_ovs_callback ).
ENDIF.
CLEAR me->mv_class.
io_ovs_callback->context_element->get_attribute(
EXPORTING
name = 'ZCTRJIBCL'
IMPORTING
value = me->mv_class ).
IF me->mv_class IS INITIAL.
"The class is not yet selected. The OVS shall allow searching
io_ovs_callback->context_element->get_attribute(
EXPORTING
name = 'ZCTRJIBSA'
IMPORTING
value = ls_search_subclass-jibsa ).
io_ovs_callback->set_input_structure(
30
EXPORTING
input = ls_search_subclass
display_values_immediately = abap_true ).
ELSE.
super->if_fpm_guibb_ovs~handle_phase_1(
iv_field_name = iv_field_name
io_ovs_callback = io_ovs_callback ).
ENDIF.
WHEN OTHERS.
super->if_fpm_guibb_ovs~handle_phase_1(
iv_field_name = iv_field_name
io_ovs_callback = io_ovs_callback ).
ENDCASE.
ENDMETHOD.
* methods.
CASE iv_field_name.
me->ovs_output_zctretype(
EXPORTING
ir_query_parameter = ir_query_parameter
iv_field_name = iv_field_name
IMPORTING
er_output = er_output ).
31
WHEN 'ZCTRJIBCL'. "JIB/JIBE Class
me->ovs_output_zctrjibcl(
EXPORTING
ir_query_parameter = ir_query_parameter
iv_field_name = iv_field_name
IMPORTING
er_output = er_output ).
me->ovs_output_zctrjibsa(
EXPORTING
ir_query_parameter = ir_query_parameter
iv_field_name = iv_field_name
IMPORTING
er_output = er_output ).
me->ovs_output_zctrrecid(
EXPORTING
ir_query_parameter = ir_query_parameter
iv_field_name = iv_field_name
IMPORTING
er_output = er_output ).
me->ovs_output_zctrvname(
EXPORTING
ir_query_parameter = ir_query_parameter
iv_field_name = iv_field_name
IMPORTING
32
er_output = er_output ).
WHEN OTHERS.
super->ovs_handle_phase_2(
EXPORTING
iv_field_name = iv_field_name
ir_query_parameter = ir_query_parameter
io_access = io_access
IMPORTING
er_output = er_output
ev_table_header = ev_table_header
et_column_texts = et_column_texts ).
ENDCASE.
ENDMETHOD.
DATA:
FIELD-SYMBOLS:
33
"get selection
RETURN.
ENDIF.
IF iv_field_name EQ 'ZCTRETYPE'
lv_component_1 = 'VNAME'.
lv_component_2 = 'ETYPE'.
lv_fieldname = 'ZCTRVNAME'.
lv_component_1 = 'JIBCL'.
lv_component_2 = 'JIBSA'.
lv_fieldname = 'ZCTRJIBCL'.
ELSE.
super->ovs_handle_phase_3(
EXPORTING
iv_field_name = iv_field_name
ir_selection = ir_selection
IMPORTING
et_field_value = et_field_value
eo_fpm_event = eo_fpm_event ).
RETURN.
ENDIF.
34
"Map key to target field
CHECK sy-subrc EQ 0.
<ls_field_value>-name = lv_fieldname.
CHECK sy-subrc EQ 0.
CHECK sy-subrc EQ 0.
CHECK sy-subrc EQ 0.
CHECK sy-subrc EQ 0.
<ls_field_value>-name = iv_field_name.
CHECK sy-subrc EQ 0.
35
UNASSIGN: <ls_field_value>, <lv_value>.
CHECK sy-subrc EQ 0.
CHECK sy-subrc EQ 0.
ENDMETHOD.
*! This method implements the OVS search for the Equity Type. The data
DATA:
FIELD-SYMBOLS:
36
"Prepare the output table. The reference must be returned even if
"Common result
ELSE.
ENDIF.
IF me->mv_company_code IS INITIAL.
"Message: Enter a value for field company code and choose ENTER
lo_message_container->add_message(
iv_msg_type = sy-msgty
iv_msg_id = sy-msgid
iv_msg_number = sy-msgno
iv_show_only_once = abap_true ).
RETURN.
ENDIF.
37
WHERE bukrs = me->mv_company_code
CLEAR ls_t8jet.
<ls_output>-text = ls_t8jet-etext.
ENDIF.
ENDLOOP.
ELSE.
CLEAR ls_t8jvt.
ls_joint_venture-text = ls_t8jvt-vtext.
ENDIF.
38
"Get the Equity Types for the current Joint Venture
CLEAR lt_equity_types.
CLEAR ls_t8jet.
ls_equity_type-text = ls_t8jet-etext.
ENDIF.
CLEAR ls_combined.
ls_combined-vname = ls_joint_venture-key.
ls_combined-vname_txt = ls_joint_venture-text.
ls_combined-etype = ls_equity_type-key.
ls_combined-etype_txt = ls_equity_type-text.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDMETHOD.
39
6.1.8. Method OVS_OUTPUT_ZCTRJIBCL
METHOD ovs_output_zctrjibcl.
*! This method implements the OVS search for the JIB/JIBE Classes.
DATA:
FIELD-SYMBOLS:
IF me->mv_company_code IS INITIAL.
"Message: Enter a value for field company code and choose ENTER
lo_message_container->add_message(
iv_msg_type = sy-msgty
iv_msg_id = sy-msgid
iv_msg_number = sy-msgno
iv_show_only_once = abap_true ).
RETURN.
ENDIF.
40
"Select the values from the data base table
CLEAR ls_description.
<ls_output>-text = ls_description-ctext.
ENDIF.
ENDLOOP.
"Filter results
me->ovs_output_filter(
EXPORTING
iv_field_name = iv_field_name
ir_query_parameter = ir_query_parameter
CHANGING
cr_output = er_output ).
ENDMETHOD.
*! This method implements the OVS search for the JIB/JIBE Subclass A.
41
* the classes and subclasses. If a value is selected, only those
DATA:
FIELD-SYMBOLS:
"Common result
ELSE.
ENDIF.
IF me->mv_company_code IS INITIAL.
42
"Raise an error and return.
"Message: Enter a value for field company code and choose ENTER
lo_message_container->add_message(
iv_msg_type = sy-msgty
iv_msg_id = sy-msgid
iv_msg_number = sy-msgno
iv_show_only_once = abap_true ).
RETURN.
ENDIF.
CLEAR ls_t8j6d.
<ls_output>-text = ls_t8j6d-ctext.
ENDIF.
43
ENDLOOP.
ELSE.
CLEAR ls_t8j6b.
ls_class-text = ls_t8j6b-ctext.
ENDIF.
CLEAR lt_subclasses.
CLEAR ls_t8j6d.
44
AND bukrs = me->mv_company_code
ls_subclass-text = ls_t8j6d-ctext.
ENDIF.
CLEAR ls_combined.
ls_combined-jibcl = ls_class-key.
ls_combined-jibcl_txt = ls_class-text.
ls_combined-jibsa = ls_subclass-key.
ls_combined-jibsa_txt = ls_subclass-text.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDMETHOD.
*! This method implements the OVS search for the Recovery Indicator.
DATA:
FIELD-SYMBOLS:
45
ASSIGN er_output->* TO <lt_output>.
IF me->mv_company_code IS INITIAL.
"Message: Enter a value for field company code and choose ENTER
lo_message_container->add_message(
iv_msg_type = sy-msgty
iv_msg_id = sy-msgid
iv_msg_number = sy-msgno
iv_show_only_once = abap_true ).
RETURN.
ENDIF.
CLEAR ls_description.
<ls_output>-text = ls_description-ttext.
ENDIF.
46
ENDLOOP.
"Filter results
me->ovs_output_filter(
EXPORTING
iv_field_name = iv_field_name
ir_query_parameter = ir_query_parameter
CHANGING
cr_output = er_output ).
ENDMETHOD.
*! This method implements the OVS search for the Joint Venture.
DATA:
FIELD-SYMBOLS:
IF me->mv_company_code IS INITIAL.
"Message: Enter a value for field company code and choose ENTER
47
lo_message_container = cl_crm_bol_core=>get_instance( )->get_global_message_cont( ).
lo_message_container->add_message(
iv_msg_type = sy-msgty
iv_msg_id = sy-msgid
iv_msg_number = sy-msgno
iv_show_only_once = abap_true ).
RETURN.
ENDIF.
CLEAR ls_description.
<ls_output>-text = ls_description-vtext.
ENDIF.
ENDLOOP.
"Filter results
me->ovs_output_filter(
EXPORTING
iv_field_name = iv_field_name
ir_query_parameter = ir_query_parameter
48
CHANGING
cr_output = er_output ).
ENDMETHOD.
49
7. ADDITIONAL INFORMATION
Further Reading
Information on SAP MDG on SAP S/4HANA
• Exchange knowledge: SAP Community | Q&A | Blog
• Try SAP Master Data Governance on S/4HANA for free: Trial Version
• Learn more: Latest Release | Webinars | Help Portal | How-to Information | Key Presentations
Related Information
• Learn more: Floorplan Manager for Web Dynpro ABAP | How to Adapt FPM | FPM Blog | How-to
Information | Service Mapping Tool | SAP S/4HANA Cookbook CVI |
SAP Notes
In addition to the detailed explanations written in this document, please see the following SAP Notes for
further important information.
51
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 softwar e 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 p latform 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.