2011 Dec 27 8:08 AM
I copied demo program SAPSIMPLE_TREE_CONTROL_DEMO, using my own data, and it presents the tree correctly. In CREATE OBJECT G_TREE I used NODE_SELECTION_MODE = CL_GUI_SIMPLE_TREE=>NODE_SEL_MODE_MULTIPLE instead of NODE_SELECTION_MODE = CL_GUI_SIMPLE_TREE=>NODE_SEL_MODE_SINGLE, and that works too.
However, I can't see any way to send the data which lines were marked to the front end. Similarly in demo program BCALV_TREE_DEMO u2013 I would be glad to use checkboxes instead of marking lines, but how do I return the information which lines were selected? The whole point of the screen is for the user to select lines and return them to another program.
I also tried using the functions in group SEUT - same problem.
THX.
2011 Dec 27 4:45 PM
Hi Edith,
as proposed, you may create a handler method for event SELECTION_CHANGED (don't forget to SET HANDLER). The handler method may call method get_selected_nodes and use this information for what you want to do ("send the data which lines were marked to the front end" is not very clear to me.
Please feel free to post some of your code linesnwith more detailed explanation of the requirement.
Regards
Clemens
I copied demo program SAPSIMPLE_TREE_CONTROL_DEMO, using my own data, and it presents the tree correctly. In CREATE OBJECT G_TREE I used NODE_SELECTION_MODE = CL_GUI_SIMPLE_TREE=>NODE_SEL_MODE_MULTIPLE instead of NODE_SELECTION_MODE = CL_GUI_SIMPLE_TREE=>NODE_SEL_MODE_SINGLE, and that works too.
However, I can't see any way to send the data which lines were marked to the front end. Similarly in demo program BCALV_TREE_DEMO u2013 I would be glad to use checkboxes instead of marking lines, but how do I return the information which lines were selected? The whole point of the screen is for the user to select lines and return them to another program.
I also tried using the functions in group SEUT - same problem.
THX.
2011 Dec 27 2:37 PM
Hi,
I haven't tried this but I think you should implement the event NODE_KEYPRESS or SELECTION_CHANGED in your local class.
Kr,
Manu.
2011 Dec 27 4:45 PM
Hi Edith,
as proposed, you may create a handler method for event SELECTION_CHANGED (don't forget to SET HANDLER). The handler method may call method get_selected_nodes and use this information for what you want to do ("send the data which lines were marked to the front end" is not very clear to me.
Please feel free to post some of your code linesnwith more detailed explanation of the requirement.
Regards
Clemens
2011 Dec 28 6:11 AM
SELECTION_CHANGED can only be used with single selection, so that won't do it. I thought NODE_KEYPRESS might work, but I can't get it to work at all! I suspect that I need to add the event to events, like event-eventid = CL_GUI_SIMPLE_TREE=>EVENTID_NODE_DOUBLE_CLICK or EVENTID_EXPAND_NO_CHILDREN, but I don't see a suitable definition for NODE_KEYPRESS.
Any more ideas?
2011 Dec 28 7:25 AM
Hi,
but I don't see a suitable definition for NODE_KEYPRESS.
What about CL_GUI_SIMPLE_TREE=>EVENTID_NODE_KEYPRESS ?
Kr,
Manu.
2011 Dec 28 7:40 AM
I don't know - I defined method SEL_MULTIPLE FOR EVENT NODE_KEYPRESS OF CL_GUI_SIMPLE_TREE IMPORTING NODE_KEY KEY, and implementation METHOD SEL_MULTIPLE. read table ztree_tab into zline with key node_key = node_key.
I put a breakpoint at read table ztree_tab... but the program didn't stop there (it does stop at breakpoints in NODE_DOUBLE_CLICK and EXPAND_NO_CHILDREN)
What am I missing?
2011 Dec 28 8:05 AM
There are plenty of programs using this event (do a "where used" on the event): e.g. PHREIC_CATEG_TREE, ... However I don't really understand his use.. not so sure it will help you with your issue.
By the way, can't you use the method GET_SELECTED_NODES??
Kr,
m.
Edited by: Manu D'Haeyer on Dec 28, 2011 9:07 AM
2011 Dec 28 1:09 PM
Yes, that did it. It's so simple, once I found the right place:
in PAI on exit-command: CALL METHOD G_TREE->GET_SELECTED_NODES
Thanks to everyone who answered.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |