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

Last menu tree node

giancarla_aguilar
Participant
0 Likes
403

The nodes of the menu tree in my program are all folders. The folder should be open upon double click of that node. The last node is a folder and does not have any children. But upon double click of that last folder node, it does not open and the folder preceeding it remains open. How do I solve this?

I put a expand_no_children event but it seems it does not pass thru its method.

I have this in the PBO area of my screen:

" node double click

lw_event-eventid = cl_gui_simple_tree=>eventid_node_double_click.

lw_event-appl_event = 'X'.

APPEND lw_event TO lt_events.

" expand no child

lw_event-eventid = cl_gui_simple_tree=>eventid_expand_no_children.

lw_event-appl_event = 'X'.

APPEND lw_event TO lt_events.

CALL METHOD g_tree->set_registered_events

EXPORTING

events = lt_events

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

illegal_event_combination = 3.

IF sy-subrc <> 0.

MESSAGE a000(tree_control_msg).

ENDIF.

  • assign event handlers in the application class to each desired event

SET HANDLER g_application->handle_node_double_click FOR g_tree.

SET HANDLER g_application->handle_expand_no_children FOR g_tree.

Is there another event I should use? Or is there a setting I should tick in the definition of the nodes:

lw_node-node_key = 'ROOT'. " Root/Key of the node

lw_node-text = text-t01.

CLEAR lw_node-relatkey. " Special case: A root node has no parent

CLEAR lw_node-relatship. " node.

lw_node-hidden = ' '. " The node is visible,

lw_node-disabled = ' '. " Selectable

lw_node-isfolder = 'X'. " Folder

CLEAR lw_node-n_image. " Folder-/ Leaf-Symbol in state "closed":

lw_node-exp_image = 'X'. " Folder-/ Leaf-Symbol in state "open":

CLEAR lw_node-expander. " the width of the item is adjusted to its content (text)

APPEND lw_node TO gt_nodetab.

  • Node with key 'Child1'

CLEAR lw_node.

lw_node-node_key = 'CHILD1'. " Key of the node

lw_node-text = text-t02.

lw_node-relatkey = 'ROOT'.

lw_node-relatship = cl_gui_list_tree=>relat_last_child.

lw_node-isfolder = 'X'.

APPEND lw_node TO gt_nodetab.

Thanks in advance!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
354

Hi,

Take a look at this program and it will meet your functionality.

[http://wiki.sdn.sap.com/wiki/display/SCM/SCMOrderStatusManagementReport]

cheers

Aveek

1 REPLY 1
Read only

Former Member
0 Likes
355

Hi,

Take a look at this program and it will meet your functionality.

[http://wiki.sdn.sap.com/wiki/display/SCM/SCMOrderStatusManagementReport]

cheers

Aveek