Application Development 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: 

doubt in alv tree

srajendran
Explorer
0 Kudos

Hi friends,

I am working in alv tree. It is working fine. In click event , if i click one item it should call another one tcode (it is also an another one tree strucutre ). i called that tcode using call transaction. it is working .

now my question how to place cursor in the corresponding item of the second tree.

Thanks

Senthil Kumar.r

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use the code which i provided though you have diff structure you will have two diff objects of the tree.

Try the above code whihc i have given.

Please reward if useful.

7 REPLIES 7

Former Member
0 Kudos

Hi

Use the cl_gui_alv_tree class methods set_selected_nodes to select the node with providing the node key which you might have used to build node table

or if you select the item then use set_selected_item providing node key n fieldname .

pLEASE REWARD IF USEFUL.

0 Kudos

Hi Dinesh Malhotra ,

Please explain in detail.

Thanks

Senthil Kumar.r

former_member188827
Active Contributor
0 Kudos

use set cursor statement.

e.g.

parameters p_var type i default '20'.

at selection-screen output.

if p_var eq '30'.

set cursor FIELD 'P_VAR'.

endif.

Former Member
0 Kudos

Hi Senthil,

When you have builded the tree you will have filled node table with node key and text or fieldname .

I mean something like this .

node-node_key = ls_vbak-vbeln.

node-relatkey = 'Orders'.

node-relatship = cl_gui_simple_tree=>relat_last_child.

node-text = ls_vbak-vbeln.

node-isfolder = ' '.

node-expander = ''.

APPEND node TO node_table.

now call methode cl_gui_alv_tree->set_selected_item

exporting I_NODE_KEY = ls_vbak-vbeln. ( child node_key)

In the above the example the first node item would be selected. but before this you should expand the node to select the item

cl_gui_alv_tree->EXPAND_NODE

exporting I_NODE_KEY = ( parent node_key ).

Please reward if useful.

0 Kudos

Hi Dinesh Malhotra ,

Thanks for your reply. Here i am handling 2 trees both are in different structure. Suppose if i click one material in first tree, the cursor should be in corresponding material in the second tree.

Thanks

Senthil Kumar.r

Former Member
0 Kudos

Use the code which i provided though you have diff structure you will have two diff objects of the tree.

Try the above code whihc i have given.

Please reward if useful.

0 Kudos

THANK YOU DINESH