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

Quick Qu: Expand_nodes method

Former Member
0 Likes
542

Hi all,

I'm trying to code for expand all and collapse all a tree on a dynpro. Collapsing is fine, but I'm getting a 'MESSAGE_TYPE_X' runtime error when I call the expand_nodes method.

I'm using button on a Gui status called 'EXPANDA', and incoporated the following code in the PAI.

    WHEN 'EXPANDA'.
* Expand All Trees

      CLEAR g_node_key_table.
      LOOP AT it_node_table INTO wa_node_area.
        APPEND wa_node_area-node_key TO g_node_key_table.
      ENDLOOP.
      CALL METHOD g_tree->expand_nodes
        EXPORTING
          node_key_table = g_node_key_table.

G_TREE has a type ref to CL_GUI_LIST_TREE.

In the past, this error message has meant that I don't have the table with the node list correct - and in this instance, a significant number of the nodes are flagged as hidden.

Therefore, my first question is - should the list of nodes being passed in be the complete node list (including hidden nodes), or only those nodes that are not hidden, as these will be the only ones that I want to expand.

Or am I missing something else?

Cheers,

Stephen

1 REPLY 1
Read only

Former Member
0 Likes
404

Resolved internally. The trick is to only pass through the parent nodes - the methods did not know how to deal with the children, as they were not expandable.