SAP TREEV_CREATE_COLUMN_TREE Function Module for









TREEV_CREATE_COLUMN_TREE is a standard treev create column 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 column tree FM, simply by entering the name TREEV_CREATE_COLUMN_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_COLUMN_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_COLUMN_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_ITEM_DBL_CLICK = "
* REGISTER_EVENT_NODE_DBL_CLICK = "
* REGISTER_EVENT_HEADER_CLICK = "
* REGISTER_EVENT_NODE_CONTEXT_M = "
* REGISTER_EVENT_ITEM_CONTEXT_M = "
DYNNR = "See Function Module Documentation
* REGISTER_EVENT_LINK_CLICK = "
* REGISTER_EVENT_BUTTON_CLICK = "
* REGISTER_EVENT_CHECKBOX_CHANGE = "
* REGISTER_EVENT_SEL_CHANGE = "
ITEM_SELECTION = "Can Individual Items be Selected?
NODE_SELECTION_MODE = "Nodes: Single or Multiple Selection
* GROUP_HEADERS = "
* HIDE_SELECTION = "Visibility of Selection
HIERARCHY_HEADER = "
* ITEM_TABLE_STRUCTURE_NAME = "Name of Item Structure in ABAP Dictionary
* 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
COLUMNS = "Columns in tree
* HEADERS = "
* NODE_TABLE = "
* ITEM_TABLE = "

EXCEPTIONS
CREATE_ERROR = 1 ILLEGAL_HEADER_NAME = 10 DUPLICATED_COLUMN_NAME = 11 DUPLICATED_HEADER_NAME = 12 ILLEGAL_END_COL = 13 END_COL_NOT_FOUND = 14 MISSING_ITEM_STRUCTURE_NAME = 15 EMPTY_NODE_TABLE = 16 EMPTY_ITEM_TABLE = 17 ERROR_IN_TABLES = 18 DP_ERROR = 19 TREE_CONTROL_NOT_EXISTING = 2 ILLEGAL_OWNER_REPID = 20 TOO_MANY_COLUMNS = 21 TABLE_STRUCTURE_NAME_NOT_FOUND = 22 MULTI_COLUMN_HEADER = 23 MISSING_HEADER = 24 CNTL_SYSTEM_ERROR = 3 FAILED = 4 ILLEGAL_NODE_SELECTION_MODE = 5 ILLEGAL_COLUMN_NAME = 6 ILLEGAL_COLUMN_ALIGNMENT = 7 ILLEGAL_HEADER_ALIGNMENT = 8 ILLEGAL_HEADER_TYPE = 9
.



IMPORTING Parameters details for TREEV_CREATE_COLUMN_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_ITEM_DBL_CLICK -

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_HEADER_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_ITEM_CONTEXT_M -

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)

REGISTER_EVENT_LINK_CLICK -

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

REGISTER_EVENT_BUTTON_CLICK -

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

REGISTER_EVENT_CHECKBOX_CHANGE -

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)

ITEM_SELECTION - Can Individual Items be Selected?

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

GROUP_HEADERS -

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

HIERARCHY_HEADER -

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

ITEM_TABLE_STRUCTURE_NAME - Name of Item Structure in ABAP Dictionary

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_COLUMN_TREE

HANDLE - Handle for Tree Control

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

TABLES Parameters details for TREEV_CREATE_COLUMN_TREE

COLUMNS - Columns in tree

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

HEADERS -

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

NODE_TABLE -

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

ITEM_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)

ILLEGAL_HEADER_NAME -

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

DUPLICATED_COLUMN_NAME -

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

DUPLICATED_HEADER_NAME -

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

ILLEGAL_END_COL -

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

END_COL_NOT_FOUND -

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

MISSING_ITEM_STRUCTURE_NAME -

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

EMPTY_NODE_TABLE -

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

EMPTY_ITEM_TABLE -

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

ERROR_IN_TABLES - Nodes / Item Table Contain Errors

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)

TREE_CONTROL_NOT_EXISTING -

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)

TOO_MANY_COLUMNS -

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)

MULTI_COLUMN_HEADER -

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

MISSING_HEADER -

Data type:
Optional: No
Call by Reference: Yes

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)

ILLEGAL_COLUMN_NAME -

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

ILLEGAL_COLUMN_ALIGNMENT -

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

ILLEGAL_HEADER_ALIGNMENT -

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

ILLEGAL_HEADER_TYPE -

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

Copy and paste ABAP code example for TREEV_CREATE_COLUMN_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_columns  TYPE STANDARD TABLE OF TREEV_COL, "   
lv_owner_repid  TYPE SY-REPID, "   
lv_create_error  TYPE SY, "   
lv_no_flush  TYPE C, "   
lv_illegal_header_name  TYPE C, "   
lv_link_repid  TYPE SY-REPID, "   
lv_duplicated_column_name  TYPE SY, "   
lv_shellstyle  TYPE I, "   
lv_duplicated_header_name  TYPE I, "   
lv_parentid  TYPE I, "   
lv_illegal_end_col  TYPE I, "   
lv_end_col_not_found  TYPE I, "   
lv_reg_event_expand_no_children  TYPE C, "   
lv_missing_item_structure_name  TYPE C, "   
lv_register_event_item_dbl_click  TYPE C, "   
lv_empty_node_table  TYPE C, "   
lv_register_event_node_dbl_click  TYPE C, "   
lv_empty_item_table  TYPE C, "   
lv_register_event_header_click  TYPE C, "   
lv_error_in_tables  TYPE C, "   
lv_register_event_node_context_m  TYPE C, "   
lv_dp_error  TYPE C, "   
lv_register_event_item_context_m  TYPE C, "   
lv_dynnr  TYPE SY-DYNNR, "   
lt_headers  TYPE STANDARD TABLE OF TREEV_HDR, "   
lv_tree_control_not_existing  TYPE TREEV_HDR, "   
lv_illegal_owner_repid  TYPE TREEV_HDR, "   
lv_register_event_link_click  TYPE C, "   
lv_too_many_columns  TYPE C, "   
lv_register_event_button_click  TYPE C, "   
lv_register_event_checkbox_change  TYPE C, "   
lv_table_structure_name_not_found  TYPE C, "   
lv_multi_column_header  TYPE C, "   
lv_register_event_sel_change  TYPE C, "   
lv_item_selection  TYPE C, "   
lv_missing_header  TYPE C, "   
lv_node_selection_mode  TYPE I, "   
lv_group_headers  TYPE C, "   
lv_hide_selection  TYPE C, "   
lv_hierarchy_header  TYPE TREEV_HDR, "   
lv_item_table_structure_name  TYPE X030L-TABNAME, "   
lv_container  TYPE C, "   
lt_node_table  TYPE STANDARD TABLE OF TREEV_NODE, "   
lv_cntl_system_error  TYPE TREEV_NODE, "   
lv_left  TYPE I, "   
lv_failed  TYPE I, "   
lt_item_table  TYPE STANDARD TABLE OF I, "   
lv_top  TYPE I, "   
lv_illegal_node_selection_mode  TYPE I, "   
lv_width  TYPE I, "   
lv_illegal_column_name  TYPE I, "   
lv_height  TYPE I, "   
lv_illegal_column_alignment  TYPE I, "   
lv_alignment  TYPE I, "   
lv_illegal_header_alignment  TYPE I, "   
lv_metric  TYPE CNTL_METRIC, "   CNTL_METRIC_DYNPRO
lv_illegal_header_type  TYPE CNTL_METRIC. "   

  CALL FUNCTION 'TREEV_CREATE_COLUMN_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_ITEM_DBL_CLICK = lv_register_event_item_dbl_click
         REGISTER_EVENT_NODE_DBL_CLICK = lv_register_event_node_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
         DYNNR = lv_dynnr
         REGISTER_EVENT_LINK_CLICK = lv_register_event_link_click
         REGISTER_EVENT_BUTTON_CLICK = lv_register_event_button_click
         REGISTER_EVENT_CHECKBOX_CHANGE = lv_register_event_checkbox_change
         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 = lv_hierarchy_header
         ITEM_TABLE_STRUCTURE_NAME = lv_item_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
         COLUMNS = lt_columns
         HEADERS = lt_headers
         NODE_TABLE = lt_node_table
         ITEM_TABLE = lt_item_table
    EXCEPTIONS
        CREATE_ERROR = 1
        ILLEGAL_HEADER_NAME = 10
        DUPLICATED_COLUMN_NAME = 11
        DUPLICATED_HEADER_NAME = 12
        ILLEGAL_END_COL = 13
        END_COL_NOT_FOUND = 14
        MISSING_ITEM_STRUCTURE_NAME = 15
        EMPTY_NODE_TABLE = 16
        EMPTY_ITEM_TABLE = 17
        ERROR_IN_TABLES = 18
        DP_ERROR = 19
        TREE_CONTROL_NOT_EXISTING = 2
        ILLEGAL_OWNER_REPID = 20
        TOO_MANY_COLUMNS = 21
        TABLE_STRUCTURE_NAME_NOT_FOUND = 22
        MULTI_COLUMN_HEADER = 23
        MISSING_HEADER = 24
        CNTL_SYSTEM_ERROR = 3
        FAILED = 4
        ILLEGAL_NODE_SELECTION_MODE = 5
        ILLEGAL_COLUMN_NAME = 6
        ILLEGAL_COLUMN_ALIGNMENT = 7
        ILLEGAL_HEADER_ALIGNMENT = 8
        ILLEGAL_HEADER_TYPE = 9
. " TREEV_CREATE_COLUMN_TREE




ABAP code using 7.40 inline data declarations to call FM TREEV_CREATE_COLUMN_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_item_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!