Show TOC

Finding and Replacing Source Code in the Corresponding Master ProgramLocate this document in the navigation structure

Use

You use this procedure in the editor to quickly find and replace every occurrence of a single word or string in the current source code or in the source code of the corresponding master program (global search).

Local Search

Procedure

  1. From the application toolbar of the ABAP Editor, choose  with the quick info text Find.

    The Find and Replace dialog box appears.

  2. In the Find field, enter the text that you want to search for.
  3. Select any other options you need:
    Search option Explanation

    As a string

    The system stops at the search string if it is a whole word or a part of a word.

    As a word

    The system stops at the search string only if it is a whole word.

    Case-sensitive

    The system stops at the search string only if it is written with the same combination of upper- and lowercase letters.

    In current source code:

    • From cursor
    • From line X to line Y

    Your search starts either from the current cursor position or is limited within a predefined search area.

    • Only include my inactive versions
    • Include all inactive versions

    In the first case, only your inactive versions of the development objects will be included in the search. In the second case, all inactive versions of all users on the system will be included in the search.

  4. Choose Continue.

    If the system finds the search string, it displays a hit list of the locations where it was found.

  5. Double-click the entry you want to see.

    The system places the cursor at the beginning of the line containing the string.

  6. To find the next occurrence of the search string, choose  with the quick info text Find Next.
Global Search

Procedure

  1. From the Edit menu, choose Find/Replace. 

    The Find and Replace dialog box appears.

  2. In the Find field, enter the text that you want to search for.
  3. Select any other options you need:
    Search option Explanation

    As a string

    The system stops at the search string if it is a whole word or a part of a word.

    As a word

    The system stops at the search string only if it is a whole word.

    Case-sensitive

    The system stops at the search string only if it is written with the same combination of upper- and lowercase letters.

    In current source code:

    • From cursor
    • From line X to line Y

    Your search starts either from the current cursor position or is limited within a predefined search area.

    • In main program
    • In program X

    If you want to search within the whole main program, select the option In main program. Otherwise, you search only within the source code currently displayed in the editor.

    • Only include my inactive versions
    • Include all inactive versions

    In the first case, only your inactive versions of the objects will be included in the search. In the second case, all inactive versions of all users on the system will be included in the search.

    Note
    • If you want to run a generic search, use the asterisk (*) to represent any number of characters. For example, if you enter st*r, the system will stop at both star and steer.
    • If you want to set a placeholder for a single character, use the plus sign (+). For example, if you enter st+r, the system would find star, but not steer.
    • Use the pound sign (#) as an escape character. For example, if you want to search for the string 1+2, enter 1#+2 as your search string.
  4. Choose Continue.

    If the system finds the search string, it displays a hit list of the locations where it was found.

  5. Double-click the entry you want to see.

    The system places the cursor at the beginning of the line containing the string.

  6. To find the next occurrence of the search string, choose  with the quick info text Find Next.
Replacing a String

Procedure

  1. From the Edit menu, choose Find/Replace. 

    The Find and Replace dialog box appears.

  2. In the Find field, enter the text that you want to search for.
  3. Select the Replace with option and enter the replace string.
  4. Enter any other options you need to restrict the search.
  5. Choose Continue.

    If the system finds the search string in the source code, it displays a hit list of the locations where it was found.

  6. Point to the first entry on the list and choose  with the quick info text Replace.
  7. If you are sure that you want to replace all occurrences of the search string, you can select the first entry on the hit list and press the button From cursor position w/o confirmation.