Skip to Content

How to Integrate a New Item Type into the Agent Inbox

1      Overview

This document is intended for technical consultants and developers and provides information about integrating a new inbox item type into the agent inbox (inbox).

The inbox provides search and result functions for different inbox item types (objects), such as business transactions in SAP CRM, SAP ERP sales orders, and work items (e-mails, fax messages, and letters).

You can extend the inbox and integrate additional inbox item types. This enables you to search for this inbox item type together with the existing inbox item types, display the search result in the inbox and process the corresponding inbox items from the inbox.

This document is valid for releases SAP Enhancement Package 1 for SAP CRM 7.0 (CRM701) and higher.

2      Prerequisites

  • BOL component definition and implementation for the new inbox item type including search object, result object and root object.
    If the object model is simple enough, the root object can be used as the result object.
  • UI component for  navigation and for the processing of the inbox item from the inbox

Note that if your BOL implementation uses the same attribute names as those in the standard structures, the integration into the inbox search and result is easier: search structure CRMST_AUINBOX_SEARCH, result structure CRMS_AUI_SRCH_RESULT.

3      Customizing

The following Customizing settings are required to integrate the new inbox item type implementation into the inbox:

  • Add the BOL component to the component set CRMIC_INBOX:
    You do this in Customizing for Customer Relationship Management under CRM Cross-Application Components -> Generic Interaction Layer -> Basic Settings.
  • Add the new inbox item type.
    To make the new inbox item type available in the Customizing activity Define Item Types, you must first create a fixed value append for the domain CRM_AUI_MAP_ITEM_TYPE and add the new inbox item type to the fixed value append.
    You add the new inbox item type in Customizing for Customer Relationship Management under Interaction Center WebClient  -> Agent Inbox -> Basic Settings for Item Types  ->Define Item Types.
  • Assign the new implementation class to the new inbox item type.
    You do this in Customizing for Customer Relationship Management under Interaction Center WebClient -> Agent Inbox -> Basic Settings for Item Types -> Assign Implementation Classes.
  • Define main categories for new inbox item type
    You do this in Customizing for Customer Relationship Management under Interaction Center WebClient->– Agent Inbox -> Inbox Search Definitions -> Define Item Types for Searches.
  • Assign the new main category to the corresponding inbox profiles to make the new main category available in the inbox search view.
    You do this in Customizing for Customer Relationship Management under Interaction Center WebClient -> Agent Inbox -> Define Inbox Profiles: Assign the new main categories.

4      Search Integration

The search for the various item types is triggered from method GET_QUERY_RESULT (CL_CRM_AUI_QUERY_SERVICE).

Remark: The BADI methods before_search and  after_search cannot be used for the new inbox item type, because these methods are called within the specific search method. For example, the business transaction search can be manipulated by before_search or after_search, but not a completely new inbox item type.

Therefore a modification in method GET_QUERY_RESULT (CL_CRM_AUI_QUERY_SERVICE) is required.

4.1  Flow of the Search for One Item Type:

  • Check if selected main category matches item type (generic)
  • Attribute validity check
  • Map search parameters
  • Optional: Call inbox BAdI method before_search (if_ex_crm_ic_inbox_badi)
  • Checks (for example valid object ID)
  • Trigger inbox item type BOL search
  • Optional: Call inbox BAdI method after_search ( if_ex_crm_ic_inbox_badi)
  • Create result entities (AUI entity or AUI result entity)
  • Fill sort table

4.2  Required Implementation Steps

4.2.1  Enable Attribute Validity Check.

This chapter is only relevant if the business function IC Inbox Extensions (CRM_IC_INBOX) has been activated. For more information about business function IC Inbox Extensions, see SAP Help Portal at help.sap.com/crm -> <Choose release> -> Application Help -> Business Functions for SAP Customer Relationship Management -> Interaction Center -> IC Inbox Extensions.

The attribute validity check is a generic functionality that checks if the used search parameters are supported by the selected main categories. If a search parameter is not supported by a certain main category, the search for this main category is not performed. A corresponding error message is displayed in the search processing log. For more information about the search attribute validity check, see SAP Help Portal at help.sap.com/crm -> <Choose release> -> Application Help -> Interaction Center -> Interaction Center WebClient -> Agent Inbox in the Interaction Center WebClient -> Inbox Search.

If the new inbox item type implementation does not support the attribute validity check, all searches for this inbox item type are processed even if  some search attributes and main category combinations are not supported  This means that the searches could return unclear search results.

The following changes are modifications in class CL_CRM_AUI_QUERY_SERVICE.

  1. Enhance the local type ITEM_TYPE_BOOLEAN_STRUCT in CL_CRM_AUI_QUERY_SERVICE by adding a new field with the name of the new inbox item type
    types:
    begin of ITEM_TYPE_BOOLEAN_STRUCT,
    ,
          ONEORDER  type abap_bool ,

          …        

    <new_itemtype> type abap_bool,

    END OF ITEM_TYPE_BOOLEAN_STRUCT.
  2. In method GET_QUERY_RESULT (CL_CRM_AUI_QUERY_SERVICE) set ls_skipped_items_type = ‘XXXXXXX’. This is required if you want the attribute validity check to be active for the new inbox item type
  3. Maintain entries in table CRMC_AUI_SEARCH using the  guideline:
    1. If the existing search attribute is supported by inbox item type
      1. If there are entries for this attribute ( for example  priority )–> add entry in CRMC_AUI_SEARCH for attribute and new inbox  item type
      2. If not (for example status), nothing is to be done
    2. If the existing search attribute is not supported by inbox item type
      1. If there are entries for this attribute already ( for example priority ) -> nothing is to be done
      2. If not (for example status),  create entry for all inbox item types that support this attribute
    3. If a new search attribute is introduced for the new inbox item type, an entry is required for the new attribute and new inbox item type in table CRMC_AUI_SEARCH.
  4. Call method DETERM_VALID_MAINCAT_FOR_ATTR from GET_QUERY_RESULT: The implementation is generic and only has to be called for iv_item_type = ‘<new_itemtype>’. The changing parameters have to be filled as follows:
    CHANGING
      cv_skip_search  = ls_skipped_items_type-new_itemtype

      ct_attributes =  query_params

      ct_main_cat_check =  lt_main_cat_check .
  5. Handle ls_skipped_items_type-<new_itemtype>. If it is not set, call new method GET_QUERY_RESULT_<new_itemtype> (see next step).

4.2.2  New Search Method for Item Type

Create a new method GET_QUERY_RESULT_<new_itemtype> in CL_CRM_AUI_QUERY_SERVICE.

The signature of the method should include the following parameters:

  • Importing:
    • IR_EXIT TYPE REF TO IF_EX_CRM_IC_INBOX_BADI
    • IT_ITEM_TYPES TYPE CRMTT_AUI_ITEM_TYPE       
  • Exporting:
    • ET_RESULT          TYPE CRMTT_AUI_SORTING
    • ET_PARAMETERS            TYPE CRMT_NAME_VALUE_PAIR_TAB

Call it from the method GET_QUERY_RESULT like that:

 

CALL METHOD get_query_result_<new_itemtype>
     
EXPORTING
        ir_exit     
= lr_exit
        it_item_types
= lt_item_types
     
IMPORTING
        et_result   
= lt_items
        et_parameters
= l_param_tab.

After the call of this method, the internal table lt_items has to be added to the main sorting table, like that:

 

APPEND LINES OF lt_items TO l_sort_1o_tab.

The following steps must be implemented in the method GET_QUERY_RESULT_<new_itemtype>:

  1. Map search parameters
    Create a method ( for example MAP_PARAM_<new_itemtype>). The signature of the method should include the following parameter:
    Returning: r_param_tab type CRMT_NAME_VALUE_PAIR_TAB
    Query parameters on the UI are mapped to the structure CRMST_AUINBOX_SEARCH. In this method, the search parameters from the structure CRMST_AUINBOX_SEARCH are mapped to the search parameters for the inbox item type.
    Call the method MAP_PARAM_<new_itemtype> from GET_QUERY_RESULT_<new_itemtype>.
  2. Trigger the BOL search
    Create instance of your query_service, set the query parameters and trigger the search.
  3. Create result objects
    If the lean search is activated in the inbox profile, instantiate the AUI result entity, otherwise instantiate the AUI entity (see ‘Result Integration’ section).
  4. Fill sort table
    Fill those result attributes that are supported for sorting into exporting parameter  et_result. This table is merged with sorting tables for other inbox item types and is sorted after all searches have been performed.

5      Result Integration

5.1  Implementation of AUI Entity Class

Create class Zcl_Crm_aui_<new_itemtype> as a subclass of cl_crm_aui_entity.

This class represents the BOL object to the UI layer. It has getter methods to provide the result attribute values to the UI.

It has also methods inherited from the super class for the various inbox functions, such as Reserve and Interact. For more information, see the chapter Integration into Inbox Functionality.

The following method needs to be redefined:

  • GET_NAME: return the name of the root object

5.2  Implementation of AUI Result Class (Lean)

This chapter is only relevant if the business function IC and Communication-Enabled Business Processes (CRM_IC_CEBP) has been activated. For more information about business function IC and Communication-Enabled Business Processes, see SAP Help Portal at help.sap.com/crm -> <Choose release> -> Application Help -> Business Functions for SAP Customer Relationship Management -> Interaction Center -> IC and Communication-Enabled Business Processes.

In the inbox profile, you can specify that the lean search is to be used. This means that the BOL query returns an instance of a result object that is assigned to the result list in the UI. The AUI entity and the BOL root object are only initialized if an inbox item is selected in the result list. 

We recommend that new inbox item types should be implemented to support the lean search from the outset to reduce memory consumption.

Another implementation class is required to support the lean search:

Create class Zcl_crm_aui_<new_itemtype>_result as subclass of CL_CRM_AUI_RESULT_ENTITY.

This class represents the result object to the UI layer.

The result entity is the object behind the objects shown in the result list. When an inbox item is selected in the result list, an instance of cl_crm_aui_entity is generated so that the complete functionality of the aui_entity class can be used.

The following methods must to be redefined in ZCL_CRM_AUI_<new_itemtype>_RESULT:

  • CONSTRUCTOR: Call super->constructor and handover ir_lean_obj as well as the class name of your AUI entity class (see above)
  • GET_NAME: Return the name of the result object
  • GET_BOL_ENTITY: This method is called when an inbox item is selected in the inbox result list. It should return an instance of the root object of the new inbox item type.

Getter methods must be implemented for those result attributes that have different names than the attributes in result structure CRMS_AUI_SRCH_RESULT. The getter methods are then called from method GET_PROPERTY (CL_CRM_AUI_RESULT_ENTITY)

5.3  Optional: Support Asynchronous Search

This chapter is only relevant if the business function CRM_IC_CEBP has been activated.

In the inbox profile, you can specify that the asynchronous search is used. If you want to use the asynchronous search for the new inbox item type, the inbox item type implementation must support the asynchronous search.

The asynchronous search is based on the lean search. The actual search is performed in a second session. Once the result has been returned, it can be accessed and displayed in the inbox result list using an alert.

To support the asynchronous search, the lean search must be implemented.  You must also create ZCL_CRM_AUI_<new_itemtype>_ASYN_RESULT as a subclass of CL_CRM_AUI_ASYN_RESULT_ENTITY.

The following methods must be redefined:

  • CONSTRUCTOR: Call super->constructor and handover ir_lean_obj and the class name of your aui entity class (see above)
  • GET_NAME: Return the name of the result object
  • GET_BOL_ENTITY: This method is called when an inbox item is selected in the inbox result list. It should return an instance of the root object of the new inbox item type.
  • No getter implementation is required because method GET_PROPERTY delegates to the method GET_PROPERTY of the lean result class.

The following coding also has to be modified:

In method GET_QUERY_RESULT (CL_CRM_AUI_ENTITY_GENERATE_SRV) the names of the lean and asynchronous implementation classes have to be inserted as follows:

CASE lv_obj_name.
     
WHEN '<new_itemtype>Result'. (name of the result object)
        lv_class_name
= 'ZCL_CRM_AUI_<new_itemtype>_ASYN_RESULT'.
        lv_lean_cl_name
= 'ZCL_CRM_AUI_<new_itemtype>_RESULT'.

 

6      Integration into Inbox Functionality

Inbox result list functions can be accessed using the inbox result toolbar buttons.

The event handler methods in the UI delegate the event handling to the AUI entity classes. For example, EH_ONITEMEDIT calls method ITEM_EDIT (CL_CRM_AUI_RESULTVIEW_CONTR) which calls the method PROCESS (CL_CRM_AUI_ENTITY).

By implementing the respective methods in your class Zcl_Crm_aui_<new_itemtype> you can handle the buttons as required.

The enablement of the buttons is calculated in the method BUTTONS (CL_CRM_AUI_ENTITY).

Note that for the navigation from the inbox to the overview page of the new inbox item type, the respective outbound plug mapping has to be maintained in your business role.

With business function CRM_IC_INBOX, the result list toolbar is configurable, and the toolbar buttons can be added to or removed from the toolbar as required. Moreover, you can define buttons. For more information, see Customizing for Customer Relationship Management under Interaction Center WebClient -> Agent Inbox -> Define Inbox Toolbar Profiles.

For information about the result toolbar buttons that are part of the standard system, see SAP Library on SAP Help Portal at http://help.sap.com/crm -> <Choose release.> -> Application Help -> Interaction Center -> Interaction Center WebClient -> Agent Inbox -> Inbox Result List.

7      Integration in Accelerated Search Based on SAP HANA

This chapter is only relevant if the business function IC Inbox Extensions and Acceleration (CRM_IC_INBOX_ACC) has been activated. For more information about business function IC Inbox Extensions and Acceleration, see SAP Help Portal at help.sap.com/crm -> <Choose release> -> Application Help -> Business Functions for SAP Customer Relationship Management -> Interaction Center -> IC Inbox Extensions and Acceleration.

To support the accelerated inbox search for a new inbox item type, the corresponding SAP HANA content has to be enhanced.

The SAP HANA content for the accelerated inbox search is found in the package sap.crm.ic-aui. Each inbox item type provides an attribute view that contains the required search and result attributes.  The calculation view sap.crm.ic-aui.CA_IC_INBOX combines all attribute views by mapping the attributes to a single set of attributes.

The following steps have to be performed to include a new inbox item type in the SAP HANA content for the accelerated inbox search:

  1. If you are not using SAP HANA as your primary database, set up the data replication for the required tables from the SAP CRM system to the SAP HANA system. If SAP HANA is your primary database, the data replication is not required.
  2. Create a new attribute view for the new inbox item type. The attribute view must include search and result attributes.
    Recommendation: In the attribute view, use the attribute names from the calculation view.
  3. Copy the calculation view using a new name, such as CA_IC_INBOX_EXT and add the new attribute view by mapping the attributes to the harmonized attributes of the calculation view. This applies only to the attributes that are supported by the new inbox item type.
  4. Define the inbox acceleration profile to make the new calculation view available to the inbox and assign the acceleration profile to the inbox profile.
    You do this in Customizing for Customer Relationship Management under Interaction Center WebClient -> Agent Inbox -> Define Inbox Acceleration Profiles.

For more information, see the following documentation:

  • SAP Help Portal at help.sap.com/crm -> <Choose release> -> Application Help -> Interaction Center -> Interaction Center WebClient -> Accelerated Inbox Search -> SAP HANA Content for Accelerated Search and Setting Up the Accelerated Inbox Search
  • SAP Help Portal at http://help.sap.com/hana_appliance#section5

7.1  Integration into ‘Inbox Work Distribution’ Dashboard

This chapter is only relevant if the business function CRM_IC_INBOX_ACC has been activated.

The dashboard uses the same SAP HANA content as the accelerated inbox search. The following attributes must be supported:

  • EMPLOYEEASSIGNED
  • GROUP_ASSIGNED
  • INBOX_PRIORITY
  • INBOX_STATUS
  • DATERECEIVED
  • DUE_ON_DATE
  • MAINCATEGORY

For more information, see SAP Help Portal at help.sap.com/crm -> <Choose release> -> Application Help -> Interaction Center -> Interaction Center WebClient -> Accelerated Inbox Search -> "Inbox Work Distribution" Dashboard.

8      Appendix

8.1  Relevant Business Functions

  • CRM_IC_CEBP for lean and asynchronous search
  • CRM_IC_INBOX for attribute validity check
  • CRM_IC_INBOX_ACC for accelerated search and dashboard
Tags:
Former Member