cancel
Showing results for 
Search instead for 
Did you mean: 

ALV TREE add node

Former Member
0 Kudos

can someone please help me ?

I can't find how the method add_node for a alv tree works:

CALL METHOD tree->add_node
    EXPORTING
      i_relat_node_key =
      i_relationship   = 
      i_node_text      = 
      is_outtab_line   = 
    IMPORTING
      e_new_node_key   = 
.

can someone please explain me the meaning of the parameters?

thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member598013
Active Contributor
0 Kudos

Hi Gabriele,

Check out the below sample code to use of the method add_node.


data: l_relat_node_key type lvc_nkey,
         l_node_text type lvc_value,
         ls_node_layout type lvc_s_layn,
         ls_node_key like node_key,
         new_node_key type lvc_nkey.


    call method alv_tree_control->add_node
      exporting i_relat_node_key = l_relat_node_key
                i_relationship   = cl_gui_column_tree=>relat_last_child
                i_node_text      = l_node_text
                is_node_layout   = ls_node_layout
                is_outtab_line   = ls_tree
      importing e_new_node_key   = new_node_key.

*   ID und Node_key in Tabelle gt_node_key abspeichern
    ls_node_key-id       = ls_tree-klnodetext-id.
    ls_node_key-node_key = new_node_key.
    append ls_node_key to l_node_key_tbl.

This might helpful for you.

Thanks,

Chidanand

Answers (2)

Answers (2)

MarcinPciak
Active Contributor
0 Kudos

CALL METHOD tree->add_node
    EXPORTING
      i_relat_node_key =  "node key your are referring to i.e. 'ROOT'
      i_relationship   =   "type of relationship between node above (in this case it is 'ROOT') and the node you are adding 
"(check all atributes RELAT_* of class CL_GUI_COLUMN_TREE). 
"i.e. cl_column_tree_model=>relat_last_child means node is child node of the 'ROOT' node
      i_node_text      =  "text for the node
      is_outtab_line   = "not sure, probably structure of output table being displayed
    IMPORTING
      e_new_node_key   = "key of the node being added i.e. 'NODE1'.

Former Member
0 Kudos

thanks