Start of Content Area

Function documentationSET_SELECTION_INDEXES  Locate the document in its SAP Library structure

Use

Use this method to set a selection for a text area based on character index. The position is automatically placed within the visible section of the control.

Windows

HTML

Java

ü

X

ü

Features

call method textedit- >set_selection_indexes

  exporting
    from_index = from_index
    to_index = to_index

  exceptions
    error_cntl_call_method = 1.

Parameters

Description

from_index

Character index at which the selection begins. The index is relative to the first character in the control.

to_index

Character index at which the selection ends. The index is relative to the first character in the control.

Note

If the "from" and "to" character positions are the same, no text is selected, but the cursor is placed at the corresponding position.

You can make the selection invisible to the user as follows:

  1. Get the current cursor position
  2. Switch off the redraw function by calling the method AUTO_REDRAW and setting the ENABLE_REDRAW parameter to false.
  3. Set the required selection. Other actions may follow at this point.
  4. If required, set the old position.
  5. Reenable the automatic redraw by calling the method AUTO_REDRAW and setting the ENABLE_REDRAW parameter to true.