Hi,
Please refer to the below code.
CALL METHOD g_alv_tree->add_node
EXPORTING
i_relat_node_key = p_cnode_key " if this node is father level, keep it blank. if this node is child, need provide the father level number.
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text " This is text of the node
is_outtab_line = wa_outtab " This is output work area
IMPORTING
e_new_node_key = p_nnode_key. " This is the node id. using to count the node numbers.
Regards,
Yawa