Você está na página 1de 22

Developers Guide: Enabling

Business Objects for Embedded


Search

Applies to:
SAP Business Suite Systems based on SAP NetWeaver 7.01 and higher. For more information, visit the
Search homepage.

Summary
As part of the AS ABAP, the Embedded Search serves SAP Business Suite applications such as SAP ERP,
SAP CRM, SAP PLM, and SAP SRM as basic search technology. Embedded search enables every SAP
Business Suite application to search in a unified way inside all its structured data. Embedded Search
contains business content that can be used immediately and tools for creating and changing search models.
When enabling a new object for Embedded Search or enhancing the application model of an existing object,
there is more than just the search modeling involved. This document describes the complete process of
enabling a new or enhanced business object for the search using the Business Partner Core object as an
example.
Author:

Tatjana Janssen

Company: SAP AG
Created on: 31 October 2011

Authors Bio
Tatjana Janssen is with SAP since 2003. She started with developing the Search Engine Service (SES), the
predecessor technology of Embedded Search. She also developed the full text search feature on DMS
Document Info Records (DRAW). Her latest project is the enablement of the Business Partner object for
Embedded Search. She is a member of the SAP Enterprise Search development team in Walldorf, Germany.

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


1

Developers Guide: Enabling Business Objects for Embedded Search

Table of Contents
Introduction ......................................................................................................................................................... 3
1 Enabling a New Business Object for Enterprise Search ................................................................................. 4
1.1 Creating a Search Model for the Business Object .................................................................................... 4
1.2 Implementing the BAdI for the Extraction Process ................................................................................... 4
1.3 Creating a Connector and Starting the Extraction .................................................................................. 11
1.4 Executing a Search ................................................................................................................................. 12
2 Enhancing the Existing Business Partner Core Object ................................................................................. 12
2.1 Modeling the Enhancements in Enterprise Search ................................................................................. 13
2.2 Implementing the Enhancements BAdI................................................................................................... 14
2.3 Creating a Connector and Starting the Extraction .................................................................................. 17
2.4 Executing a Search ................................................................................................................................. 17
3 Authorization Concept ................................................................................................................................... 18
4 Debugging the Extraction and the Search Process ....................................................................................... 18
4.1 Debugging the Extraction ........................................................................................................................ 18
4.2 Debugging the Search ............................................................................................................................ 19
5 Troubleshooting ............................................................................................................................................. 20
Related Content ................................................................................................................................................ 21
Copyright........................................................................................................................................................... 22

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


2

Developers Guide: Enabling Business Objects for Embedded Search

Introduction
As part of the AS ABAP, the Embedded Search serves SAP Business Suite applications such as SAP ERP,
SAP CRM, SAP PLM, and SAP SRM as basic search technology. Embedded search enables every SAP
Business Suite application to search in a unified way inside all its structured data. Embedded Search
contains business content that can be used immediately and tools for creating and changing search models.
When enabling a new object for Embedded Search or enhancing the application model of an existing object,
there is more than just the search modeling involved. This document describes the complete process of
enabling a new or enhanced business object for the search using the Business Partner Core object as an
example.
In addition, this document describes how to analyze problems, for example, by debugging the extraction and
search processes.
In this documentation we use example names for technical objects that you can find in recent systems under
the following names (SAP NetWeaver 7.03 and higher):
Technical Object

Example in the Documentation

Object in the Standard Delivery

Enhancement Implementation

ZESH_BUPA

ESH_CONTENT_BC_BUPA

Implementing Class

ZCL_BUPA

CL_ESH_BADI_BC_BUPA

Software Component (SWC)

SAP_BASIS

SAP_BASIS

Object Type ID

BC_BUSINESS_PARTNER

BC_BUSINESS_PARTNER

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


3

Developers Guide: Enabling Business Objects for Embedded Search

1 Enabling a New Business Object for Enterprise Search


1.1 Creating a Search Model for the Business Object
The first step is to model the object in Enterprise Search.
For modeling the business object use the following standard documentation:
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/b6/e51604ca9a480bb8d58111a837b4ae/frameset.htm

1.2 Implementing the BAdI for the Extraction Process


The implementation of the following BAdI is required for extracting the object data.

Enhancement spot: BADI_ESH_IF_OBJECT_DATA


Interface to be implemented: IF_BADI_ESH_IF_OBJECT_DATA

The following sections describe how to create and implement this interface.
Creating the Implementation
1.
2.
3.
4.

Start transaction SE19.


Select New BADI.
As Enhancement Spot enter BADI_ESH_IF_OBJECT_DATA.
Choose Create Impl.

5. On the Create Enhancement Implementation pop-up, enter a name, for example ZESH_BUPA, and
a short text. Leave the Composite Enhancement Implementation field blank and choose ok.

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


4

Developers Guide: Enabling Business Objects for Embedded Search

6. On the Create BAdI Implementation for specific BAdI Definition pop-up, enter a name for the
implementation, for example ZESH_BUPA, and an implementation class, for example ZCL_BUPA.
As BAdI Definition, enter BADI_ESH_IF_OBJECT_DATA and choose create.

Defining the Filter of ZESH_BUPA


The filter is required for setting a sequence of calls of the different models in Enterprise Search.
Go to the BAdI Implementation of ZESH_BUPA and enter the following filter values:
<Soft. Component, for example SAP_BASIS>

= IV_SOFTWARE_COMPONENT,

= IV_NO_CHANGEPOINTER_SUPPORT

<Object Type ID, for example BC_BUSINESS_PARTNER>

= IV_OBJECT_TYPE_ID

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


5

Developers Guide: Enabling Business Objects for Embedded Search

Implementing the Methods of IF_BADI_ESH_IF_OBJECT_DATA


Method IF_BADI_ESH_IF_OBJECT_DATA~NEXT
The NEXT method is required for the full indexing process. The full indexing process is executed in the
following cases:

For initial extraction of the data


After a substantial modification of the model
After an index corruption

This method is called repeatedly during initial indexing (or for every extraction if no delta extraction is
supported). It must be called until the complete set of available objects is extracted.
The data is extracted and indexed in packages. With every call of the NEXT method you must provide the
next data package. The NEXT method is called in a loop until you indicate that there is no more data to
extract. After extracting a data package the package is indexed immediately.
In the NEXT method, a package size is provided that specifies the maximum number of objects to be
extracted per package. The default value is 10.000. However, you may override the default value if required.
For example a package size of 100 might be safer when indexing objects with attached files.

When you start extracting, from the second call on, the last object ID of the previous data package is
provided. So you can easily determine the starting point of the next data package. Apart from providing the
data package you must also provide the last object ID of the previous data package. This value is used in the
next call of the NEXT method.
If the implementation of the method detects that all data is extracted, the parameter EV_NO_MORE_DATA
must be set to indicate that no more data is available for extraction.
The extracted data itself should be added to dynamic tables provided by the extraction framework (one table
for each object node).
The method has the following parameters:
Parameter IV_LAST_OBJECT_ID
With this parameter, the last object ID of the previous call of the NEXT method is provided. If this parameter
is empty, data extraction starts from the beginning of the data inventory.
Parameter IV_PACKAGE_SIZE
This integer parameter specifies the maximum amount of objects to be extracted in this call. It may be
ignored by the implementer of the extraction class if he thinks a different value is more appropriate in his
case.
Parameter IT_OBJECT_EXTRACTION
This import table generally contains one line per node of the object type that is to be extracted. It is also the
table in which you must store the extracted data. It contains the following columns:

NODE_TYPE_ID
Identifier of the node
MULTI_VALUE
Obsolete
FIELDS
Table containing the fields that are requested for the corresponding node. Each line of this table
represents a column in the dynamic table contained in column MODIFY_TABLE_REF (see below).
SELECT_OPTIONS
Can be ignored in BAdI implementations.
MODIFY_TABLE_REF
Contains a reference to a dynamic table. The dynamic table is a standard table with the columns

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


6

Developers Guide: Enabling Business Objects for Embedded Search

specified by parameter FIELDS. The table is provided empty and it is the major task of the respective
BAdI implementation to fill this table with the extracted data.
DELETE_TABLE_REF
Contains a reference to a second dynamic table that looks exactly like the table referred to by
MODIFY_TABLE_REF. The DELETE_TABLE_REF pointer is bound for the root node only. Object
keys specified in this table will be de-indexed from TREX. This parameter is to be ignored in the
NEXT method.

Parameter ET_MESSAGES
This export table can be filled by BAdI implementations with BAPIRET messages if any relevant information
occurs during extraction. If you raise an exception, add this table to the exception.
Parameter EV_NO_MORE_DATA
This ABAP_BOOL boolean must be set to ABAP_TRUE if the last data package is extracted.
Parameter EV_LAST_OBJECT_ID
This parameter must contain the ID of the last object in the currently extracted data package. Typically this is
the object ID contained in the last line of the dynamic table referenced by MODIFY_TABLE_REF of the root
node.
Exception CX_ESH_IF_PROVIDER_ERROR
This exception can be raised by BAdI implementations if a serious problem occurs.
Service Class CL_ESH_IF_GENERIC_DB_ITERATOR
This class can be used to simplify the implementation of the NEXT method. The class is used to iterate
conveniently over any DB table even if the DB table has more than one key component.
Example:

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


7

Developers Guide: Enabling Business Objects for Embedded Search

(Source code from class CL_ESH_BADI_BC_BUPA, method IF_BADI_ESH_IF_OBJECT_DATA~NEXT)


Method IF_BADI_ESH_IF_OBJECT_DATA~GET_DATA
This method is used for the delta data extraction.
The method requires that change pointers were provided for created, changed and deleted objects using
CL_ESH_IF_DATA_PROVIDER_TOOLS=>SET_CHANGEPOINTER(S). For more information about writing
the change pointers, see section Setting Change Pointers below.
The GET_DATA method is called to provide a list of object IDs that specify the objects to be extracted.
Embedded Search determines the list of object IDs by selecting change pointers that were provided since
the initial extraction or the last delta extraction. The extracted data itself must be added to dynamic tables
(one table for each object node). Object IDs of deleted objects must be added to the dynamic delete table of
the root node.
The method has the following parameters:
Parameter IT_OBJECT_IDS
This import table contains the list of relevant object IDs. The BAdI implementation must provide the data
belonging to these object IDs.
Parameter IT_OBJECT_EXTRACTION
This import table generally contains one line per node of the object type to be extracted. It is also the table in
which you must store the extracted data. It contains the following columns:

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


8

Developers Guide: Enabling Business Objects for Embedded Search

NODE_TYPE_ID
Identifier of the node
MULTI_VALUE
Obsolete
FIELDS
Table that contains the fields requested for the corresponding node. Each line of this table
represents a column in the dynamic table contained in column MODIFY_TABLE_REF (see below).
SELECT_OPTIONS
Can be ignored in BAdI implementations.
MODIFY_TABLE_REF
Contains a reference that points to a dynamic table. The dynamic table is a standard table with the
columns specified by parameter FIELDS. The table is provided empty and it is the major task of the
respective BAdI implementation to fill this table with extracted data.
DELETE_TABLE_REF
Contains a reference to a second dynamic table that looks exactly like the table referred to by
MODIFY_TABLE_REF. The DELETE_TABLE_REF pointer is bound for the root node only. Object
keys specified in this table will be de-indexed from TREX.

If an error occurs during the extraction of an object that causes the termination of the extraction process, the
current object will not be indexed, and you will not be called for a further object.
Parameter ET_OBJECT_FEEDBACK
This export table can be filled to return instance-specific feedback for the requested object IDs.
If all IDs you received in IT_OBJECT_IDs have been extracted successfully you do not have to fill this table.
Add a feedback entry for every ID that could not be extracted. The table contains the following columns:

OBJECT_ID
Pass the object ID of the record that could not be extracted.
SET_TO_COMPLETED
Mark this field if it is ok that the record could not be extracted, the record will then be set to
completed, and you will not be asked for it any more on the next indexing run.
CHANGE_TO_DELETED
Mark this field if the record could not be extracted (as insert or update) because it has been deleted
in the mean time, and you have included it into the DELETE_TABLE_REF instead of the
MODIFIED_TABLE_REF.
EXTRACTION_FAILED
Mark this field if the record could not be extracted due to an error pertaining to this object ID only.
You can also add a message using the included BAPIRET structure. Failed extractions of individual
records do not cause the overall extraction process to terminate.
RETRY_EXTRACTION
Mark this field if the record could not be extracted due to a temporary issue and you want to be
asked for the ID again on the next extraction run.

Exception CX_ESH_IF_PROVIDER_ERROR
This exception can be raised by BAdI implementations if a serious problem occurs.
Service class CL_ESH_IF_GENERIC_DB_ITERATOR
This class can be used to simplify the implementation. The class is used to iterate conveniently over any DB
table even if the DB table has more than one key component. The implementation of this method here is
similar to its implementation in the NEXT method (see above).

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


9

Developers Guide: Enabling Business Objects for Embedded Search

Example:

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


10

Developers Guide: Enabling Business Objects for Embedded Search

(Source code from class CL_ESH_BADI_BC_BUPA, method


IF_BADI_ESH_IF_OBJECT_DATA~GET_DATA)
Setting Change Pointers
If the model is supposed to support delta extraction, you must inform Embedded Search when objects are
created, changed or deleted.

The changes should be forwarded just before the changes are committed to the database
In a post process, the changes shall be provided at the end.
Call method CL_ESH_IF_DATA_PROVIDER_TOOLS=>SET_CHANGEPOINTER
The method SET_CHANGEPOINTERS is the mass enabled version of SET_CHANGEPOINTER

Example:

1.3 Creating a Connector and Starting the Extraction


Creating a Connector
The next step is to create a search connector.
Note: The Business Partner models delivered in the SAP_BASIS software component (SWC) are used as a basis for
further enhancement by specialized solutions, for example industry solutions. To create connectors, you cannot
use these models directly, but only after including them in another SWC, where they can be enhanced. This is a
general restriction of the models in SAP_BASIS.

So before creating connectors for Business Partner, Person, Organization, or Group, include SAP_BASIS in
another SWC, for example ZSAP_BASIS. After that, create the connectors from ZSAP_BASIS.
While a connector is created in the background, TREX indexes (physical, logical and shared indexes) are
created that are required for the actual search.
To create the connector, proceed as follows:
1. Start transaction ESH_COCKPIT and choose Create.
The Connection Wizard is started.
2. Select the Connector Type, for example SAP BO Search.
3. Select the Back-end System, for example ES1.
4. Select the UI Technology, for example SAP GUI.
5. Select the Connector Models.
First select the Software Component that contains your application model, for example
ZSAP_BASIS. All application models of the current software component are displayed.
In the Business Partner case there are the following models:
- Business Partner (Application Model)
- Person (Virtual Model)
- Organization (Virtual Model)
- Group (Virtual Model)

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


11

Developers Guide: Enabling Business Objects for Embedded Search

6. Check the summary and choose Finish


The connector is being created in the background. On the administration cockpit UI the connector has the
status NEW.
To get more information about the job that is creating the connector, use transaction SM37. As soon as the
job is finished the connector has the status Prepared on the cockpit UI. You can refresh the cockpit window
for getting the up-to-date status.
Starting the Extraction Process
The extraction process is required for fetching the data from the data base and indexing them on the TREX
search engine.
1. Select the newly created connector, for example the Business Partner connector.
2. Choose Actions --> Schedule Indexing Process.
A pop-up is displayed, for example Schedule Indexing for Business Partner Core.
3. Choose Show Input Form.
4. Select the following:
- Start Time: Start Immediately
- Real-Time-Indexing (if your implementation supports it)
- All entries in the table
5. Choose Copy Settings and OK.
The extraction job is started in background.
To get more information about the job, use transaction SM37. As soon as the job is finished and the indexing
process has been successful, the connector gets the status Active. The connector is searchable now.
You can refresh the cockpit window for getting the new status.
Note: The connectors Person, Organization and Group will have the same number of optimized objects as Business
Partner Core, because they are only a view on the business partner connector.

1.4 Executing a Search


Valid from release 7.02.
1.
2.
3.
4.
5.

Start transaction ESH_SEARCH.


Choose Advanced Search.
Select for example Business Partner.
Enter a meaningful value in an attribute field.
Choose Search.

2 Enhancing the Existing Business Partner Core Object


This chapter describes how to enhance the already search-enabled Business Partner Core object of the
software component (SC) SAP_BASIS by an attribte.
In SAP Business Suite systems, there are the following three types of business partners:

Person
Organization
Group

All of them have some attributes which are common and each of them has some specific attributes which are
specific to this type.
Representation of the business partner types in the Modeler

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


12

Developers Guide: Enabling Business Objects for Embedded Search

In the Enterprise Search environment, the business partner is modeled as follows:

The business partner is modeled as an application model that contains all common attributes of the
different business partner types.
The different business partner types (person, organization, and group) are modeled using virtual
models that are similar to a view on the business partner application model. These virtual models
have the common and the type-specific attributes.

Representation in the Cockpit


In the Administration Cockpit, for each model (business partner, person, organization and group) a connector
is created. The connectors for person, organization, and group are views on the connector for the business
partner. Therefore the number of the optimized objects for person, organization and group are the same as
for business partner.
Representation on the Search UI
Valid from release 7.02.
On the search UI, you can find at least one request for each connector (the default request). If the models of
the corresponding connector have more than one request, you can find each connector with all requests on
the search UI.
Note: The existing model BC_BUSINESS_PARTNER can be extended by new nodes and fields. But it
cannot be changed or partly deleted, for example by removing nodes, request attributes, response attributes,
or relations.

2.1 Modeling the Enhancements in Enterprise Search


Creating a New Software Component
1. Start the search modeler (transaction ESH_MODELER)
2. Choose Software Components --> Maintain Software Component.
A pop-up is displayed.
3. Choose Create and define the new SC, for example as follows:
- New Software Component: for example ZSAP_BASIS_ENH
- Package: <package name>
- Soft. Comp. Type: Normal Software Component
- Soft. Comp. Reference: <blank>
4. Choose Save.
The new software component is created.
Including the Software Component SAP_BASIS
1. Select the created SC and choose Software Component --> Include Software Component.
A pop-up is displayed.
2. Select the SC SAP_BASIS and choose Select.
Enhancing the Application Model BC_BUSINESS_PARTNER
1. Navigate to the model on the following path:
ZSAP_BASIS_ENH --> SAP_BASIS --> BC --> BC-EIM --> BC-EIM-ESH -->
BC_BUSINESS_PARTNER
2. Select BC_BUSINESS_PARTNER and choose Edit.
A pop-up is displayed saying Do you want to enhance model 'BC_BUSINESS_PARTNER' of
software component 'SAP_BASIS' in software component 'ZSAP_BASIS_ENH'?
3. Choose Yes.
4. In the next 6 steps you can enhance the model:
Step 1: Model Properties
Step 2: Model Nodes

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


13

Developers Guide: Enabling Business Objects for Embedded Search

Step 3: Node Relations


Step 4: Node Requests
Step 5: Node Response
Step 6: Operational Data Provider
For more information, see the following documentation:
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/b6/e51604ca9a480bb8d58111a837b4ae/frames
et.htm
Note:

Create technical templates if required.


Add the text fields of the technical templates as request fields.
Add the text fields of the technical templates as response fields.

2.2 Implementing the Enhancements BAdI


The BAdI Implementation is required for extracting the object data. For enhancements of the basic Model,
use the following BAdI Interface:

Enhancement spot: BADI_ESH_IF_OBJECT_DATA


Interface: IF_BADI_ESH_IF_OBJECT_DATA_ENH

Creating the Implementation


1. Start transaction SE19 and select New BADI.
2. Enter the Enhancement Spot BADI_ESH_IF_OBJECT_DATA
3. Choose Create Implementation.
The pop-up Create Enhancement Implementation is displayed.
4. Enter the following:
- Enhancement Implementation: <Your implementation, for example ZESH_BUPA_ENH>
- Short text: <Some explaining text>
- Composite Enhancement Implementation: <blank>
The pop-up Create BAdI Implementation for specific BAdI Definition is displayed.
5. Enter the following:
- BAdI Implementation: <Your BAdI implementation, for example ZESH_BUPA_ENH>
- Impl. Class: <Your implementation class, for example ZCL_BUPA_ENH>
- BAdI Definition: IF_BADI_ESH_IF_OBJECT_DATA_ENH
6. Choose Create.
Note: You can use the screen shots about the BAdI implementation in chapter 1.2 above. The implementation process is
the same.

Defining the Filter of the BAdI Implementation


The filter defines the sequence of the software component calls. In our case this is important to extract the
data of the core business partner first and after that its enhancements.
To define the filter, go to the BAdI implementation of ZESH_BUPA_ENH and enter the following filter values:
<Home Soft. Component, for example SAP_BASIS>

= IV_HOME_SOFTWARE_COMPONENT

= IV_NO_CHANGEPOINTER_SUPPORT

<Object Type ID, for example BC_BUSINESS_PARTNER>

= IV_OBJECT_TYPE_ID

<Software Component, for example ZSAP_BASIS_ENH>

= IV_SOFTWARE_COMPONENT

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


14

Developers Guide: Enabling Business Objects for Embedded Search

Implementing the Methods of IF_BADI_ESH_IF_OBJECT_DATA_ENH


Method IF_BADI_ESH_IF_OBJECT_DATA_ENH~NEXT
This method is used when the initial extraction is executed. For more information about the method, see
chapter 1.2, section Implementing the Methods of IF_BADI_ESH_IF_OBJECT_DATA. The importing and the
exporting parameters are the same.
Example:
In the following example there is a model enhanced by an additional sub-node DUMMY with one field
IS_PERSON. You add the new data to the extracted data as follows:

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


15

Developers Guide: Enabling Business Objects for Embedded Search

Method IF_BADI_ESH_IF_OBJECT_DATA_ENH~GET_DATA
This method is used for the delta extraction. It requires that change pointers have been written when an
object was created, changed or deleted. Change pointers are created using the following class:
CL_ESH_IF_DATA_PROVIDER_TOOLS=>SET_CHANGEPOINTER(S)
Note:

If the enhanced data of an object are changed, change pointers must be provided as well.
In this method, the enhanced data must be added for each OBJECT_ID from the table IT_OBJECT_IDS.
The implementation of this method is the similar to the following method:
IF_BADI_ESH_IF_OBJECT_DATA~GET_DATA

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


16

Developers Guide: Enabling Business Objects for Embedded Search

2.3 Creating a Connector and Starting the Extraction


Creating a Connector
The next step is to create a connector. During creation of the connector, TREX Indexes (physical, logical and
shared indexes) are created in the background. These indexes are required for the actual search.
To create the connector, proceed as follows:
1. Start transaction ESH_COCKPIT and choose Create.
The Connection Wizard is started.
2. Select the Connector Type, for example SAP BO Search.
3. Select the Back-end System, for example ES1.
4. Select UI Technology, for example SAP GUI.
5. Select the Connector Models.
First select the Software Component, for example ZSAP_BASIS_ENH. Here you can select all
models of this software component, for example Business Partner Core:
- Business Partner (Application Model)
- Person (Virtual Model)
- Organization (Virtual Model)
- Group (Virtual Model)
6. Check the summary and choose Finish.
The connector is being created in the background. On the cockpit UI, the connector has the status NEW.
To get more information about the job that is creating the connector, use transaction SM37. As soon as the
job is finished, the connector has the status Prepared on the cockpit UI. You can refresh the cockpit window
for getting the new status.
Starting the Extraction and Indexing
The extraction process is required for retrieving the data from the data base and indexing them on the TREX
search engine.
1. Select the newly created connector, for example the Business Partner connector.
2. Choose Actions --> Schedule Indexing Process.
A pop-up is displayed, for example Schedule Indexing for Business Partner Core.
3. Choose Show Input Form.
4. Select the following:
- Start Time: Start Immediately
- Real-Time-Indexing (if your implementation supports it)
- All entries in the table
5. Choose Copy Settings and OK.
The extraction job is started in background. To get more information about the job, use transaction SM37. As
soon as the job is finished and the indexing process has been successful, the connector has the status
Active.
The connector is searchable now. You can refresh the cockpit window for getting the up-to-date status.
Note: The connectors person, organization and group have the same number of optimized objects as business partner
core, because they are only views on the business partner connector.

2.4 Executing a Search


Valid from release 7.02.
1.
2.
3.
4.
5.

Start transaction ESH_SEARCH.


Choose Advanced Search.
Select for example Business Partner.
Enter a meaningful value in an attribute field.
Choose Search.

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


17

Developers Guide: Enabling Business Objects for Embedded Search

3 Authorization Concept
The authorization for searching certain objects is very important and has to be considered during the
modeling process. Normally in the SAP Business Suite environment the authorizations have to be
implemented and in the Enterprise Search environment they have to be modeled.
For more information how to do that, check the documentation about modeling a business object (chapter
1.1).

4 Debugging the Extraction and the Search Process


4.1 Debugging the Extraction
If there is an error during the extraction or indexing you can debug process as follows:
1. Start transaction ESH_COCKPIT
2. Select the connector, for example Business Partner Core
3. Go to the Job Log tab page.
Here you can find the variant in step 001. Note down the variant.

4. Set a session break point in the class that you want to debug.
5. Start transaction SE38.
6. Enter the program name ESH_IX_CRT_INDEX_OBJECT_TYPE.

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


18

Developers Guide: Enabling Business Objects for Embedded Search

7. Choose With Variant, enter your variant (see step 3), and choose OK.

The Selection screen is loaded for the corresponding variant.


8. Set the Indexing Mode 1 or 2.
You can change the package size for the debugging.

9. Choose F8 (execute).
4.2 Debugging the Search
Valid from release 7.03 or 7.31.
1. Set a break point, for example, where the search is executed:
In the class CL_ESH_TREX_SEARCH~ SEARCH_MODUS_720, set an external break point at the
following line:
193: mr_trex_proxy->bulk_search
2. Check lt_search_input and lt_search_output
3. Start transaction SE38.
4. Execute the program ESH_TEST_SEARCH.
5. Enter the following:
Connector ID: <Your connector ID, for example ES1000~BC_BUSINESS_PARTNER~>
Request: <Your request, for example Default>

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


19

Developers Guide: Enabling Business Objects for Embedded Search

Search Term: <A meaningful search term, for example a*>

6. Choose Execute.

5 Troubleshooting
I do not get any results.
Check if the connector is indexed, active and searchable:
1. Start transaction ESH_COCKPIT.
2. Select the corresponding connector.
3. Check the following columns for their values:
- Status = Active
- Search = X
- Optimized Objects > 0
Check if you have the required authorizations:
1.
2.
3.
4.
5.
6.

Start transaction SE38.


Execute the program ESH_TEST_SEARCH.
Select Expert Mode.
Enter your connector ID.
Select Debug Authorization.
Choose Execute.

I do not get the expected results.


The reason may be missing authorizations. Check this using the report ESH_TEST_SEARCH as described
above.

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


20

Developers Guide: Enabling Business Objects for Embedded Search

Related Content
For more information, visit the Search homepage.

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


21

Developers Guide: Enabling Business Objects for Embedded Search

Copyright
Copyright 2011 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9,
iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server,
PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes,
BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX,
Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems
Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of
Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts
Institute of Technology.
Java is a registered trademark of Oracle Corporation.
JavaScript is a registered trademark of Oracle Corporation, used under license for technology invented and implemented by Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned
herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and
other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document
serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP
Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the
express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an
additional warranty.

SAP COMMUNITY NETWORK


2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com


22

Você também pode gostar