07-22-2015 12:46 PM
Hello All,
In the class CL_SALV_TREE we can get the node information from method GET_NODES and selections from the method GET_SELECTIONS.
But this class do not have any method that will retrieve expanded nodes.
Event IF_SALV_EVENTS_TREE~EXPAND_EMPTY_FOLDER will only trigger on node which have empty nodes.
I have seen in the package of the class CL_SALV_TREE , there is another class CL_SALV_GUI_TREE, which has the method GET_EXPANDED_NODES.
The class CL_SALV_TREE internally forms a tree using class CL_SALV_GUI_TREE, so we can handle the events triggered in CL_SALV_GUI_TREE in our local implementations.
Is there any way we can get the expanded node details using class CL_SALV_TREE.
We can also use the class CL_GUI_COLUMN_TREE which have majority of functions, but I am using the class CL_SALV_TREE.
With regards,
Sandeep Akella
07-26-2015 12:10 AM
Hi,
you can use CL_GUI_COLUMN_TREE better or CL_GUI_ALV_TREE, the last one has many methods, may you need them later.
and there are many actions, Drag, Drop, double click, context menu.
Regards
Ibr
07-22-2015 1:17 PM
Is this what you need: cl_salv_tree->get_selections( )->get_selected_nodes( ) ?
This method also returns the selected nodes.
07-22-2015 1:40 PM
Hello Evgeniy,
Thank you for your reply. I am looking for nodes which are expanded, not for selected.
With regards,
Sandeep Akella
07-22-2015 3:14 PM
Oh.. I think there is only one way: recursively get nodes and check that they have visible child nodes.
Something like this (it's a conept code add some checks to prevent dumps 😞
form f1 using p_node type ref to cl_salv_node.
data(nodes) = p_node->get_children( ).
loop at nodes assigning field-symbol(<fs>).
try.
data(child) = <fs>-node->get_first_child( ).
if child->is_visible.
"your <fs>-node is expanded
"do what you need
"and then lets check child's children
perform f1 using child.
else.
"your <fs>-node is NOT expanded
endif.
catch cx_salv_msg.
"there will be exception if node has no children
"so your <fs>-node can't be expanded.
endtry.
endloop.
endform.
And call it:
perform f1 using cl_salv_tree_object->get_nodes( )->get_root_node( ).
07-27-2015 6:07 AM
Hello Evgeniy,
Those methods are not working. I am using the class CL_GUI_ALV_TREE, which has more flexibility.
With regards,
Sandeep Akella
07-26-2015 12:10 AM
Hi,
you can use CL_GUI_COLUMN_TREE better or CL_GUI_ALV_TREE, the last one has many methods, may you need them later.
and there are many actions, Drag, Drop, double click, context menu.
Regards
Ibr