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

select values from 2 different nodes at same level CL_GUI_SIMPLE_TREE

ABAPER_P
Participant
0 Likes
3,927

Hello Team,

I want to select the 2 values from 2 different nodes at a time. I know how to select single value of node using using the class CL_GUI_SIMPLE_TREE

NODE_SELECTION_MODE = NODE_SEL_MODE_SINGLE and EVENT-EVENTID = CL_GUI_SIMPLE_TREE=>EVENTID_NODE_DOUBLE_CLICK.


But How do i select 2 diffrent values of 2 different nodes at same level. and store vales in variable.

Image attached

9 REPLIES 9
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,491

Did you try to use: node_selection_mode = node_sel_mode_multiple and events such as selection_changed followed by call of method get_selected_nodes.

Read only

0 Likes
3,491

tried but was unsuccessful selecting multiple nodes as shown in question screen shot.

could you please give sample code ?

Read only

0 Likes
3,491

Perform a where used on the class to find sample demo repoort or on the suggested methd to find reports such as RDSVAS_TRANSPORT_ORGANIZER_C01 which allow multiple selection.

Read only

0 Likes
3,491

RDSVAS_TRANSPORT_ORGANIZER_C01 is it report ? seems to be doesnt exists.

Read only

0 Likes
3,491

(Fond on one of my systems) In this report, some data is displayed in a tree on left panel, and on a ok_code f the dynpro menu its call the method get_selected_nodes and copy the selected nodes to an alv grid on right panel.

List of reports/class depends on your version and of the solutions activated on your system(s) so you should perform the where used on such methods of the single tree class on your system to find some samples.

Read only

0 Likes
3,491

I not sure

I am getting below message in SE38

Program RDSVAS_TRANSPORT_ORGANIZER_C01 does not exist

Message no. DS017

Read only

0 Likes
3,491

So not available in tour version, to reiterate, perform a where-used search on your system first.

Read only

amy_king
Active Contributor
0 Likes
3,491

Set the selection mode to multiple upon instantiation of the tree object.

CREATE OBJECT g_tree
    EXPORTING
      node_selection_mode = cl_simple_tree_model=>node_sel_mode_multiple
    ...

If you run demo program SAPSIMPLE_TREE_MODEL_DEMO and change the node selection mode to multiple in debug, you'll see multiple child nodes may be selected.

Cheers,
Amy

Read only

0 Likes
3,491

Yes node_selection_mode = cl_simple_tree_model=>node_sel_mode_multiple by this we can select multiple nodes but how we get values of node keys ?


where as in node_sel_mode_single in the event NODE_DOUBLE_CLICK click used to get the node key but in node_sel_mode_multiple which event triggers and how to get both nodes node key ?