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: 

Tree node in open mode when moudle pool executed....

Former Member
0 Kudos

Hello Gurus,

I have written following code in PBO of a screen which uses custom control for building node table of Tree. Now when the program is executed, the parent node is closed and to see the child of this parent node I have to drill down on parent node.

But my requirement is I want the child node already open under parent node? How Can I do this ?

  • Node with key 'Root'

NODE-NODE_KEY = 'PARENT'.

CLEAR NODE-RELATKEY. " Special case: A root node has no parent

CLEAR NODE-RELATSHIP. " node.

NODE-HIDDEN = ' '. " The node is visible,

NODE-DISABLED = ' '. " selectable,

NODE-ISFOLDER = 'X'. " a folder.

CLEAR NODE-N_IMAGE. " Folder-/ Leaf-Symbol in state "closed":

CLEAR NODE-EXP_IMAGE." Folder-/ Leaf-Symbol in state "open"

NODE-EXPANDER = 'X'. " The node is marked with a '+', although

NODE-TEXT = 'Parent'.

APPEND NODE TO NODE_TABLE.

CLEAR NODE.

NODE-NODE_KEY = CHILD.

NODE-RELATKEY = 'PARENT''.

NODE-RELATSHIP = CL_GUI_SIMPLE_TREE=>RELAT_LAST_CHILD.

NODE-ISFOLDER = 'X'.

NODE-TEXT = 'CHILD'.

NODE-N_IMAGE = '@I2@'.

APPEND NODE TO NODE_TABLE.

Regards,

Jainam.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Use method EXPANDE_NODE for the PARENT node.

Like:


    CALL METHOD W_TREE->EXPAND_NODE
      EXPORTING
        NODE_KEY            = 'PARENT'
      EXCEPTIONS
        FAILED              = 1
        ILLEGAL_LEVEL_COUNT = 2
        CNTL_SYSTEM_ERROR   = 3
        NODE_NOT_FOUND      = 4
        CANNOT_EXPAND_LEAF  = 5.
    IF SY-SUBRC <> 0.
      MESSAGE A000(TREE_CONTROL_MSG).
    ENDIF.

Regards,

Naimesh Patel

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos

Use method EXPANDE_NODE for the PARENT node.

Like:


    CALL METHOD W_TREE->EXPAND_NODE
      EXPORTING
        NODE_KEY            = 'PARENT'
      EXCEPTIONS
        FAILED              = 1
        ILLEGAL_LEVEL_COUNT = 2
        CNTL_SYSTEM_ERROR   = 3
        NODE_NOT_FOUND      = 4
        CANNOT_EXPAND_LEAF  = 5.
    IF SY-SUBRC <> 0.
      MESSAGE A000(TREE_CONTROL_MSG).
    ENDIF.

Regards,

Naimesh Patel