Skip to Content
avatar image
Former Member

ALV TREE add node

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 20, 2008 at 02:50 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 20, 2008 at 03:02 PM

    thanks

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 20, 2008 at 03:06 PM
    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'.
    
    
    Add comment
    10|10000 characters needed characters exceeded