SAP TREEV_CREATE_SIMPLE_TREE Function Module for









TREEV_CREATE_SIMPLE_TREE is a standard treev create simple 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 treev create simple tree FM, simply by entering the name TREEV_CREATE_SIMPLE_TREE into the relevant SAP transaction such as SE37 or SE38.

Function Group: CNT4
Program Name: SAPLCNT4
Main Program:
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function TREEV_CREATE_SIMPLE_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 'TREEV_CREATE_SIMPLE_TREE'"
EXPORTING
OWNER_REPID = "Report that Creates the Control
* NO_FLUSH = "
* LINK_REPID = "See Function Module Documentation
* SHELLSTYLE = "
* PARENTID = "
* REG_EVENT_EXPAND_NO_CHILDREN = "
* REGISTER_EVENT_NODE_DBL_CLICK = "
* REGISTER_EVENT_NODE_CONTEXT_M = "
* REGISTER_EVENT_SEL_CHANGE = "
NODE_SELECTION_MODE = "Nodes: Single or Multiple Selection
* HIDE_SELECTION = "Visibility of Selection
DYNNR = "See Function Module Documentation
* NODE_TABLE_STRUCTURE_NAME = "
* CONTAINER = "See Function Module Documentation
LEFT = "See Function Module Documentation
TOP = "See Function Module Documentation
WIDTH = "See Function Module Documentation
HEIGHT = "See Function Module Documentation
* ALIGNMENT = "See Function Module Documentation
* METRIC = CNTL_METRIC_DYNPRO "

CHANGING
HANDLE = "Handle for Tree Control

TABLES
* NODE_TABLE = "

EXCEPTIONS
CREATE_ERROR = 1 TABLE_STRUCTURE_NAME_NOT_FOUND = 10 TREE_CONTROL_NOT_EXISTING = 2 CNTL_SYSTEM_ERROR = 3 FAILED = 4 ILLEGAL_NODE_SELECTION_MODE = 5 MISSING_NODE_STRUCTURE_NAME = 6 ERROR_IN_NODE_TABLE = 7 DP_ERROR = 8 ILLEGAL_OWNER_REPID = 9
.



IMPORTING Parameters details for TREEV_CREATE_SIMPLE_TREE

OWNER_REPID - Report that Creates the Control

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

NO_FLUSH -

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

LINK_REPID - See Function Module Documentation

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

SHELLSTYLE -

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

PARENTID -

Data type: I
Optional: Yes
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)

REGISTER_EVENT_NODE_DBL_CLICK -

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

REGISTER_EVENT_NODE_CONTEXT_M -

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

REGISTER_EVENT_SEL_CHANGE -

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

NODE_SELECTION_MODE - Nodes: Single or Multiple Selection

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

HIDE_SELECTION - Visibility of Selection

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

DYNNR - See Function Module Documentation

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

NODE_TABLE_STRUCTURE_NAME -

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

CONTAINER - See Function Module Documentation

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

LEFT - See Function Module Documentation

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

TOP - See Function Module Documentation

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

WIDTH - See Function Module Documentation

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

HEIGHT - See Function Module Documentation

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

ALIGNMENT - See Function Module Documentation

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

METRIC -

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

CHANGING Parameters details for TREEV_CREATE_SIMPLE_TREE

HANDLE - Handle for Tree Control

Data type: CNTL_HANDLE
Optional: No
Call by Reference: Yes

TABLES Parameters details for TREEV_CREATE_SIMPLE_TREE

NODE_TABLE -

Data type:
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)

TABLE_STRUCTURE_NAME_NOT_FOUND -

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

TREE_CONTROL_NOT_EXISTING -

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

CNTL_SYSTEM_ERROR -

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

FAILED - General Error

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

ILLEGAL_NODE_SELECTION_MODE -

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

MISSING_NODE_STRUCTURE_NAME -

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

ERROR_IN_NODE_TABLE -

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

DP_ERROR - Error in Data Provider

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

ILLEGAL_OWNER_REPID -

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

Copy and paste ABAP code example for TREEV_CREATE_SIMPLE_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_node_table  TYPE STANDARD TABLE OF CNTL_HANDLE, "   
lv_owner_repid  TYPE SY-REPID, "   
lv_create_error  TYPE SY, "   
lv_no_flush  TYPE C, "   
lv_table_structure_name_not_found  TYPE C, "   
lv_link_repid  TYPE SY-REPID, "   
lv_shellstyle  TYPE I, "   
lv_parentid  TYPE I, "   
lv_reg_event_expand_no_children  TYPE C, "   
lv_register_event_node_dbl_click  TYPE C, "   
lv_register_event_node_context_m  TYPE C, "   
lv_register_event_sel_change  TYPE C, "   
lv_node_selection_mode  TYPE I, "   
lv_hide_selection  TYPE C, "   
lv_dynnr  TYPE SY-DYNNR, "   
lv_tree_control_not_existing  TYPE SY, "   
lv_node_table_structure_name  TYPE X030L-TABNAME, "   
lv_container  TYPE C, "   
lv_cntl_system_error  TYPE C, "   
lv_left  TYPE I, "   
lv_failed  TYPE I, "   
lv_top  TYPE I, "   
lv_illegal_node_selection_mode  TYPE I, "   
lv_width  TYPE I, "   
lv_missing_node_structure_name  TYPE I, "   
lv_height  TYPE I, "   
lv_error_in_node_table  TYPE I, "   
lv_dp_error  TYPE I, "   
lv_alignment  TYPE I, "   
lv_metric  TYPE CNTL_METRIC, "   CNTL_METRIC_DYNPRO
lv_illegal_owner_repid  TYPE CNTL_METRIC. "   

  CALL FUNCTION 'TREEV_CREATE_SIMPLE_TREE'  "
    EXPORTING
         OWNER_REPID = lv_owner_repid
         NO_FLUSH = lv_no_flush
         LINK_REPID = lv_link_repid
         SHELLSTYLE = lv_shellstyle
         PARENTID = lv_parentid
         REG_EVENT_EXPAND_NO_CHILDREN = lv_reg_event_expand_no_children
         REGISTER_EVENT_NODE_DBL_CLICK = lv_register_event_node_dbl_click
         REGISTER_EVENT_NODE_CONTEXT_M = lv_register_event_node_context_m
         REGISTER_EVENT_SEL_CHANGE = lv_register_event_sel_change
         NODE_SELECTION_MODE = lv_node_selection_mode
         HIDE_SELECTION = lv_hide_selection
         DYNNR = lv_dynnr
         NODE_TABLE_STRUCTURE_NAME = lv_node_table_structure_name
         CONTAINER = lv_container
         LEFT = lv_left
         TOP = lv_top
         WIDTH = lv_width
         HEIGHT = lv_height
         ALIGNMENT = lv_alignment
         METRIC = lv_metric
    CHANGING
         HANDLE = lv_handle
    TABLES
         NODE_TABLE = lt_node_table
    EXCEPTIONS
        CREATE_ERROR = 1
        TABLE_STRUCTURE_NAME_NOT_FOUND = 10
        TREE_CONTROL_NOT_EXISTING = 2
        CNTL_SYSTEM_ERROR = 3
        FAILED = 4
        ILLEGAL_NODE_SELECTION_MODE = 5
        MISSING_NODE_STRUCTURE_NAME = 6
        ERROR_IN_NODE_TABLE = 7
        DP_ERROR = 8
        ILLEGAL_OWNER_REPID = 9
. " TREEV_CREATE_SIMPLE_TREE




ABAP code using 7.40 inline data declarations to call FM TREEV_CREATE_SIMPLE_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).
 
 
 
 
"SELECT single REPID FROM SY INTO @DATA(ld_link_repid).
 
 
 
 
 
 
 
 
 
"SELECT single DYNNR FROM SY INTO @DATA(ld_dynnr).
 
 
"SELECT single TABNAME FROM X030L INTO @DATA(ld_node_table_structure_name).
 
 
 
 
 
 
 
 
 
 
 
 
 
DATA(ld_metric) = CNTL_METRIC_DYNPRO.
 
 


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!