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

ALV TREE

Former Member
0 Likes
755

Hi all,

i am working on alv tree (CL_GUI_COLUMN_TREE) . i have expand/collapse buttons. So if I select a node and hit the expand button, the program should expand everything below it .

2. is there is any single click event in event table(TYPE CNTL_SIMPLE_EVENTS).

Thanks and regards,

Tarak

Hi all,

i am working on alv tree (CL_GUI_COLUMN_TREE) . i have expand/collapse buttons. So if I select a node and hit the expand button, the program should expand everything below it .

2. is there is any single click event in event table(TYPE CNTL_SIMPLE_EVENTS).

Thanks and regards,

Tarak

3 REPLIES 3
Read only

Former Member
0 Likes
672

Hi,


Class CL_GUI_COLUMN_TREE inherit methods of class CL_TREE_CONTROL_BASE, so just use the method expand_root_nodes
CALL METHOD tree->expand_root_nodes
  EXPORTING  level_count = level_count
             expand_subtree = expand_subtree
  EXCEPTIONS failed = 1
             illegal_level_count = 2
             cntl_system_error = 3.

Where level_count :

0: Only the root nodes are expanded - no underlying nodes.

1: The current node and the next hierarchy level are expanded.

and expand_subtree

'X': Expands all nodes in the subtree. The system ignores any value of LEVEL_COUNT

To collapse all nodes use method COLLAPSE_ALL_NODES

Look at SAP Tree and Tree Model (BC-CI) or SAP Tree Model for documentation and read SAP demo programs like SAPCOLUMN_TREE_CONTROL_DEMO, SAPSIMPLE_TREE_CONTROL_DEMO, and

SAPTLIST_TREE_CONTROL_DEMO, BCALV_TREE_SIMPLE_DEMO and BCALV_TREE_DEMO

Thanks

Arun Kayal

Read only

Former Member
0 Likes
672

Hi Arun Kayal,

I got the method EXPAND_NODE but i have to pass the node_key which i got only if there are any single Click event .

plz help me.

Thanks,

Tarak

Read only

Former Member
0 Likes
672

Hi,

Use selection_changed event to collapse or expand all nodes when left mouse button clicked on any node and call methods collapse_all_nodes and expand_node in the event handler method.

Selection_changed event triggers for every left click on any node

you can refer the given below link for demo program

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCITREE/BCCITREE.pdf

Thanks

Arun Kayal.

Edited by: Arun Kayal on Feb 3, 2009 12:55 PM