SAP ABAP IMG Activity PAOC_EIC_073 (BAdI: Knowledge Database)
Hierarchy
EA-HRGXX (Software Component) Sub component EA-HRGXX of EA-HR
   PA-EIC (Application Component) Employee Interaction Center
     PAOC_EIC_IMG (Package) Employee Interaction Center: IMG
IMG Activity
ID PAOC_EIC_073 BAdI: Knowledge Database  
Transaction Code S_AEN_10000687   (empty) 
Created on 20050317    
Customizing Attributes PAOC_EIC_OPT   Employee Interaction Center (EIC): Optional Activity 
Customizing Activity PAOC_EIC_073   BAdI: Knowledge Database 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name CRM_IIA_010    

Use

In this Implementation Guide (IMG) activity, you can implement a Business Add-In to create and add new knowledge bases to the knowledge repository of the Software Agent Framework (SAF). You can do this for any data from the following data sources:

  • SAP

    All data in an SAP system (such as Customer Relationship Management, Enterprise Resource Planning, Business Information Warehouse, Supply Chain Management, Product Lifecycle Management, and SAP ERP) can be integrated into the knowledge repository through direct data model access or SAP's standard RFC communication. If no BAPI or RFC is available for the data, you simply create an RFC-enabled function module from the source server, so that data can be retrieved into the SAP system.

  • External

    All external data sources can be integrated into the knowledge repository as long as you establish communication between SAP and the external data source (for example, HTTP communication) in the Add-In implementation in order to retrieve the required information (like IDs and detail descriptions).

Heterogeneous Data Sources
You can create a knowledge base that combines multiple data sources from multiple systems. For example, you may want to create a knowledge base of business partners with related activities imported from both SAP Business Information Warehouse and SAP ERP systems. Then, you just need to make sure different data sources can be recognized and identified via a certain ID, so that all related data can be retrieved and merged based on the same identifier.

An SAF knowledge entity is recognizable and accessible via a unique identifier, so a knowledge entity is independent of data sources as long as the correct information is retrievable. Therefore, as long as communication can be established between SAP and various data sources, any combinations of data can be aggregated into a knowledge entity.

Extension with Business Rules
If there are specific business rules that you want to apply to a knowledge base so you can completely control the content of each knowledge entity, you implement your business rules using method IF_EX_CRM_SAF_KB~RETRIEVE_BATCH (see below). Consequently, only those knowledge entities controlled by this method will be retrieved and be accessible by the SAF's services.

If you want to apply the business rules to attributes of a knowledge entity (for example, you only want to filter out certain information when the solution type is QM), you implement the business rules using method IF_EX_CRM_SAF_KB~RETRIEVE_DETAIL (see below). This method determines which pieces of detail information are available to the SAF's services.

Extension with Hierarchical Structure
You can create a knowledge base with any hierarchical structure. However, we do not recommend this approach because it requires a complete rework of code for the new knowledge base. The following ABAP classes in SAP CRM provide sample code that you can check:

  • CL_CRM_EI_KB_SDB (Solution Database)
  • CL_CRM_EI_KB_SDB_ATTACHMENT (Solution Database attachments)

Requirements

You have authorizations for transactions SE19, SE24, CRMC_SAF_WZ_KB, and (if communication to an external data source is required) SM59.

Standard settings

Activities

  1. Create a new Business Add-In implementation.
    1. In Customizing, go to the Business Add-In BAdI: Knowledge Bases.
    2. Choose Create and enter an implementation name (for example, CRM_SAF_KB_NEW), and choose Enter.
    3. Save the new Add-In implementation.
    4. A new implementing class is generated automatically.
    5. Go to the Interface tab page and note the name of the implementing class.
  2. Implement the Add-In class.
    1. Go to the Class Builder (transaction SE24).
    2. Enter the name of the implementing class from step 1, and choose Change.
    3. For the retrieval process of the new knowledge base, implement codes for the following methods:
    4. IF_EX_CRM_SAF_KB~GET_ATTRIBUTE_VALUES
      Required only if you want to carry out attribute searches in the Interaction Center WebClient knowledge search, where this method is used to display attributes and attribute values which can be selected by agents
      The attributes should be characteristic so that a user can easily understand the attribute description and the attribute values. The number of values provided by the method should be relatively small so that they can be displayed in a dropdown box on the user interface. For example, a problem type would be a good candidate, but not a problem number.
      IF_EX_CRM_SAF_KB~GET_ATTRIBUTE_SEARCH_RETURN
      Required only if you want to return a set of attribute values with the hit list returned by the search engine. The attribute names should match the names compiled into the search index.
      IF_EX_CRM_SAF_KB~RETRIEVE_BATCH
      Required
      This method is designed to retrieve a set of knowledge entity IDs from a sequential index range, for example, to return a list of knowledge entity IDs located between positions 125 to 175 in a product list for entities, or to return a list with size 50 from position 125.
      A knowledge entity ID can be a sequential number defined via SAP's number range, or a globally unique identifier (GUID). If the knowledge entity ID is defined via a number range, the retrieval from and to positions can be the same values as the knowledge entity ID. If the knowledge entity ID is a GUID, the retrieval from and to positions should be a sequential index internally determined by the codes. Examples are provided for both cases.
      This method is used by the compilation service to retrieve knowledge entities in batches so that the compilation server can process many entities (for example, 50,000 knowledge entities) batch by batch without overloading the server's memory.
      Note
      Import parameter IV_PREV_KB_ID represents the last previously processed knowledge entity ID. If the value is not empty, the next set of knowledge entity IDs to be retrieved will begin with the ID following the last previously processed ID. For example, if the last previously processed knowledge entity ID is 100, the next batch to be retrieved will begin with 101. This parameter is used to resume process if an indexing process failed during previous indexing, and to support parallel processing when an indexing job is divided into multiple sub-jobs.
      IF_EX_CRM_SAF_KB~RETRIEVE_DETAIL
      Required
      This method is designed to retrieve detail information for individual knowledge entities, that is, for individual combinations of knowledge entity ID and language key. The output information includes a set of attributes as name/value pairs, a table of text lines as free-text descriptions, and a short text description.
      Since a knowledge entity can contain more than one business object or even have a hierarchical structure from multiple database tables, an attribute may have multiple values. In such cases, multiple values can be concatenated for an attribute and separated by commas.
      IF_EX_CRM_SAF_KB~GET_ATTRIBUTE_DEFINITIONS
      Required only if you want to define grouped attributes. For example, you can define a group Phone to include multiple attributes and values from country code, area code, home phone number, and business phone number. Then, all the attributes are treated as a group. Once the group is defined, you can search home phone alone or a home phone number in combination with the area code.
  3. Create XSL transformations for detail displays.

    This step is optional, but recommended to improve the usability of the new knowledge base. In the IC WebClient, the XSL transformation for HTML is used for detail display in the knowledge search. Also in the IC WebClient, the XSL transformation for texts is used to display the cart content pushed from the knowledge search to the e-mail editor. If no customizing transformations are created, the default transformations are used.

    1. Go to the Object Navigator (transaction SE80).
    2. Create an XSL transformation with a name by right-clicking the package name and choosing Create -> More... -> XSL Transformation.
    3. Edit the XSL that transforms an XML to an HTML (see example XSL_KB_SAP in package EI_SAF_KB).
    4. Create a second XSL transformation with a name.
    5. Edit the XSL that transforms an XML to a text format (see example XSL_KB_SAP_TEXT in package EI_SAF_KB).
  4. Name and configure the new knowledge base.

    In Customizing, go to Name and Configure Knowledge Base.

    In Name and Configure Knowledge Base, remember to enter the names of the two XSL transformations in the Basic Settings step.

  5. Associate the Add-In with the knowledge base name.
    1. In Customizing, go to the Business Add-In BAdI: Knowledge Bases.
    2. Select the name of the Add-In implementation from step 1 and choose Change.
    3. On the Attributes tab page, define a filter by selecting the knowledge base name defined
Business Attributes
ASAP Roadmap ID 204   Establish Functions and Processes 
Mandatory / Optional 2   Optional activity 
Critical / Non-Critical 2   Non-critical 
Country-Dependency A   Valid for all countries 
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20050421 
SAP Release Created in 600