SAP GET CURSOR LIST ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID DYNPRO%
• GET CURSOR - list ABAP Statement
• FIELD GET CURSOR - list
• LINE GET CURSOR - list

GET CURSOR, List
Short Reference

ABAP_SYNTAX
GET CURSOR ${ ${FIELD field $[ field_properties$]$}
$| ${LINE line $[ line_properties$]$} $}.

ABAP_VARIANTS:
1 GET CURSOR FIELD field $[field_properties$].
2 GET CURSOR LINE line $[line_properties$].

What does it do?
If this statement is specified in list processing, it passes the name of the output field or the number of the list line on which the screen cursor in the currently displayed list is positioned after the user action to the variables field or line, depending on how FIELD or LINE is specified. Further information on the cursor position can be read if required.
System Fields sy-subrcMeaning 0The cursor is on a field or a list line and the statement was executed successfully. 4The cursor is not on any field or any list line.

ABAP_VARIANT_1 GET CURSOR FIELD field $[field_properties$].

What does it do?
Returns the name of the output field in field after a user action on which the cursor is positioned in the currently displayed list. field expects a character-like variable. The addition field_properties can be used to read further information about the cursor position.
If the screen cursor is on a subarea of a structure that is output using an offset/length specification, the following rules apply:
The subarea of the structure was output using the name of the structure:
If the subarea includes the entire structure, the name of the structure is returned.
If the subarea only includes a part of the structure, the name of the component is returned in which the subarea begins.
The subarea of the structure has been displayed using the name of a component of the structure:
The name of the component is returned in which the subarea begins.
These rules also apply to substructures.
The addition FIELD can only be used to determine the names of global data objects of the ABAP program. If the cursor is positioned on the output of a data object that is not visible in the current context or a literal, field is initialized. This has no effect on the other additions or on sy-subrc.
If the cursor is on the output area of a data object that was accessed in the WRITE statement using a field symbol, the name of the data object is returned and not the name of the field symbol.

ABAP_VARIANT_2 GET CURSOR LINE line $[line_properties$].

What does it do?
Returns the number of the list line in line after a user action. This line is where the cursor is positioned in the currently displayed list. line expects a variable of type i. The addition line_properties can be used to read further information about the cursor position.

Return to menu