SAP RS_TREE_SET_CURRENT_LAYOUT Function Module for Set layout with marked cursor position
RS_TREE_SET_CURRENT_LAYOUT is a standard rs tree set current layout SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Set layout with marked cursor position processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for rs tree set current layout FM, simply by entering the name RS_TREE_SET_CURRENT_LAYOUT into the relevant SAP transaction such as SE37 or SE38.
Function Group: SEUT
Program Name: SAPLSEUT
Main Program: SAPLSEUT
Appliation area: S
Release date: 03-Nov-1994
Mode(Normal, Remote etc): Normal Function Module
Update:
Function RS_TREE_SET_CURRENT_LAYOUT pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'RS_TREE_SET_CURRENT_LAYOUT'"Set layout with marked cursor position.
EXPORTING
* CURSOR_COLUMN = 3 "Current column line of the cursor
* CURSOR_LINE = 2 "Current line item of the cursor
* FIRST_NODE = 1 "Root node of the displayed list
* FIRST_NODE_TYPE = ' ' "Cat. of the root node (for consistency check)
* LIST_COLUMN = 1 "First displayed column of the list
* LIST_LINE = 1 "First displayed line of the list
* LAYOUT_MODE = STREE_LAYOUT_NORMAL "Layout mode
IMPORTING
INCONSISTENT_LAYOUT = "Layout contains errors
TABLES
* LAYOUT = "Layout of the hierarchy (amortization degree)
IMPORTING Parameters details for RS_TREE_SET_CURRENT_LAYOUT
CURSOR_COLUMN - Current column line of the cursor
Data type: SY-CUCOLDefault: 3
Optional: Yes
Call by Reference: No ( called with pass by value option)
CURSOR_LINE - Current line item of the cursor
Data type: SY-CUROWDefault: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIRST_NODE - Root node of the displayed list
Data type:Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIRST_NODE_TYPE - Cat. of the root node (for consistency check)
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LIST_COLUMN - First displayed column of the list
Data type: SY-STACODefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
LIST_LINE - First displayed line of the list
Data type: SY-STARODefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
LAYOUT_MODE - Layout mode
Data type: STREE_LAYOUT_MODEDefault: STREE_LAYOUT_NORMAL
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RS_TREE_SET_CURRENT_LAYOUT
INCONSISTENT_LAYOUT - Layout contains errors
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RS_TREE_SET_CURRENT_LAYOUT
LAYOUT - Layout of the hierarchy (amortization degree)
Data type: SEUTEXPANDOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RS_TREE_SET_CURRENT_LAYOUT Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lt_layout | TYPE STANDARD TABLE OF SEUTEXPAND, " | |||
lv_cursor_column | TYPE SY-CUCOL, " 3 | |||
lv_inconsistent_layout | TYPE SY, " | |||
lv_cursor_line | TYPE SY-CUROW, " 2 | |||
lv_first_node | TYPE SY, " 1 | |||
lv_first_node_type | TYPE SY, " SPACE | |||
lv_list_column | TYPE SY-STACO, " 1 | |||
lv_list_line | TYPE SY-STARO, " 1 | |||
lv_layout_mode | TYPE STREE_LAYOUT_MODE. " STREE_LAYOUT_NORMAL |
  CALL FUNCTION 'RS_TREE_SET_CURRENT_LAYOUT' "Set layout with marked cursor position |
EXPORTING | ||
CURSOR_COLUMN | = lv_cursor_column | |
CURSOR_LINE | = lv_cursor_line | |
FIRST_NODE | = lv_first_node | |
FIRST_NODE_TYPE | = lv_first_node_type | |
LIST_COLUMN | = lv_list_column | |
LIST_LINE | = lv_list_line | |
LAYOUT_MODE | = lv_layout_mode | |
IMPORTING | ||
INCONSISTENT_LAYOUT | = lv_inconsistent_layout | |
TABLES | ||
LAYOUT | = lt_layout | |
. " RS_TREE_SET_CURRENT_LAYOUT |
ABAP code using 7.40 inline data declarations to call FM RS_TREE_SET_CURRENT_LAYOUT
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single CUCOL FROM SY INTO @DATA(ld_cursor_column). | ||||
DATA(ld_cursor_column) | = 3. | |||
"SELECT single CUROW FROM SY INTO @DATA(ld_cursor_line). | ||||
DATA(ld_cursor_line) | = 2. | |||
DATA(ld_first_node) | = 1. | |||
DATA(ld_first_node_type) | = ' '. | |||
"SELECT single STACO FROM SY INTO @DATA(ld_list_column). | ||||
DATA(ld_list_column) | = 1. | |||
"SELECT single STARO FROM SY INTO @DATA(ld_list_line). | ||||
DATA(ld_list_line) | = 1. | |||
DATA(ld_layout_mode) | = STREE_LAYOUT_NORMAL. | |||
Search for further information about these or an SAP related objects