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

SAP How-To Guide - Extend The Search Result List For MDG For Business Partner

MDG DOC

Uploaded by

sap mm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
864 views

SAP How-To Guide - Extend The Search Result List For MDG For Business Partner

MDG DOC

Uploaded by

sap mm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

PUBLIC

How-To Extend the Search Result List for MDG


for Business Partner

Applicable Releases:
All

Version 2.0
January 2022
Document History

Document Version Description

1.0 First official release of this guide (December 2015)


2.0 Update Layout (January 2022)
1. BUSINESS SCENARIO ............................................................................................................................................................. 4
2. STEP BY STEP EXPLANATION ................................................................................................................................................. 5
2.1. CUSTOMIZING OF THE UI CONFIGURATION BS_BP_QUERY_RESULT ................................................................................ 5
2.2. CREATION OF WEB DYNPRO COMPONENT FOR DETAILED DATA DISPLAY ........................................................................ 7
2.2.1. NECESSARY DDIC OBJECTS ...................................................................................................................................... 7
2.2.2. Headline 3 WEB DYNPRO COMPONENT .................................................................................................................. 7
2.2.3. CREATION OF COMPONENT CONTROLLER CONTEXT ............................................................................................... 8
2.2.4. METHOD PROCESS_EVENT ..................................................................................................................................... 9
2.2.5. View MAIN........................................................................................................................................................... 10
Context Nodes ................................................................................................................................................................................... 10
UI Element Tables .............................................................................................................................................................................. 10
2.3. INTEGRATION OF WEB DYNPRO INTO THE SEARCH SECTION ........................................................................................................ 11
2.3.1. New UI Configuration YY_SEARCH_RESULT_DETAILS ............................................................................................ 11
2.4. PLACE THE NEW CONFIGURATION IN THE QUERY SECTION .......................................................................................................... 12
3. RESULT OF THE ENHANCEMENT ......................................................................................................................................... 13

3
1. BUSINESS SCENARIO
SAP Master Data Governance for Material (MDG-M) 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.

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 explains the extension of the MDG Business Partner / Customer / Supplier solution for the search
result list.

This given scenario is primarily an UI extension. It requires general knowledge about the SAP Floor Plan Manager
(FPM) and SAP Web Dynpro for ABAP.

In the search result list, only data related to the Business Partner will be displayed, for example, Partner ID, address
data and category.

Since there is not only the BP object, but also the customer and/or supplier in your company, you are probably
interested in further information such as

· Assigned customers and suppliers


· Company codes, sales organization and purchase organization data that are maintained for customers and
suppliers you are searching for

Fetching all of the potential data stated above simultaneously would have a negative effect on system performance.
Another challenge of providing this data is creating an overview to display the detailed data.

If your MDG system is running on HANA, the requirement stated above can be met by the HANA Drilldown Search,
which can be easily configured.

This How-To Guide provides an alternative approach for the implementation of a simple Drilldown Search. To keep this
guide simple, only related customer data will be displayed when selecting a record in the search result list.

4
2. STEP BY STEP EXPLANATION
The following explanation shows you how to :
· Customizing of the UI configuration BS_BP_QUERY_RESULT
· Development of a Web Dynpro component to query and display detailed data
· Integration of the developed Web Dynpro component into the initial screen BS_BP_DQUERY via UI customizing

2.1. CUSTOMIZING OF THE UI CONFIGURATION BS_BP_QUERY_RESULT


In this scenario, when selecting a line in the search result list, all assigned customers (represented by customer
number and further attributes) are to be displayed. Technically, when processing the event “Selection”, a specific FPM
event with the selected BP partner number has to be fired by the feeder class. This event will be caught and processed
by the component that is responsible for showing detailed information (see chapter 4.2.2.2.2).

The standard feeder class of the search result list is CL_BS_BP_QUERY_RESULT. It has to be re-implemented.

Figure 1: New Feeder Class YY_CL_BS_BP_QUERY_RESULT

The new feeder class is called YY_CL_BS_BP_QUERY_RESULT. The next step is the re-definition of the method
IF_FPM_GUIBB_LIST~PROCESS_EVENT. The detailed implementation is shown in “Implementation 1” below.
Once the implementation is active, the standard feeder class of the search result list UIBB BS_BP_QUERY_RESULT
must be replaced by the new one.

5
METHOD if_fpm_guibb_list~process_event.

CONSTANTS lc_event_id_bp_selected TYPE fpm_event_id VALUE 'BP_SELECTED'.

DATA lr_event TYPE REF TO cl_fpm_event.


DATA lr_iterator TYPE REF TO if_bol_entity_col_iterator.
DATA lr_bol_entity TYPE REF TO cl_crm_bol_entity.

FIELD-SYMBOLS <ls_data> TYPE any.


FIELD-SYMBOLS <lv_partner> TYPE any.

" Super Call...


CALL METHOD super->if_fpm_guibb_list~process_event
EXPORTING
io_event = io_event
iv_raised_by_own_ui = iv_raised_by_own_ui
iv_lead_index = iv_lead_index
iv_event_index = iv_event_index
it_selected_lines = it_selected_lines
io_ui_info = io_ui_info
IMPORTING
ev_result = ev_result
et_messages = et_messages.

" check if the right event has been raised


CHECK iv_lead_index >= 1
AND io_event->mv_event_id = 'FPM_GUIBB_LIST_ON_LEAD_SELECTI'.

" fetch the selected BP ID


ASSIGN mr_entity_data->* TO <ls_data>.
lr_iterator = mo_collection->get_iterator( ).
lr_bol_entity = lr_iterator->get_by_index( iv_lead_index ).
lr_bol_entity->get_properties(
IMPORTING
es_attributes = <ls_data> ).

ASSIGN COMPONENT 'PARTNER' OF STRUCTURE <ls_data> TO <lv_partner>.

CHECK sy-subrc = 0
AND <lv_partner> IS NOT INITIAL.

" fire event


CREATE OBJECT lr_event
EXPORTING
iv_event_id = lc_event_id_bp_selected.

lr_event->mo_event_data->set_value(
EXPORTING
iv_key = 'PARTNER'
iv_value = <lv_partner> ).

cl_fpm_factory=>get_instance( )->raise_event( io_event = lr_event ).

ENDMETHOD.
Implementation 1: Method IF_FPM_GUIBB_LIST~PROCESS_EVENT

6
2.2. CREATION OF WEB DYNPRO COMPONENT FOR DETAILED DATA DISPLAY

2.2.1. NECESSARY DDIC OBJECTS


Before creating a Web Dynpro component, you have to define which attributes of the general customer (KNA1) and
company code layer (KNB1) are to be shown.

KNA1
· Customer Number
· Customer Account Group
· Central Order Block
· Central Deletion Flag

Create new DDIC structure YSTR_RESULT_DETAILS_CUS.

Figure 2: Structure YSTR_RESULT_DETAILS_CUS

KNB1
· Company Code
· Reconciliation Account in General Ledger
· Deletion Flag for Master Record (Company Code Level)

Create new DDIC structure YSTR_RESULT_DETAILS_CUS_CC

Figure 3: YSTR_RESULT_DETAILS_CUS_CC

2.2.2. Headline 3 WEB DYNPRO COMPONENT


· Name: ZMDG_SEARCH_RSLT_DET_CUS
· Implemented interfaces:
o IF_FPM_TRANSACTION
o IF_FPM_UI_BUILDING_BLOCK
· View: MAIN
· Windows: W_DETAILS (embeds the view MAIN as default)

7
2.2.3. CREATION OF COMPONENT CONTROLLER CONTEXT
Detailed data will be displayed in a table. Therefore, the following context nodes (acting as data source for Web Dynpro
table element) are required:

Context Node CUST


This node is based on the DDIC structure YSTR_RESULT_DETAILS_CUS and represents a set of assigned
customers

Context Node CUST_CC


This node is based on the DDIC structure YSTR_RESULT_DETAILS_CUS_CC and represents customer data on
company code level.

8
2.2.4. METHOD PROCESS_EVENT
When a record in the search result list is selected, the event “BP_SELECTED” is raised. Within the method
PROCESS_EVENT, this event is caught and processed. This means that all assigned customers will be queried and
mapped to the context node CUST.

Note: the selected BP-ID is stored in the component controller attribute SEELCTED_BP

Figure 4: Component Controller – Attributes

METHOD process_event.

DATA lo_nd_cust TYPE REF TO if_wd_context_node.


DATA lt_cust TYPE wd_this->elements_cust.

CHECK io_event->mv_event_id = 'BP_SELECTED'.

wd_context->invalidate( ).

io_event->mo_event_data->get_value(
EXPORTING
iv_key = 'PARTNER'
IMPORTING
ev_value = wd_this->selected_bp ).

CHECK wd_this->selected_bp IS NOT INITIAL.

SELECT knd~kunnr
knd~ktokd
knd~aufsd
knd~loevm
INTO CORRESPONDING FIELDS OF TABLE lt_cust
FROM mdg_mlt_assgmnt AS mtl INNER JOIN kna1 AS knd
ON mtl~object_id = knd~kunnr
WHERE mtl~assignment_cat = 'CUST'
AND mtl~object_id = wd_this->selected_bp.

CHECK lt_cust IS NOT INITIAL.

lo_nd_cust = wd_context->get_child_node( name = wd_this->wdctx_cust ).


CHECK lo_nd_cust IS BOUND.
lo_nd_cust->bind_table( new_items = lt_cust
set_initial_elements = abap_true ).

ENDMETHOD.

Implementation 2: Component Controller – PROCESS_EVENT

9
2.2.5. View MAIN
The following elements must be placed:

Context Nodes
· Node CUST: maps to the related node of the component controller - mapping path
ZMDG_SEARCH_RSLT_DET_CUS.COMPONENTCONTROLLER.CUST
· Node CUST_CC: maps to the related node of the component controller – mapping path
ZMDG_SEARCH_RSLT_DET_CUS.COMPONENTCONTROLLER.CUST_CC

UI Element Tables
Two tables are needed to display the data:

· TAB_CUST: contains assigned customer


o Data source: MAIN.CUST
o Columns: maps to all context attributes
o Event onLeadSelect: SELECT_CC (see implementation ONACTIONSELECT_CC below). When a
customer is selected, all company code data will be queried and mapped to the context node
CUST_CC.
· TAB_CUST_CC: contains assigned customer
o Data source: MAIN.CUST_CC
o Columns: maps to all context attributes

10
METHOD onactionselect_cc.
DATA lo_nd_cust TYPE REF TO if_wd_context_node.
DATA lo_el_cust TYPE REF TO if_wd_context_element.
DATA ls_cust TYPE wd_this->element_cust.
DATA lo_nd_cust_cc TYPE REF TO if_wd_context_node.
DATA lt_cust_cc TYPE wd_this->elements_cust_cc.

lo_nd_cust = wd_context->get_child_node( name = wd_this->wdctx_cust ).


lo_el_cust = lo_nd_cust->get_element( ).
lo_el_cust->get_static_attributes(
IMPORTING
static_attributes = ls_cust ).

IF ls_cust-kunnr IS NOT INITIAL.


lo_nd_cust_cc = wd_context->get_child_node( name = wd_this->wdctx_cust_cc ).

SELECT *
INTO CORRESPONDING FIELDS OF TABLE lt_cust_cc
FROM knb1
WHERE kunnr = ls_cust-kunnr.

IF lt_cust_cc IS NOT INITIAL.


lo_nd_cust_cc->bind_table( new_items = lt_cust_cc set_initial_elements = abap_true ).
ENDIF.

ENDIF.

ENDMETHOD.
Implementation 3: ONACTIONSELECT_CC

2.3. Integration of Web Dynpro Into The Search Section

2.3.1. New UI Configuration YY_SEARCH_RESULT_DETAILS


Create new UI configuration YY_SEARCH_RESULT_DETAILS by copying the template
FPM_COMPOSITE_UIBB_TEMPLATE of the Web Dynpro Component FPM_COMPOSITE_UIBB

Figure 5: UI Configuration YY_SEARCH_RESULT_DETAILS

· Component: ZMDG_SEARCH_RSLT_DET_CUS
· Window Name: W_DETAILS

11
Figure 6: UI Configuration YY_SEARCH_RESULT_DETAILS - Detailed Parameters

2.4. Place The New configuration in the query Section


Create new UIBB in the configuration BS_BP_DQUERY via UI customizing:
· Component: FPM_COMPOSITE_UIBB
· Window Name: COMPOSITE_WINDOW
· Configuration ID: YY_SEARCH_RESULT_DETAILS

Figure 7: Detailed Search Result UIBB

12
3. RESULT OF THE ENHANCEMENT
Once all steps above have been successfully implemented, the result can look like this:

Figure 8: Search Result List with Detailed Data

Note: If several business partners are selected, only the detailed data of the first selected one will be listed.

13
www.sap.com/contactsap

© 2022 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.

You might also like