01-25-2007 8:13 AM
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
01-25-2007 9:29 AM
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.
01-25-2007 8:44 AM
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.
01-25-2007 8:59 AM
Hi Dinesh Malhotra ,
Please explain in detail.
Thanks
Senthil Kumar.r
01-25-2007 8:49 AM
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.
01-25-2007 9:11 AM
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.
01-25-2007 9:25 AM
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
01-25-2007 9:29 AM
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.
01-25-2007 1:31 PM