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: 

cl_gui_alv_tree - Auto expand Node

Former Member
0 Kudos

Hi,

Is it possible to auto expand all/some nodes in the ALV Tree(Uisng cl_gui_alv_tree Class) in the initial display?

Thanks,

Murali

1 ACCEPTED SOLUTION

Former Member

Methods: EXPAND_NODE - Expands one Node

EXPAND_NODES - Expands Several Nodes

Regards,

Sreejesh P.

2 REPLIES 2

Former Member
0 Kudos

Hi

Try the below way to expand all nodes.

   CALL METHOD TREE1->EXPAND_NODES
     EXPORTING
       IT_NODE_KEY             = GT_NODE_KEY
     EXCEPTIONS
       FAILED                  = 1
       CNTL_SYSTEM_ERROR       = 2
       ERROR_IN_NODE_KEY_TABLE = 3
       DP_ERROR                = 4
       NODE_NOT_FOUND          = 5
       others                  = 6.
   IF SY-SUBRC <> 0.
*    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.

Note GT_NODE_KEY will be having the values of nodes that we wish to expand. Basing on the conditions and the nodes to expand, populate the node keys and call the method to expand the respective nodes.

Hope this helps you.

Kind Regards

Eswar

Former Member

Methods: EXPAND_NODE - Expands one Node

EXPAND_NODES - Expands Several Nodes

Regards,

Sreejesh P.