1. SET
CURSOR FIELD f.
2. SET
CURSOR LINE line.
3. SET CURSOR col line.
Sets the cursor dynamically in the display of a screen or list.
SET CURSOR FIELD f.
1. ... OFFSET
off
2. ... LINE line
Places the cursor dynamically at the start of the field g
which is specified in the field f. You must specify the name of the field in uppercase letters.
With step loops and in list processing, you also need the addition ... LINE line.
... OFFSET off
Offsets the cursor position by off columns from the start
of the field g which is specified in the field f (1st column = 0).
... LINE line
Places the cursor whose value is specified in field f
in the field
g of the loop line line
in a step loop. In list processing, the cursor is placed in the absolute
list line line (SY-LILLI).
1. Place the cursor on a screen field.
DATA f(5) TYPE C VALUE 'MODUS'.
DATA MODUS(10) TYPE C VALUE '1234567890'.
...
SET CURSOR FIELD F.
or
SET CURSOR FIELD 'MODUS'.
Both statements place the cursor at the beginning of the field MODUS.
SET CURSOR FIELD F OFFSET 2.
or
SET CURSOR FIELD 'MODUS' OFFSET 2.
Both statements place the cursor on the third character (in this case the digit "3") of the field MODUS.
...
2. Place the cursor at the beginning of a field when selecting a line in list processing.
MOVE 'MODUS' TO F.
MOVE '1234567890' TO MODUS.
DO 10 TIMES.
NEW-LINE.
POSITION
SY-INDEX.
WRITE MODUS.
ENDDO.
AT LINE-SELECTION.
SET CURSOR FIELD F LINE SY-LILLI.
or
SET CURSOR FIELD 'MODUS' LINE SY-LILLI.
Both statements place the cursor at the beginning of the field MODUS on this line when the user double-clicks.
SET CURSOR FIELD F LINE SY-LILLI OFFSET 2.
or
SET CURSOR FIELD 'MODUS' LINE SY-LILLI OFFSET 2.
Both statements place the cursor on the third character (in this case the digit "3") of the field MODUS on this line when the user double-clicks.
SET CURSOR LINE line.
Places the cursor dynamically in the loop line line with
step loops or in the absolute list line
line (SY-LILLI) in list processing. This variant is only possible with step loops and in list processing.
... OFFSET off
Places the cursor off columns from the beginning of the line.
Place the cursor at the beginning of the line when selecting a line in list processing.
DATA MODUS(10) VALUE '1234567890'.
DO 10 TIMES.
NEW-LINE. WRITE MODUS.
ENDDO.
AT LINE-SELECTION.
SET CURSOR LINE SY-LILLI.
This statement sets the cursor at the beginning of the line when the user double-clicks.
SET CURSOR LINE SY-LILLI OFFSET 2.
This statement sets the cursor on the third column (in this case the digit "3" of the field MODUS) on this line when the user double-clicks.
SET CURSOR col line.
Places the cursor dynamically on the column col and the line line of the current screen.
This variant of the statement SET CURSOR does not operate
on the cells of a table control or the fields of a tabstrip control, since different elements may exist at the absolute position col line.
SET CURSOR 60 5.
Positions the cursor on line 5, column 60.
Setting the Cursor Position
Setting the Cursor Position From a Program