Escolar Documentos
Profissional Documentos
Cultura Documentos
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.
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
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
Enhancement Implementation
ZESH_BUPA
ESH_CONTENT_BC_BUPA
Implementing Class
ZCL_BUPA
CL_ESH_BADI_BC_BUPA
SAP_BASIS
SAP_BASIS
Object Type ID
BC_BUSINESS_PARTNER
BC_BUSINESS_PARTNER
The following sections describe how to create and implement this interface.
Creating the Implementation
1.
2.
3.
4.
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.
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.
= IV_SOFTWARE_COMPONENT,
= IV_NO_CHANGEPOINTER_SUPPORT
= IV_OBJECT_TYPE_ID
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
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:
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).
Example:
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:
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)
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
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.
= IV_HOME_SOFTWARE_COMPONENT
= IV_NO_CHANGEPOINTER_SUPPORT
= IV_OBJECT_TYPE_ID
= IV_SOFTWARE_COMPONENT
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
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. 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.
7. Choose With Variant, enter your variant (see step 3), and choose OK.
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>
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.
Related Content
For more information, visit the Search homepage.
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.