SAP RH_OCX_CREATE_TREE Function Module for
RH_OCX_CREATE_TREE is a standard rh ocx 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 to perform a specific ABAP function and below is the pattern details, 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 rh ocx create tree FM, simply by entering the name RH_OCX_CREATE_TREE into the relevant SAP transaction such as SE37 or SE38.
Function Group: RH_TREE_CONTROLS
Program Name: SAPLRH_TREE_CONTROLS
Main Program:
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_OCX_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 'RH_OCX_CREATE_TREE'".
EXPORTING
* VIRTUAL_ROOT = "
* BEGDA = SY-DATUM "
* ENDDA = '99991231' "
* KEY_DATE = "
* CUSTOM_CONTROL_AREA = "
* LEFT = "
* TOP = "
* WIDTH = "
* HEIGHT = "
* ALIGNMENT = "
DYNNR = "
* PLVAR = "
REPID = "
* CALLBACK_FORM_DROP = "ABAP Editor form
* CALLBACK_PROG_DROP = "
* PARENTID = "
* REGISTER_EVENT_ITEM_DBL_CLICK = "
* REGISTER_EVENT_NODE_DBL_CLICK = "
* USE_STANDARD_DBL_CLICK = "
* REGISTER_EVENT_HEADER_CLICK = "
* REGISTER_EVENT_NODE_CONTEXT_M = "
* REGISTER_EVENT_ITEM_CONTEXT_M = "
* ROOT_OTYPE = "
* REGISTER_EVENT_SEL_CHANGE = "
* ITEM_SELECTION = 'X' "
NODE_SELECTION_MODE = "
* GROUP_HEADERS = "
* HIDE_SELECTION = "
* HIERARCHY_HEADER_TEXT = "
* HIERARCHY_HEADER_ICON = "
* TREE_TYPE = 'ORGS' "
* BUFFER_MODE = "
* ROOT_OBJID = "
* PATHID = "
* INT_PATH_FLAG = "
* TECH_DEPTH = 2 "
* MAX_DEPTH = 99999 "
* SVECT = '1' "
CHANGING
HANDLE = "
TABLES
* ROOT_TAB = "
IMPORTING Parameters details for RH_OCX_CREATE_TREE
VIRTUAL_ROOT -
Data type: OBJECOptional: Yes
Call by Reference: No ( called with pass by value option)
BEGDA -
Data type: OBJEC-BEGDADefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
ENDDA -
Data type: OBJEC-ENDDADefault: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEY_DATE -
Data type: OBJEC-BEGDAOptional: Yes
Call by Reference: No ( called with pass by value option)
CUSTOM_CONTROL_AREA -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
LEFT -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
TOP -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
WIDTH -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
HEIGHT -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
ALIGNMENT -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
DYNNR -
Data type: SY-DYNNROptional: No
Call by Reference: No ( called with pass by value option)
PLVAR -
Data type: OBJEC-PLVAROptional: Yes
Call by Reference: No ( called with pass by value option)
REPID -
Data type: SY-REPIDOptional: No
Call by Reference: No ( called with pass by value option)
CALLBACK_FORM_DROP - ABAP Editor form
Data type: EDPERFORMOptional: Yes
Call by Reference: No ( called with pass by value option)
CALLBACK_PROG_DROP -
Data type: SY-REPIDOptional: Yes
Call by Reference: No ( called with pass by value option)
PARENTID -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
REGISTER_EVENT_ITEM_DBL_CLICK -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
REGISTER_EVENT_NODE_DBL_CLICK -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
USE_STANDARD_DBL_CLICK -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
REGISTER_EVENT_HEADER_CLICK -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
REGISTER_EVENT_NODE_CONTEXT_M -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
REGISTER_EVENT_ITEM_CONTEXT_M -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
ROOT_OTYPE -
Data type: OBJEC-OTYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
REGISTER_EVENT_SEL_CHANGE -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
ITEM_SELECTION -
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NODE_SELECTION_MODE -
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
GROUP_HEADERS -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
HIDE_SELECTION -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
HIERARCHY_HEADER_TEXT -
Data type: TREEV_HDR-HEADINGOptional: Yes
Call by Reference: No ( called with pass by value option)
HIERARCHY_HEADER_ICON -
Data type: TV_IMAGEOptional: Yes
Call by Reference: No ( called with pass by value option)
TREE_TYPE -
Data type: HRARRAYTYPDefault: 'ORGS'
Optional: Yes
Call by Reference: No ( called with pass by value option)
BUFFER_MODE -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
ROOT_OBJID -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
PATHID -
Data type: GDSTR-WEGIDOptional: Yes
Call by Reference: No ( called with pass by value option)
INT_PATH_FLAG -
Data type: HRRHAS-77AW_INTOptional: Yes
Call by Reference: No ( called with pass by value option)
TECH_DEPTH -
Data type: GDSTR-TDEPTHDefault: 2
Optional: Yes
Call by Reference: No ( called with pass by value option)
MAX_DEPTH -
Data type: GDSTR-TDEPTHDefault: 99999
Optional: Yes
Call by Reference: No ( called with pass by value option)
SVECT -
Data type: GDSTR-SVECTDefault: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for RH_OCX_CREATE_TREE
HANDLE -
Data type: CNTL_HANDLEOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RH_OCX_CREATE_TREE
ROOT_TAB -
Data type: HRROOTOBOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RH_OCX_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: | ||||
| lv_handle | TYPE CNTL_HANDLE, " | |||
| lt_root_tab | TYPE STANDARD TABLE OF HRROOTOB, " | |||
| lv_virtual_root | TYPE OBJEC, " | |||
| lv_begda | TYPE OBJEC-BEGDA, " SY-DATUM | |||
| lv_endda | TYPE OBJEC-ENDDA, " '99991231' | |||
| lv_key_date | TYPE OBJEC-BEGDA, " | |||
| lv_custom_control_area | TYPE C, " | |||
| lv_left | TYPE I, " | |||
| lv_top | TYPE I, " | |||
| lv_width | TYPE I, " | |||
| lv_height | TYPE I, " | |||
| lv_alignment | TYPE I, " | |||
| lv_dynnr | TYPE SY-DYNNR, " | |||
| lv_plvar | TYPE OBJEC-PLVAR, " | |||
| lv_repid | TYPE SY-REPID, " | |||
| lv_callback_form_drop | TYPE EDPERFORM, " | |||
| lv_callback_prog_drop | TYPE SY-REPID, " | |||
| lv_parentid | TYPE I, " | |||
| lv_register_event_item_dbl_click | TYPE C, " | |||
| lv_register_event_node_dbl_click | TYPE C, " | |||
| lv_use_standard_dbl_click | TYPE C, " | |||
| lv_register_event_header_click | TYPE C, " | |||
| lv_register_event_node_context_m | TYPE C, " | |||
| lv_register_event_item_context_m | TYPE C, " | |||
| lv_root_otype | TYPE OBJEC-OTYPE, " | |||
| lv_register_event_sel_change | TYPE C, " | |||
| lv_item_selection | TYPE C, " 'X' | |||
| lv_node_selection_mode | TYPE I, " | |||
| lv_group_headers | TYPE C, " | |||
| lv_hide_selection | TYPE C, " | |||
| lv_hierarchy_header_text | TYPE TREEV_HDR-HEADING, " | |||
| lv_hierarchy_header_icon | TYPE TV_IMAGE, " | |||
| lv_tree_type | TYPE HRARRAYTYP, " 'ORGS' | |||
| lv_buffer_mode | TYPE C, " | |||
| lv_root_objid | TYPE C, " | |||
| lv_pathid | TYPE GDSTR-WEGID, " | |||
| lv_int_path_flag | TYPE HRRHAS-77AW_INT, " | |||
| lv_tech_depth | TYPE GDSTR-TDEPTH, " 2 | |||
| lv_max_depth | TYPE GDSTR-TDEPTH, " 99999 | |||
| lv_svect | TYPE GDSTR-SVECT. " '1' |
|   CALL FUNCTION 'RH_OCX_CREATE_TREE' " |
| EXPORTING | ||
| VIRTUAL_ROOT | = lv_virtual_root | |
| BEGDA | = lv_begda | |
| ENDDA | = lv_endda | |
| KEY_DATE | = lv_key_date | |
| CUSTOM_CONTROL_AREA | = lv_custom_control_area | |
| LEFT | = lv_left | |
| TOP | = lv_top | |
| WIDTH | = lv_width | |
| HEIGHT | = lv_height | |
| ALIGNMENT | = lv_alignment | |
| DYNNR | = lv_dynnr | |
| PLVAR | = lv_plvar | |
| REPID | = lv_repid | |
| CALLBACK_FORM_DROP | = lv_callback_form_drop | |
| CALLBACK_PROG_DROP | = lv_callback_prog_drop | |
| PARENTID | = lv_parentid | |
| REGISTER_EVENT_ITEM_DBL_CLICK | = lv_register_event_item_dbl_click | |
| REGISTER_EVENT_NODE_DBL_CLICK | = lv_register_event_node_dbl_click | |
| USE_STANDARD_DBL_CLICK | = lv_use_standard_dbl_click | |
| REGISTER_EVENT_HEADER_CLICK | = lv_register_event_header_click | |
| REGISTER_EVENT_NODE_CONTEXT_M | = lv_register_event_node_context_m | |
| REGISTER_EVENT_ITEM_CONTEXT_M | = lv_register_event_item_context_m | |
| ROOT_OTYPE | = lv_root_otype | |
| REGISTER_EVENT_SEL_CHANGE | = lv_register_event_sel_change | |
| ITEM_SELECTION | = lv_item_selection | |
| NODE_SELECTION_MODE | = lv_node_selection_mode | |
| GROUP_HEADERS | = lv_group_headers | |
| HIDE_SELECTION | = lv_hide_selection | |
| HIERARCHY_HEADER_TEXT | = lv_hierarchy_header_text | |
| HIERARCHY_HEADER_ICON | = lv_hierarchy_header_icon | |
| TREE_TYPE | = lv_tree_type | |
| BUFFER_MODE | = lv_buffer_mode | |
| ROOT_OBJID | = lv_root_objid | |
| PATHID | = lv_pathid | |
| INT_PATH_FLAG | = lv_int_path_flag | |
| TECH_DEPTH | = lv_tech_depth | |
| MAX_DEPTH | = lv_max_depth | |
| SVECT | = lv_svect | |
| CHANGING | ||
| HANDLE | = lv_handle | |
| TABLES | ||
| ROOT_TAB | = lt_root_tab | |
| . " RH_OCX_CREATE_TREE | ||
ABAP code using 7.40 inline data declarations to call FM RH_OCX_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 BEGDA FROM OBJEC INTO @DATA(ld_begda). | ||||
| DATA(ld_begda) | = SY-DATUM. | |||
| "SELECT single ENDDA FROM OBJEC INTO @DATA(ld_endda). | ||||
| DATA(ld_endda) | = '99991231'. | |||
| "SELECT single BEGDA FROM OBJEC INTO @DATA(ld_key_date). | ||||
| "SELECT single DYNNR FROM SY INTO @DATA(ld_dynnr). | ||||
| "SELECT single PLVAR FROM OBJEC INTO @DATA(ld_plvar). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_repid). | ||||
| "SELECT single REPID FROM SY INTO @DATA(ld_callback_prog_drop). | ||||
| "SELECT single OTYPE FROM OBJEC INTO @DATA(ld_root_otype). | ||||
| DATA(ld_item_selection) | = 'X'. | |||
| "SELECT single HEADING FROM TREEV_HDR INTO @DATA(ld_hierarchy_header_text). | ||||
| DATA(ld_tree_type) | = 'ORGS'. | |||
| "SELECT single WEGID FROM GDSTR INTO @DATA(ld_pathid). | ||||
| "SELECT single 77AW_INT FROM HRRHAS INTO @DATA(ld_int_path_flag). | ||||
| "SELECT single TDEPTH FROM GDSTR INTO @DATA(ld_tech_depth). | ||||
| DATA(ld_tech_depth) | = 2. | |||
| "SELECT single TDEPTH FROM GDSTR INTO @DATA(ld_max_depth). | ||||
| DATA(ld_max_depth) | = 99999. | |||
| "SELECT single SVECT FROM GDSTR INTO @DATA(ld_svect). | ||||
| DATA(ld_svect) | = '1'. | |||
Search for further information about these or an SAP related objects