Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

To Add a Node in Tree?

former_member194669
Active Contributor
0 Likes
595

Hi,

I am using the class cl_gui_alv_tree_simple, I need to add a node after tree displayed in the screen?

I tried to use method TREE_ADD_NODE , but this found protected.

Thanks

aRs

Hi,

I am using the class cl_gui_alv_tree_simple, I need to add a node after tree displayed in the screen?

I tried to use method TREE_ADD_NODE , but this found protected.

Thanks

aRs

3 REPLIES 3
Read only

Former Member
0 Likes
566

Hi,

You can use this method

DATA obj_tree1 TYPE REF TO cl_gui_alv_tree.

CALL METHOD obj_tree1->add_node

EXPORTING

i_relat_node_key = p_relat_key

i_relationship = cl_gui_column_tree=>relat_last_child

i_node_text = l_node_text

is_outtab_line = rs_main

it_item_layout = lt_item_layout

IMPORTING

e_new_node_key = p_node_key.

Hope this will solve your problem.

Award points if it helps.

-Gaurang

Read only

Former Member
0 Likes
566

Hi,

There is a method <b>ADD_NODES</b> in the class cl_gui_alv_tree_simple, which is a public method and it can be used to add nodes to your tree.

Regards,

Abdul

Read only

Former Member
0 Likes
566

Hi,

Check the following program in the link:

http://www.sap-img.com/abap/how-to-create-tree-control.htm

REgards,

Bhaskar