LeverX ABAP Basics - Using The TREX Search Component

12
Essential SAP Tutorial SAP ABAP Basics: Using TREX Quick Search In Custom Developments By John DeGrandchamp Copyrighted 2012 by LeverX, Inc. 1

description

Provide a basic overview of TREX search and it capabilities, including using method query_result_by _select_option from class /plmb/cl_sea_query_api to retrieve results via your own custom ABAP programs.

Transcript of LeverX ABAP Basics - Using The TREX Search Component

Page 1: LeverX ABAP Basics - Using The TREX Search Component

1

Essential SAP Tutorial

SAP ABAP Basics: Using TREX Quick SearchIn Custom DevelopmentsBy John DeGrandchamp

Copyrighted 2012 by LeverX, Inc.

Page 2: LeverX ABAP Basics - Using The TREX Search Component

Tutorial Goal

Get a basic overview of TREX search and it capabilities TREX is the primary search technology currently used in SAP

components Learn the framework to implement TREX quick search in a custom

development This will enable a quicker, more flexible search than standard function

modules

2 Copyrighted 2012 by LeverX, Inc.

Page 3: LeverX ABAP Basics - Using The TREX Search Component

SAP TREX Search Overview

TREX has the ability to search structured business data as well as unstructured documents

TREX provides the backend technology for Enterprise Search TREX has several different search modes including: exact, linguistic, fuzzy

(search error tolerant), wildcards, phrase search, and Boolean operators TREX consists of an ABAP client and a JAVA client

The JAVA client communicates with non-SAP applications

3 Copyrighted 2012 by LeverX, Inc.

Page 4: LeverX ABAP Basics - Using The TREX Search Component

Open Transaction SE38

4 Copyrighted 2012 by LeverX, Inc.

Enter your desired name for the program

Press the create button

Page 5: LeverX ABAP Basics - Using The TREX Search Component

5

Enter a title, program type, program status, application, and press save

Save as a local object or to appropriate package

Enter Program Attributes

21 July 2012 Copyrighted 2012 by LeverX, Inc.

Page 6: LeverX ABAP Basics - Using The TREX Search Component

6

Create data variables to communicate with method and display result

Create a parameter for user to enter quick search

Create Necessary Data Declarations

Copyrighted 2012 by LeverX, Inc.

Page 7: LeverX ABAP Basics - Using The TREX Search Component

Call Method For Quick Search

7

Call method query_result_by _select_option from class /plmb/cl_sea_query_api using the pattern button

The object type tells the method where to look in the TREX index

Copyrighted 2012 by LeverX, Inc.

Page 8: LeverX ABAP Basics - Using The TREX Search Component

8

The pattern button can be used to assist in writing code for items such as function modules, select statements, write statements, and methods

In our case we will select ‘ABAP Object Patterns’ and enter values as shown

Pattern Button

Copyrighted 2012 by LeverX, Inc.

Page 9: LeverX ABAP Basics - Using The TREX Search Component

9

Loop the results table into a work area

Write the desired fields onto the screen

Write Results To Screen

Copyrighted 2012 by LeverX, Inc.

Page 10: LeverX ABAP Basics - Using The TREX Search Component

10

Selection Screen and Result Screen

Copyrighted 2012 by LeverX, Inc.

Page 11: LeverX ABAP Basics - Using The TREX Search Component

Conclusion

11 Copyrighted 2012 by LeverX, Inc.

You have now written a program that utilizes the TREX quick search capability

This allows users a much more flexible search format than using a standard function module

It is also much faster when searching large amounts of records because it does not access the database

Page 12: LeverX ABAP Basics - Using The TREX Search Component

Contact Information

Please contact us for more information about our services or solutions available.

LeverX, Inc. 800 West El Camino Real, Suite 180

Mountain View, CA 94040 USATel: (650) 625 – 8347

Web Site: www.LeverX.com12 Copyrighted 2012 by LeverX, Inc.