Show TOC

Procedure documentationAdding Fields to the Product Search

Procedure

To extend the product search to include attributes from your own set types or other set types perform the following steps:

  1. Extend the search structure by adding the additional search attributes in an append to the following standard search structures:

    • CRMT_PRIL_QUERY_ADVSEARCH_PROD

    • CRMT_PRIL_QUERY_ADVSEARCH_IOBJ

  2. If a search request contains the added attributes, the determination of the suitable search execution class is delegated to the method GET_SEARCH_SCENARIO_OR_FILTER of the Business Add-In (BAdI) CRM_PRIL_SEARCHEXIT. A default implementation of this BAdI is active and is executed automatically. It delegates the search to the search execution class CL_COM_PRSEARCHSCENARIO_ATTR (which consists of the search tool class CL_COM_PRSEARCHTOOL_ATTR and suitable filter classes). You have the following options:

    1. If you want to use this implementation the search tool class needs to know to which attribute of which set type a particular extension attribute belongs. You make this setting in Customizing for Customer Relationship Management under Start of the navigation path Master Data Next navigation step Products Next navigation step Basic Settings Next navigation step Add Attributes to Search Structure End of the navigation path. After maintaining your entries you have to transport them manually.

    2. If you want to use your own implementation of this BAdI, you can do this by providing, for example, a suitable search execution class derived from CL_COM_PRSEARCHSCENARIO_BASE.

    3. You can also just return a filter class (a class that implements the interface IF_COM_PRSEARCHFILTER). It is taken into account in the calling method. The standard attributes are processed further by the calling method PREPARE_DB_RANGE_SEARCH. If you want, you can use CRMC_PRSEA_ATTR in your own implementation.

    You can also use this method to have full control over the search. To do this, you set the EV_READY indicator to true in your implementation. Only the search execution class you return is then used in the search. This means that it should then be able to handle all criteria, but it also means that you have full responsibility for the search.

  3. For the UI, the search views are located in the BSP components PRD01QR and PRDIOQR. These are PRD01QR/Search for the main search view, PRD01QR/SearchHelp for the search help views (dialog boxes), and PRDIOQR/Search (used for main search view and in search help dialog boxes). After you have added the appends to the search structure, the additional attributes are available in the configuration tool of the BSP component workbench and can be set to visible.

    Suitable value helps can be provided for the additional attributes using the method IF_CRM_PRIL_SEARCHEXIT~CHANGE_DQUERY_DEF_EXTENSION of the BAdI CRM_PRIL_SEARCHEXIT. You can define your own implementations for this method in your own BAdI implementation.

    If you just want to make small changes to the existing implementation, you can use the source code enhancement concept and enhance the method IF_CRM_PRIL_SEARCHEXIT~CHANGE_DQUERY_DEF_EXTENSION of the default implementing class CL_CRM_PRIL_SEARCHEXIT_IMPL.

Also see Note 1026956.