Start of Content Area

Function documentationFIND_AND_REPLACE  Locate the document in its SAP Library structure

Use

This method allows you to find and replace text.

Windows

HTML

Java

ü

X

ü

Features

call method textedit- >find_and_replace

  exporting
    case_sensitive_mode = case_sensitive_mode
    replace_string = replace_string
    search_string = search_string
    whole_word_mode = whole_word_mode

  changing
    string_found = string_found

  exceptions
    invalid_parameter = 1
    error_cntl_call_method = 2.

Parameters

Description

Possible values

case_sensitive_mode

Upper- and lowercase

true
Observe

false
Do not observe (default value)

replace_string

Text to replace occurrences of the search string

 

search_string

Text to be found/replaced

 

whole_word_mode

Only find whole words

true
Only find whole words

false
Find whole words and parts of words (default value)

This graphic is explained in the accompanying text string_found

Return value specifying how often the text was found

 

NoteIf you do not specify REPLACE_STRING or SEARCH_STRING, the system calls the Find and Replace dialog box.

If no text is selected, the search starts at the current cursor position. If text is selected, the search starts at the second character of the selection, but is not restricted to the selected text.

When it reaches the end of the text, the method returns to the beginning of the text. The text may thus be searched more than once.

CautionIf you want to replace all occurrences of a search string in a text, use the method REPLACE_ALL.