Get Example source ABAP code based on a different SAP table
ID DYNPRO% • SET CURSOR - dynpro ABAP Statement
SET CURSOR>, Dynpro Short Reference >
ABAP_SYNTAX SET CURSOR ${ ${ FIELD field $[LINE line$] $[$[DISPLAY$] OFFSET off$] $}> $| ${ col lin $} $}.>
ABAP_ALTERNATIVES: 1 ... FIELD field $[LINE line$] $[$[DISPLAY$] OFFSET off$]> 2 ... col lin>
What does it do? During PBO> processing, this statement sets the cursor in the screen layout> of the current dynpro>. The cursor can be positioned by specifying a screen element after FIELD> or by specifying the absolute positions col> and lin>. Outside of PBO processing, the cursor is positioned in the next list> displayed on the screen. If the statement SET CURSOR> is not specified, the cursor is set according to the following hierarchy, depending on the definition of the dynpro: on the cursor position determined statically in the dynpro properties, on the first input field of the dynpro, on the first screen element of the dynpro, on the command field in the system toolbar>. The latter also applies if the command field in the system toolbar is not displayed. • FIELD SET CURSOR - dynpro • LINE SET CURSOR - dynpro • DISPLAY OFFSET SET CURSOR - dynpro • OFFSET SET CURSOR - dynpro
ABAP Alternative 1 ... FIELD field $[LINE line$] $[$[DISPLAY$] OFFSET off$]>
What does it do? The cursor is positioned on the screen element whose name is contained in uppercase letters in field>. The data object field> must be character-like and flat>. The screen layout or a table control> is scrolled in the display so that the screen element on which the cursor is positioned is visible. If the specified screen element is not found, the statement is ignored. If the specified screen element is part of a table control or a step loop>, the line of the table control or group of the step loop in which the cursor is positioned on the specified screen element must be specified using the addition LINE >. The data object line> expects the type i>. If there is no row or group for the value of line>, or the addition LINE > is not specified, the statement is ignored. The statement is also ignored if the addition LINE> is specified and the screen element is not part of a table control or step loop. If the addition OFFSET> is not specified, the cursor is set to the first position of the screen element. Using the addition OFFSET>, the cursor can be set to the position in a screen element entered in off>, where the counter begins at 0. The position of the cursor is only visible in input/output fields. In other screen elements, the whole element is selected. The data object off> expects the type i >. If the value of off> is greater than the length of the screen element, the addition is ignored. If the value of off> is negative, the cursor is positioned at the end of the screen element. The addition DISPLAY > is standard and can be omitted.
ABAP Alternative 2 ... col lin>
What does it do? The cursor is positioned in the column specified in col> and the line specified in lin> in the screen layouts, if a screen element exists in this position that is not part of a table control> or tabstrip control>. col> and lin> expect data objects of the type i>. The counting of the columns starts at 2. If the screen element is not an input/output field, the entire element is selected. If no screen element is available at the specified positions, or if the cursor is positioned in a table control or tabstrip control, or if negative values are entered in col> or lin>, the statement is ignored.