2007 Feb 05 5:53 PM
Hi,
after a node has been added to a tree (reagged from another tree) how can i expand the node that the new node has been added to.
I have tried CALL METHOD users_tree->expand_node
EXPORTING
node_key = node-relatkey.
But this is not working, i wonder where this has to be called at what point i mean?
Hi,
after a node has been added to a tree (reagged from another tree) how can i expand the node that the new node has been added to.
I have tried CALL METHOD users_tree->expand_node
EXPORTING
node_key = node-relatkey.
But this is not working, i wonder where this has to be called at what point i mean?
2007 Feb 08 12:31 AM
Hello Kieran
Please copy the sample report <b>SAPSIMPLE_TREE_DRAG_DROP_DEMO</b> (transaction SE83, folder <i>Controls -> Trees</i>) and make the following changes in the event handler method <b>HANDLE_RIGHT_TREE_DROP</b>:
METHOD handle_right_tree_drop.
DATA: LOCAL_NODE_TABLE TYPE NODE_TABLE_TYPE,
new_NODE TYPE MTREESNODE,
dataobj type ref to lcl_dragdropdataobject.
" get information about the dragged object:
" the data object
...
CALL METHOD g_right_tree->expand_node
EXPORTING
node_key = node_key
* LEVEL_COUNT =
* EXPAND_SUBTREE =
EXCEPTIONS
FAILED = 1
ILLEGAL_LEVEL_COUNT = 2
CNTL_SYSTEM_ERROR = 3
NODE_NOT_FOUND = 4
CANNOT_EXPAND_LEAF = 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.
ENDMETHOD.Now run the report and close the folder of the right tree. <i>Drag&drop</i> a node from the left to the right tree and the folder in the right tree will be expanded.
Regards
Uwe