Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Adding custom fields to advanced search screen of CRM objects

CRM objects can be searched conveniently using search criteria predefined in the corresponding search component view defined. However the predefined search criteria may not include all fields that the business wants to search the CRM objects with.

This Wiki article will illustrate how we can add custom fields to advanced search screen of CRM objects that are not available on the standard search component view.

To illustrate the above point, we will enable search of Marketing Initiatives based on Expense Type field. The Expense type field is not part of Initiative general data and thus not available on the advanced search screen. We will add Expense Type field to advance search screen of Marketing Initiatives.

Objective:

To enable search of Marketing Initiatives based on Expense Type field. The Expense type field is not part of Initiative general data and thus not available on the advanced search screen.

To achieve this, we use the following technique

  1. Add the Expense type as a dummy field to Initiative header. This field is only used for search purposes.
  2. Enable the Expense type field on the Initiative search screen query and result views via UI config tool on the search component
  3. Implement BADI CRM_MKTPL_SEARCH, query criteria method, to remove the dummy Expense type field from the search criteria and save it in public attribute created for that purpose
  4. Implement BADI CRM_MKTPL_SEARCH, search result method. Query the Initiatives by the expense type and filter the results lists already queried by the system
  5. Expense type can also be enabled on the search results screen via personalization.

Adding Expense type as a dummy EEWB field to Initiative

Create a Project and assign package (or reuse existing), for adding Expense Type as a dummy EEWB field to Initiative. This field will only be used for search purposes and not to store data.

Assign customizing and workbench requests for the new project

Create extension for MARKETING_ELEMENT object with type BASIC_DATA

Click continue on the dialog

Title of extension

Select Initiative for object type

Since Expense Type is a standard SAP field with data element CRM_FM_EXPENSE_TYPE, define the new EEWB field with reference to this data element. Provide a name ZZEXPENSE_TYPE to the new field

Finish adding the EEWB field

Enabling the new EEWB field on Initiative advance search UI

Display component INIAS_ADVSEARCH using transaction BSP_WD_CMPWB

Navigate the Initiative search view ASInitiative and enable the newly added EEWB field for Expense type display in the search criteria

Navigate to the Inititive results view and enable the newly added field for Expense type in the result area

Method CHANGE_QUERY_CRITERIAS of BADI CRM_MKTPL_SEARCH can be implemented.

Here we can delete the query criteria based on the newly added EEWB field for Expense type and store it in an instance variable (LT_QUERY) in the BADI implementation Z class.

Code sample:

Method CHANGE_QUERY_RESULT of BADI CRM_MKTPL_SEARCH can be implemented

Here we can query the Initiative GUIDs based on the Expense Type values that the user selected. We can then use these GUIDs to filter the results table.

Code sample:

  • No labels

1 Comment

  1. Former Member

    Hi Vishnu

    I cannot see the sample code in the document.

    Can you please help me with that as I need to check the code.

    Thanks

    Saruchi