SAP MDG · DATA MODEL UI
How can I extend the MDG Business Partner search result list to show related customer and company-code details on selection?
Extend `BS_BP_QUERY_RESULT` by replacing `CL_BS_BP_QUERY_RESULT` with `YY_CL_BS_BP_QUERY_RESULT`, raise event `BP_SELECTED` with parameter `PARTNER`, and display the drilldown in Web Dynpro component `ZMDG_SEARCH_RSLT_DET_CUS` via composite UIBB `YY_SEARCH_RESULT_DETAILS` in `BS_BP_DQUERY`.
Extend `BS_BP_QUERY_RESULT` by replacing `CL_BS_BP_QUERY_RESULT` with `YY_CL_BS_BP_QUERY_RESULT`, raise event `BP_SELECTED` with parameter `PARTNER`, and display the drilldown in Web Dynpro component `ZMDG_SEARCH_RSLT_DET_CUS` via composite UIBB `YY_SEARCH_RESULT_DETAILS` in `BS_BP_DQUERY`.
The guide implements a simple MDG-BP drilldown: the search result list selection raises a dedicated FPM event, the selected BP is passed to a Web Dynpro detail component, and the component shows assigned customer data plus company-code data only on demand.
Process flow
- Customize `BS_BP_QUERY_RESULT`.
- Re-implement standard feeder class `CL_BS_BP_QUERY_RESULT` as `YY_CL_BS_BP_QUERY_RESULT`.
- Redefine `IF_FPM_GUIBB_LIST~PROCESS_EVENT` to raise event `BP_SELECTED` with parameter `PARTNER`.
- Create DDIC structure `YSTR_RESULT_DETAILS_CUS` for general customer data.
- Create DDIC structure `YSTR_RESULT_DETAILS_CUS_CC` for company-code data.
- Create Web Dynpro component `ZMDG_SEARCH_RSLT_DET_CUS` and implement interfaces `IF_FPM_TRANSACTION` and `IF_FPM_UI_BUILDING_BLOCK`.
- Create context nodes `CUST` and `CUST_CC` in the component controller.
- Create view `MAIN` and window `W_DETAILS`.','Bind `TAB_CUST` to `MAIN.CUST` and set `onLeadSelect` to action `SELECT_CC`.','Bind `TAB_CUST_CC` to `MAIN.CUST_CC`.','Create UI configuration `YY_SEARCH_RESULT_DETAILS` by copying `FPM_COMPOSITE
Customize UI configuration `BS_BP_QUERY_RESULT`
Replace the standard feeder class with `YY_CL_BS_BP_QUERY_RESULT` so the search-result selection can raise `BP_SELECTED`.
Create UI configuration `YY_SEARCH_RESULT_DETAILS` from template `FPM_COMPOSITE_UIBB_TEMPLATE`
Embed Web Dynpro component `ZMDG_SEARCH_RSLT_DET_CUS` with window `W_DETAILS`.
Add a new UIBB to `BS_BP_DQUERY` using component `FPM_COMPOSITE_UIBB`, window `COMPOSITE_WINDOW`, configuration ID `YY_SEARCH_RESULT_DETAILS`
Place the drilldown detail area on the query screen.
Referenced tables
| Object | Purpose |
|---|---|
KNA1 | Source of general customer attributes used for the customer-level detail display. |
KNB1 | Source of customer company-code attributes used for the company-code detail display. |
YSTR_RESULT_DETAILS_CUS | DDIC structure for general customer detail data. |
YSTR_RESULT_DETAILS_CUS_CC | DDIC structure for company-code detail data. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example: SAP_S4HANA_Customer_Vendor_Integration_Cookbook.abap
Exact relevant implementation excerpt from the knowledge document set.
1*---------------------------------------------------------------------*
2* Title : SAP S4HANA Customer Vendore Integration Cookbook
3*---------------------------------------------------------------------*
4* TAGS
5* SAP S/4HANA
6* CVI
7* CUSTOMER VENDOR INTEGRATION
8* BUSINESS PARTNER
9* HCM EMPLOYEE
10* EMPLOYEE VENDOR
11* CVI_MAP_TITLE
12* CVI_MAP_BP_CATEGORY
13* CVI_CUSTOM_MAPPER
14* MAP_VENDOR_TO_BP
15* BP CATEGORY PERSON
16* BP NUMBER ASSIGNMENT
17* EXTERNAL NUMBER RANGE
18* ACCOUNT GROUP ZEMP
19* BP GROUPING BPAB
20* LFA1
21* LFB1-PERNR
22* VMDS_EI_COMPANY_T
23* VMDS_EI_COMPANY
24*---------------------------------------------------------------------*
25
26*---------------------------------------------------------------------*
27* SOURCE EXAMPLE 1
28* BAdI: CVI_MAP_TITLE
29* Purpose: Set employee Vendor Business Partner category to Person
30*---------------------------------------------------------------------*
31data: lv_ktokk type ktokk.
32
33select single ktokk into lv_ktokk
34 from lfa1
35 where lifnr = i_vendor_id.
36if sy-subrc = 0 and lv_ktokk = ‘ZEMP’.
37 c_partner_category = bp_as_person.
38endif.
39
40*---------------------------------------------------------------------*
41* SOURCE EXAMPLE 2
42* BAdI: CVI_CUSTOM_MAPPER
43* Method: MAP_VENDOR_TO_BP
44* Purpose: Derive BP number from employee personnel number
45*---------------------------------------------------------------------*
46MAP_VENDOR_TO_BP
47
48 data: lt_company type VMDS_EI_COMPANY_T,
49 ls_company type VMDS_EI_COMPANY.
50
51 if I_VENDOR-CENTRAL_DATA-CENTRAL-DATA-KTOKK = 'ZEMP'.
52 lt_company = I_VENDOR-COMPANY_DATA-COMPANY.
53 loop at lt_company into ls_company where data-
54pernr ne space. "What if more than one Company Code?
55 concatenate 'EN' ls_company-data-pernr into C_PARTNER-HEADER-
56OBJECT_INSTANCE-BPARTNER. "What BP already exists?
57 C_PARTNER-CENTRAL_DATA-COMMON-DATA-BP_CONTROL-GROUPING = 'BPAB'.
58 exit.
59 endloop.
60 endif.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I implement a simple drilldown for MDG-BP search results?
- How can I add customer details beneath the MDG Business Partner search result list?
- How do I pass the selected Business Partner from the search result list to a Web Dynpro detail component?
Possible questions
- How can I extend the MDG Business Partner search result list to show related customer details?
- What is the purpose of the simple drilldown search described in this guide?
- Which standard feeder class is used by the MDG BP search result list?
- Which custom feeder class is created for the search result enhancement?
- Which method of the search-result feeder class must be redefined?
- Which FPM event is raised when a Business Partner is selected?
- Which event parameter carries the selected Business Partner ID?
- How is the selected Business Partner passed from the search result list to the detailed-data component?
- Which UI configuration must be customized for the BP search result list?
- Which DDIC structure is created for general customer details?
- Which DDIC structure is created for customer company-code details?
- What is the name of the Web Dynpro component used for detailed customer data?
- Which interfaces are implemented by `ZMDG_SEARCH_RSLT_DET_CUS`?
- What are the view and window names of the Web Dynpro component?
- What is the purpose of context node `CUST`?
- What is the purpose of context node `CUST_CC`?
- What happens when the Web Dynpro component receives event `BP_SELECTED`?
- Which action is triggered by `TAB_CUST` when a customer is selected?
- How is UI configuration `YY_SEARCH_RESULT_DETAILS` created?
- Which FPM template is copied to create `YY_SEARCH_RESULT_DETAILS`?