Skip to Content
Technical Articles
Author's profile photo Urs Henle

Enhancing Business Partner Search Locator


As part of transaction BP, ‘Maintain Business Partner’, the so called ‘Locator’ provides different search possibilities in a convenient way within a standard S/4HANA system. But how is it possible to add a custom specific search functionality?

This blog post provides a step-by-step guide how to implement a new Business Partner Locator Search with the example of a search by Industry Classification. The same procedure can be used to add search functionality by any other standard or custom BP fields.

As a result, the end user will be able to look for business partners based on industry system and industry code.

This guide details the information described in a previous blog post (SAP Business Partner – Enhancing BP search criteria).

Implementation Steps

The new search functionality must ultimately be added to the locator with transaction LOCA_CUST. Before this can be done, several implementation steps must be performed as outlined below. It is a good practice to make yourself familiar with the standard search functionality. In many cases, you will be able to copy at least part of a standard search help to your new search functionality.


Add Additional Search Fields

Structure BUS_JOEL_SEARCH must be extended with the new search fields. This structure contains all the fields which can be used in the locator search of the business partner transaction. In our case, field industry system and industry code must be added with an append to structure BUS_JOEL_SEARCH.

  • Transaction SE11 – Data Type BUS_JOEL_SEARCH – Display
    Please check first, if your search fields are not already part of this structure.
  • Use push button ‘Append structure …’ – enter a name according to your naming convention.
  • Add a description for the append, the new search fields and assign appropriate types as well as foreign key and/or a value help definition.
  • Activate the append structure.

Create Elementary Search Help

An elementary search help must be created which uses the new search fields. This elementary search help will only be used in the collective search help assigned to the locator functionality or in BADI BUS_LOCA_HIDE_SEARCH. They cannot be used in ‘regular’ search helps assigned to field ‘Business Partner’ (value/input help).

  • Transaction SE11 – Search help Z_BUPA_ALL_INDUSTRY_SECTOR (enter a name according to your naming conventions) – Create
  • Select ‘Elementary search help’
  • Enter a description, as selection method TB038A (the table containing the industry codes), and the two search help parameters as shown below.
  • Activate the search help.

Add Elementary Search Help to Locator Search

There are two alternatives to make your new search functionality available in the ‘Find’ field in the locator.

  1. Append Elementary Search Help to the respective Locator collective Locator Search Helps
    The procedure to do so is described below.
    If you do not want to add append search helps to the standard search helps, you can create an implementation of BADI BUS_LOCA_HIDE_SEARCH. In method HIDE_SEARCH_IDS, you can insert a new entry to the method parameter table with the name of your elementary search help for the search types you want the search to be available. With such a BADI implementation you can also remove standard search ids which you do not want to present to users, or you can change the sequence in the dropdown list.

If you follow alternative one, the elementary search help must be assigned to the respective locator collective search helps. There are four different locator search helps in a standard S/4HANA system. They are tied to the ‘Find’ field in the locator.


Following table shows the assignment of the collective search help to the dropdown list value.

Dropdown list value Collective search help
1 Business Partner BUPA_ALL

Depending on where you want the end user to be able to use the new search functionality, you need to assign the new elementary search help to one or more of above collective search helps. The following example shows the assignment of the elementary search help Z_BUPA_ALL_INDUSTRY_SECTOR to the collective search help BUPA_ALL so that the user can find business partners by industry for all business partner types.

  • Transaction SE11 – Search Help BUPA_ALL – Display
  • Switch to tab ‘Included search helps’ and use Goto – Append Search Help … (F5)
  • In the popup screen, use push button ‘Create Append’ and enter an append name according to your naming conventions.
  • Add a short description, switch to tab ‘Included search helps’ and add the elementary search help to the append search help.
  • Activate the append search help.
    Remark: There is no need to do a parameter assignment for these kind of search helps.

Create a Function Module

A function module needs to be created which contains the logic to retrieve the business partners for the new search criteria and which provides the resulting list of BPs.

First, a new function group must be created within an appropriate package. If you are going to develop multiple new search functions, you can add the different function modules to this function group, or you can just develop one function module which holds the logic for these different search functions.

  • Transaction SE80 – Open your package – Right mouse click on package – Create – Function group
  • Add a function group name and a description – Save.

Now, the function module needs to be developed. You can either do this from scratch or you can copy one of the standard function modules. In this example, standard function module BUPA_DIALOG_SEARCH was copied to a new function module assigned to the new function group and the coding was changed accordingly.

  • E.g. Transaction SE37 – Enter function module BUPA_DIALOG_SEARCH – Use push button Copy – Enter new function module name and your function group – Use push button Copy.
  • Change coding based on your search functionality. In this example, the coding looks as shown below.
    FUNCTION z_bupa_dialog_add_search.
    *"*"Local Interface:
    * Local data.
      DATA: ls_search_fields TYPE bus_joel_search.
    * Convert generic container into specific fields.
      ls_search_fields = iv_search->gv_search_fields. "#EC ENHOK
    * Choose the select.
      CASE iv_search->gv_search_id.
        WHEN 'Z_BUPA_ALL_INDUSTRY_SECTOR'.    "name of elementary search help
          CALL METHOD lcl_searcher=>select_by_industry
          EXPORTING iv_search = iv_search
                    iv_istype = ls_search_fields-zz_istype
                    iv_ind_sector = ls_search_fields-zz_ind_sector
                    EXCEPTIONS search_values_missing = 1.
        WHEN OTHERS.
          CLEAR sy-subrc.
      CASE sy-subrc.
        WHEN 1.
          RAISE search_values_missing.
  • Now, the local class lcl_searcher with method select_by_industry must be defined and implemented. The definition can be added to include LZ_BP_LOCATORTOP (or to a new include) and the implementation can be added to a new include. See below screen shots with sample coding based on our search by industry example.Please also add a data statement for gs_dynpro_id and a tables statement for BUS_JOEL_SEARCH which will be used later on.Method definition:
    TABLES bus_joel_search.
    DATA gs_dynpro_id TYPE bus_screen-area.
    CLASS lcl_searcher DEFINITION FINAL.
        IMPORTING iv_search  TYPE REF TO cl_bus_locator_search
                  iv_istype TYPE bus_joel_search-zz_istype
                  iv_ind_sector TYPE bus_joel_search-zz_ind_sector
                  EXCEPTIONS search_values_missing.

    Method implementation:

    The aim of this method is to retrieve the business partner GUIDs based on the search criteria entered by the user. In our case, the selection is done based on table BUT000 to retrieve the BP GUIDs and table BUT0IS which contains the industries for the BPs.

    *& Include          LZ_BP_LOCATORF01
    CLASS lcl_searcher IMPLEMENTATION.
    * METHOD select_by_industry
      METHOD select_by_industry.
    *   Local data.
        DATA: lv_partner_type       TYPE bus_partner-type,
              lr_ind_sector TYPE RANGE OF but0is-ind_sector,
              lt_partner_guids  TYPE bus_partner-guid_table.
        CALL METHOD iv_search->get_range_for
                    EXPORTING iv_value = iv_ind_sector
                    IMPORTING et_range = lr_ind_sector.
    *   Determine the partner type to filter by.
        CASE iv_search->gv_search_type.
          WHEN cl_bupa_dialog_searcher=>gc_search_type_all.
            lv_partner_type = space.
          WHEN cl_bupa_dialog_searcher=>gc_search_type_person.
            lv_partner_type = '1'.
          WHEN cl_bupa_dialog_searcher=>gc_search_type_organization.
            lv_partner_type = '2'.
          WHEN cl_bupa_dialog_searcher=>gc_search_type_group.
            lv_partner_type = '3'.
    *   Select the Business Partners
        IF ( lv_partner_type NE space ).
          IF ( iv_istype NE space ).
            SELECT partner_guid INTO TABLE lt_partner_guids
                   FROM but000
                   UP TO iv_search->gv_maximum_rows ROWS
                   WHERE partner IN ( SELECT partner FROM but0is WHERE ind_sector IN lr_ind_sector
                                       AND istype = iv_istype )
                   AND type = lv_partner_type.
             SELECT partner_guid INTO TABLE lt_partner_guids
                 FROM but000
                 UP TO iv_search->gv_maximum_rows ROWS
                 WHERE partner IN ( SELECT partner FROM but0is WHERE ind_sector IN lr_ind_sector )
                 AND type = lv_partner_type.
          IF ( iv_istype NE space ).
            SELECT partner_guid INTO TABLE lt_partner_guids
                   FROM but000
                   UP TO iv_search->gv_maximum_rows ROWS
                   WHERE partner IN ( SELECT partner FROM but0is WHERE ind_sector IN lr_ind_sector
                                       AND istype = iv_istype ).
             SELECT partner_guid INTO TABLE lt_partner_guids
                 FROM but000
                 UP TO iv_search->gv_maximum_rows ROWS
                 WHERE partner IN ( SELECT partner FROM but0is WHERE ind_sector IN lr_ind_sector ).
    *   Pass result table
        CALL METHOD cl_bupa_dialog_searcher=>add_partner_guids_to_result
                    EXPORTING it_partner_guids         = lt_partner_guids
                              iv_filter_by_search_type = space
                              iv_search                = iv_search.


Create a Screen with Search Fields

Now, a screen with the search fields must be created. This screen will be shown to the user in the locator as soon as the corresponding value in the find by was selected.

  • Transaction SE80 – Right click on your function group – Create – Screen
  • Enter a screen number – Enter a description – Select Subscreen as Dynpro Type
  • Add the two search fields with reference to structure BUS_JOEL_SEARCH to the screen. You could also add the corresponding descriptions of the selected field values to this screen.
  • Add PBO and PAI modules to the flow logic. Use forward navigation to create the modules in respective includes and code them as shown below.
      MODULE dynpro_pbo.
      MODULE dynpro_pai.​
    MODULE dynpro_pbo OUTPUT.
    * Global data.
      gs_dynpro_id-program_name = sy-repid.
      gs_dynpro_id-dynpro_number = sy-dynnr.
      CALL METHOD cl_bus_abstract_screen=>dynpro_pbo
                  EXPORTING iv_program_name = gs_dynpro_id-program_name
                            iv_dynpro_number = gs_dynpro_id-dynpro_number.
    *&      Module  DYNPRO_PAI  INPUT
    *       text
    MODULE dynpro_pai INPUT.
      gs_dynpro_id-program_name = sy-repid.
      gs_dynpro_id-dynpro_number = sy-dynnr.
      CALL METHOD cl_bus_abstract_screen=>dynpro_pai
                  EXPORTING iv_program_name = gs_dynpro_id-program_name
                            iv_dynpro_number = gs_dynpro_id-dynpro_number.

Add Subroutines for Search Field

As a last development task, two sub routines must be added to pass the search fields between the locator framework and your function group.

  • Transaction SE80 – open your include for form routines and add below two form routines. These two form routines will be called from the locator framework by using the statement perform [form routine] in program [master program of the function group]. Therefore, these two routines must be added here as well.
    *       FORM bus_locator_get_search_fields                            *
    FORM bus_locator_get_search_fields                          "#EC CALLED
         USING    iv_search_application TYPE bus_locator-search_application
         CHANGING ev_search_fields      TYPE bus_locator-search_fields.
     CASE iv_search_application.
        WHEN cl_bupa_dialog_searcher=>gc_search_application_bupa.
          ev_search_fields = bus_joel_search."#EC ENHOK
    *       FORM bus_locator_set_search_fields                            *
    FORM bus_locator_set_search_fields                          "#EC CALLED
         USING    iv_search_application TYPE bus_locator-search_application
                  iv_search_fields      TYPE bus_locator-search_fields.
      CASE iv_search_application.
        WHEN cl_bupa_dialog_searcher=>gc_search_application_bupa.
          bus_joel_search = iv_search_fields. "#EC ENHOK

Add Entry in LOCA_CUST

As a final step, a new entry in the locator customizing table must be added.

  • Transaction LOCA_CUST – Select ‘Search IDs’ – Use push button ‘New Entry’ – Add your elementary search, a text which will be shown in the ‘Find By’ dropdown list, your function module, the master program of your function group, and your screen number.
    Remark: It would have been possible to add a second selection screen which would be used in the full screen version of the BP Locator Search.

Using the New Search Function

After these implementation steps, it is now possible to look for Business Partners based on Industry System and Industry Code. The user can pick the new search id from the dropdown list of field ‘By’ (in our case only if search type ‘Business Partner’ was used in field ‘Find’).

Then, the user can select the industry system and the industry code and will receive a list of business partners being classified with these codes.


This guide is targeted to those who still use SAPGUI transaction BP or the SAP Fiori app ‘Maintain Business Partner’ (SAPGUI for HTML) and shows how to add a new search function to the Business Partner Locator. By doing so, it also shows how you could influence standard search ids. Please be aware that this enhancement does not influence the filter functionality of the ‘Manage’ SAP Fiori apps for Business Partner, Customer, and Supplier.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Syambabu Allu
      Syambabu Allu

      Very informative blog.Thanks for sharing in detail.

      Thank you,


      Author's profile photo Monika Eggers
      Monika Eggers

      Great article! I had always been wondering what is necessary to get additional "search by"s into transaction BP, for example how the search by customer number or vendor number had been added in S4CORE.

      Author's profile photo Aileen Lim
      Aileen Lim

      Thank you so much for this useful blog post. It has helped me with a requirement in my current project.

      Author's profile photo nicolas bacich
      nicolas bacich

      Very useful post.  Thanks very much for sharing, Herr Henle.

      Author's profile photo Andres Santino
      Andres Santino

      Excelent Post.

      Dear Urs, I have a related question:
      The question is: for any SAP Standard Search Help (Standard Matchcode by pressing F4, for example KRED_C) that involves the supplier, 
      I need to know if it is possible to make a similar Z Custom aggregate to this Matchcode, that allows searching by (for example), 
      the Industry branch. 
      If so, how could such this Z implementation be done as an aggregate into the Standard Matchcode?
      Thanks in advance.
      Author's profile photo Urs Henle
      Urs Henle
      Blog Post Author

      Hi Andres,

      Thank you for your question.

      Yes, you can develop a custom elementary search help and append it to a standard collective search help.

      In your case, you need to create an elementary Z search help using as selection method (e.g.) a respective table or a table view. If your search help simply needs to look for vendors by industry code, you can use table LFA1 and add the necessary data elements as search help parameters (e.g. data element BRSCH = industry key). If your search help should look for vendors by industry system and industry code of the assigned business partner, you need to create a table view with tables BUT0IS (industry system/industry code of a business partner), BUT000 (business partner general data), and CVI_VEND_LINK (assignment between vendor and business partner). This table view can then be used in your elementary search help. In the end, you need to add your elementary search help as an append to the collective search help.

      Please see the documentation in the SAP Help Portal for further details. An example how to create an elementary search help and to add it a standard collective search help is described in blog post Enhancement of standard search helps in SAP (you won’t need point 7 of this blog post, though).

      Hope, this will help.

      Kind regards,


      Author's profile photo Andres Santino
      Andres Santino

      Thanks a lot (....You're a master...)

      I'm going to try this solution.


      Author's profile photo Siegfried Weber
      Siegfried Weber

      Hello Urs,

      really great blog.

      I have a additional question:

      I implemented a customer Search (described in your blog). Is it possible to bring additional fields to the result table? I want to bring the adress to the result table.

      Kind regards


      Author's profile photo Urs Henle
      Urs Henle
      Blog Post Author

      Hi Sigi,

      To my knowledge, there is no BADI available to influence the result table. It might be possible to use implicit enhancement but I haven't done that either.

      Kind regards,