‎2008 Sep 20 9:11 AM
Hi , I have question in tree display.
When I refresh the tree(after any drag and drop or like so happens) in display, I need the tree to be displayed as it is before. I mean expanded nodes should be expanded and the closed nodes should be closed.
A , B , and C are the root nodes.
1,2,3 are childs of A,
4,5,6 are childs of B, and
7,8 are childs of C.
When tree is displayed first, A and B are expanded and C is closed. If I drag 4 from B and drop it on A, then the tree should get refreshed like :
Under A 1,2,3,4 and expanded
Under B 5,6 and expanded
Under C 7,8 and closed.
But in my tree display , all the root nodes are gets closed.
How can I achive this. Suggest me on this please....
Thanks and Regards,
Balakrishna.N
‎2008 Sep 22 1:10 PM
call method update_nodes then cl_gui_cfw=>flush().
but do not display tree again
‎2008 Sep 22 1:10 PM
call method update_nodes then cl_gui_cfw=>flush().
but do not display tree again
‎2008 Sep 22 1:23 PM
Use 'RS_TREE_CONSTRUCT' this function module for construct the tree.
use 'RS_TREE_LIST_DISPLAY' to display the tree .
i am giving example
EX:-
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
NODETAB = IT_NODE.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
CALLBACK_PROGRAM = SY-REPID
CALLBACK_USER_COMMAND = 'USER_COMMAND'
SCREEN_START_COLUMN = 50
SCREEN_START_LINE = 50
SCREEN_END_COLUMN = 100
SCREEN_END_LINE = 100
USE_CONTROL = 'L'
this is for usrcommand subroutine
CASE PCOMMAND.
WHEN 'OPTI'.
IF PNODE-SELFIELD = 'NAME'.
MOVE PNODE-NAME TO S_PRODH-LOW.
MOVE C_SIGN TO S_PRODH-SIGN.
MOVE C_OPTION TO S_PRODH-OPTION.
APPEND S_PRODH.
LEAVE SCREEN.
ELSEIF PNODE-SELFIELD = 'PLUS'.
CALL FUNCTION 'RS_TREE_EXPAND'
EXPORTING
NODE_ID = PNODE-ID.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSEIF PNODE-SELFIELD = 'MINUS'.
CALL FUNCTION 'RS_TREE_COMPRESS'
EXPORTING
NODE_ID = PNODE-ID.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
WHEN 'ECAN'.
LEAVE TO SCREEN 0.
Edited by: rayavaram sreekar on Sep 22, 2008 2:29 PM