SAP RSAT_CREATE_TREE Function Module for Creates and inits one tree control









RSAT_CREATE_TREE is a standard rsat create tree SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Creates and inits one tree control 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 rsat create tree FM, simply by entering the name RSAT_CREATE_TREE into the relevant SAP transaction such as SE37 or SE38.

Function Group: RSAT
Program Name: SAPLRSAT
Main Program: SAPLRSAT
Appliation area: B
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function RSAT_CREATE_TREE 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 'RSAT_CREATE_TREE'"Creates and inits one tree control
EXPORTING
OWNER_REPID = "
* REG_EVENT_EXPAND_NO_CHILDREN = "
* CALLBACKNAME_EXPAND_NO_CHILD = "
* REGISTER_EVENT_ITEM_DBL_CLICK = "
* CALLBACKNAME_ITEM_DBL_CLK = "
* REGISTER_EVENT_RMOUSE_DOWN = "
* CALLBACKNAME_RMOUSEDOWN = "
* LEFT = 0 "
* WIDTH = 65 "
* HEIGHT = 0 "
* ALIGNDEFAULT = RS_C_TRUE "
DYNNR = "
* ALIGNMENT = 0 "
* I_STRT_NAME = 'RSADMTXCOL' "
* I_HIERARCHY_HEADER = "
* HIDE_HIER = 0 "
* REGISTER_EVENT_BTN_CLICK = "
* CALLBACKNAME_BTN_CLICK = "
* AUTOHEADERWIDTH = RS_C_FALSE "
* ITEMHEIGHT = -1 "
* CONTROL_CONTAINER = ' ' "
* PARENT_ID = "
* RIGHT_OR_LEFT_ALIGN = 'L' "
* TOP = 0 "
* B_DROPALLOW = "
* CALLBACKNAME_DROP = "
* B_DRAG_ALLOW = "

CHANGING
TREEHANDLE = "

TABLES
* ADDCOLUMNS = "
* ADDHEADERS = "

EXCEPTIONS
CREATE_ERROR = 1 COLUMN_NOT_FOUND = 2
.



IMPORTING Parameters details for RSAT_CREATE_TREE

OWNER_REPID -

Data type: SY-REPID
Optional: No
Call by Reference: No ( called with pass by value option)

REG_EVENT_EXPAND_NO_CHILDREN -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

CALLBACKNAME_EXPAND_NO_CHILD -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

REGISTER_EVENT_ITEM_DBL_CLICK -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

CALLBACKNAME_ITEM_DBL_CLK -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

REGISTER_EVENT_RMOUSE_DOWN -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

CALLBACKNAME_RMOUSEDOWN -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

LEFT -

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

WIDTH -

Data type: I
Default: 65
Optional: Yes
Call by Reference: No ( called with pass by value option)

HEIGHT -

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

ALIGNDEFAULT -

Data type: C
Default: RS_C_TRUE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DYNNR -

Data type: SY-DYNNR
Optional: No
Call by Reference: No ( called with pass by value option)

ALIGNMENT -

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_STRT_NAME -

Data type: X030L-TABNAME
Default: 'RSADMTXCOL'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_HIERARCHY_HEADER -

Data type: TREEV_HDR
Optional: Yes
Call by Reference: No ( called with pass by value option)

HIDE_HIER -

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

REGISTER_EVENT_BTN_CLICK -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

CALLBACKNAME_BTN_CLICK -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

AUTOHEADERWIDTH -

Data type: RS_BOOL
Default: RS_C_FALSE
Optional: Yes
Call by Reference: No ( called with pass by value option)

ITEMHEIGHT -

Data type: I
Default: -1
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONTROL_CONTAINER -

Data type: C
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

PARENT_ID -

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

RIGHT_OR_LEFT_ALIGN -

Data type: C
Default: 'L'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TOP -

Data type: I
Optional: Yes
Call by Reference: No ( called with pass by value option)

B_DROPALLOW -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

CALLBACKNAME_DROP -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

B_DRAG_ALLOW -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHANGING Parameters details for RSAT_CREATE_TREE

TREEHANDLE -

Data type: RSATD_TREE_HANDLE
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for RSAT_CREATE_TREE

ADDCOLUMNS -

Data type: TREEV_COL
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDHEADERS -

Data type: TREEV_HDR
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

CREATE_ERROR -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

COLUMN_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for RSAT_CREATE_TREE 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_addcolumns  TYPE STANDARD TABLE OF TREEV_COL, "   
lv_treehandle  TYPE RSATD_TREE_HANDLE, "   
lv_owner_repid  TYPE SY-REPID, "   
lv_create_error  TYPE SY, "   
lv_reg_event_expand_no_children  TYPE C, "   
lv_callbackname_expand_no_child  TYPE C, "   
lv_register_event_item_dbl_click  TYPE C, "   
lv_callbackname_item_dbl_clk  TYPE C, "   
lv_register_event_rmouse_down  TYPE C, "   
lv_callbackname_rmousedown  TYPE C, "   
lv_left  TYPE I, "   0
lv_width  TYPE I, "   65
lv_height  TYPE I, "   0
lv_aligndefault  TYPE C, "   RS_C_TRUE
lv_dynnr  TYPE SY-DYNNR, "   
lt_addheaders  TYPE STANDARD TABLE OF TREEV_HDR, "   
lv_column_not_found  TYPE TREEV_HDR, "   
lv_alignment  TYPE I, "   0
lv_i_strt_name  TYPE X030L-TABNAME, "   'RSADMTXCOL'
lv_i_hierarchy_header  TYPE TREEV_HDR, "   
lv_hide_hier  TYPE I, "   0
lv_register_event_btn_click  TYPE C, "   
lv_callbackname_btn_click  TYPE C, "   
lv_autoheaderwidth  TYPE RS_BOOL, "   RS_C_FALSE
lv_itemheight  TYPE I, "   -1
lv_control_container  TYPE C, "   ' '
lv_parent_id  TYPE I, "   
lv_right_or_left_align  TYPE C, "   'L'
lv_top  TYPE I, "   0
lv_b_dropallow  TYPE C, "   
lv_callbackname_drop  TYPE C, "   
lv_b_drag_allow  TYPE C. "   

  CALL FUNCTION 'RSAT_CREATE_TREE'  "Creates and inits one tree control
    EXPORTING
         OWNER_REPID = lv_owner_repid
         REG_EVENT_EXPAND_NO_CHILDREN = lv_reg_event_expand_no_children
         CALLBACKNAME_EXPAND_NO_CHILD = lv_callbackname_expand_no_child
         REGISTER_EVENT_ITEM_DBL_CLICK = lv_register_event_item_dbl_click
         CALLBACKNAME_ITEM_DBL_CLK = lv_callbackname_item_dbl_clk
         REGISTER_EVENT_RMOUSE_DOWN = lv_register_event_rmouse_down
         CALLBACKNAME_RMOUSEDOWN = lv_callbackname_rmousedown
         LEFT = lv_left
         WIDTH = lv_width
         HEIGHT = lv_height
         ALIGNDEFAULT = lv_aligndefault
         DYNNR = lv_dynnr
         ALIGNMENT = lv_alignment
         I_STRT_NAME = lv_i_strt_name
         I_HIERARCHY_HEADER = lv_i_hierarchy_header
         HIDE_HIER = lv_hide_hier
         REGISTER_EVENT_BTN_CLICK = lv_register_event_btn_click
         CALLBACKNAME_BTN_CLICK = lv_callbackname_btn_click
         AUTOHEADERWIDTH = lv_autoheaderwidth
         ITEMHEIGHT = lv_itemheight
         CONTROL_CONTAINER = lv_control_container
         PARENT_ID = lv_parent_id
         RIGHT_OR_LEFT_ALIGN = lv_right_or_left_align
         TOP = lv_top
         B_DROPALLOW = lv_b_dropallow
         CALLBACKNAME_DROP = lv_callbackname_drop
         B_DRAG_ALLOW = lv_b_drag_allow
    CHANGING
         TREEHANDLE = lv_treehandle
    TABLES
         ADDCOLUMNS = lt_addcolumns
         ADDHEADERS = lt_addheaders
    EXCEPTIONS
        CREATE_ERROR = 1
        COLUMN_NOT_FOUND = 2
. " RSAT_CREATE_TREE




ABAP code using 7.40 inline data declarations to call FM RSAT_CREATE_TREE

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 REPID FROM SY INTO @DATA(ld_owner_repid).
 
 
 
 
 
 
 
 
 
DATA(ld_width) = 65.
 
 
DATA(ld_aligndefault) = RS_C_TRUE.
 
"SELECT single DYNNR FROM SY INTO @DATA(ld_dynnr).
 
 
 
 
"SELECT single TABNAME FROM X030L INTO @DATA(ld_i_strt_name).
DATA(ld_i_strt_name) = 'RSADMTXCOL'.
 
 
 
 
 
DATA(ld_autoheaderwidth) = RS_C_FALSE.
 
DATA(ld_itemheight) = -1.
 
DATA(ld_control_container) = ' '.
 
 
DATA(ld_right_or_left_align) = 'L'.
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!