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

get selected node in alv tree

Former Member
0 Likes
4,314

Hi I am trying to get the selected node in the alv tree. I don't know what I am doing wrong:

call method gc_alv_tree->get_toolbar_object

importing

er_toolbar = mr_toolbar.

CHECK NOT mr_toolbar IS INITIAL.

here is the part of my code which exists from the form completely. mr_toolbar is always initial.

any help please?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,761

take help from demo code: BCALV_TREE_01

3 REPLIES 3
Read only

Former Member
0 Likes
1,762

take help from demo code: BCALV_TREE_01

Read only

0 Likes
1,761

yes but its not clear to how to get the current selected node from the tree

Read only

0 Likes
1,761

Hi Charla6,

If you want to get the selected node, the right method is get_selected_nodes, isn't it?


DATA : lt_selected_nodes TYPE treev_nks.

CALL METHOD gc_alv_tree->get_selected_nodes
  CHANGING
    ct_selected_nodes = lt_selected_nodes.

You also have the method get_selected_item (you can have a look in SE24 on all the methods implemented for the class of your object gc_alv_tree - something like CL_GUI_ALV_TREE, I guess?).

Best regards,

Samuel