Show TOC

Searching ABAP Source CodeLocate this document in the navigation structure

In SAP NetWeaver 7.4 SP 5 and higher, the SAP HANA-based ABAP Source Search functionality enables you to find text that is contained in source-based repository objects (like classes, programs, function pools, and so on) as well as message classes of an ABAP project.

Prerequisites

Your ABAP system must be using a SAP HANA database.

Ensure to have at least 10 GB of free database memory before you switch on this business function. If the database memory is not enough, the ABAP system may become very slow or unusable. To provide the required space for the ABAP Source Search and its indexing, your SAP administrator needs to activate the SRIS_SOURCE_SEARCH business function in the Switch Framework (transaction code SFW5) of the corresponding ABAP system.

Context

You have two options for performing a search in ABAP source code:

  1. If you want to search within the entire ABAP system, select Start of the navigation path Search Next navigation step Search Next navigation step ABAP Source Search End of the navigation path from the menu or open the shortcut (Ctrl H).
  2. If you want to search within a certain development object, select a certain development object in the Project Explorer or open it in the source code editor and choose Search Content... from the context menu.

The same dialog is provided for both options. Proceed as follows:

Procedure

  1. In the following dialog box, choose the ABAP Source Search tab.
    Note If the recommended tab is not displayed, choose the Customize... button to select the corresponding one.
  2. In the ABAP Source Search tab, enter the text you wish to find in the Search Term field.
    Note

    In the Search Term field, the following operators are available to adjust your search criteria:

    Operator Description
    * (asterisk) You can add an asterisk '*' to search for all characters.
    OR Matches containing at least one of the terms joined by the OR operator are returned.
    - (minus) Matches that do not contain the term immediately following the minus sign are returned.
    "SEARCH_TERM" (quotation marks) Only exact matches for SEARCH_TERM are returned. Terms within quotation marks are not tokenized and are handled as a string.

    If you enter multiple search terms, the AND operator is automatically interpreted by default. As a consequence, only the repository objects are displayed that contain all search terms.

  3. [Optional:] In the Search Filter field, you can restrict the search by one or more:
    • ABAP packages
    • ABAP source-based development objects
    • Object types like clas, intf
    • Responsible User that is provided in the table TADIR, field AUTHOR
    Tip

    When editing the search filter, you can benefit from the content assistant functionality by pressing Ctrl + Space.

    If you want to select several ABAP packages and / or development objects, leave a space between the entries.

    Note Search filters currently do not support patterns like CL_*. You can only use complete identifiers.
  4. [Optional:] Move the Maximum number of results slider to limit the quantity of the results that are displayed in the Search view.
    Note You can define the number from 25 up to all search results.
  5. [Optional:] Choose the Browse... button for selecting the Project if you want to search in another ABAP project.
    Note By default, the current ABAP project is used.
  6. Choose Search to launch the search.

Results

If the text is found, the matching code snippets are displayed in the result list of the Search view. These code snippets are grouped according to their repository objects and packages. In addition the search term is highlighted.

From the results list, you can navigate to the repository object or source code position by using double-click. In addition, you can do the following:

  • Scroll to the next or previous match
  • Copy the content of the result to the clipboard
Tip In the Search view, you can choose the Open Search Dialog button from the tool bar to redefine the search.