06-24-2008 11:39 AM
HI,
i have requirement to expand all nodes of list tree .plz tell me how to do it
regards ,
venkat.
06-24-2008 11:43 AM
CALL METHOD obj_simple_tree->EXPAND_NODE
EXPORTING
NODE_KEY = node_key
EXPAND_PREDECESSORS =
EXPAND_SUBTREE =
LEVEL_COUNT =
EXCEPTIONS
NODE_NOT_FOUND = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE i398(00) WITH 'Error' sy-subrc
'at methode EXPAND_NODE'.
ENDIF.
put these code within loop for all the nodes....
OR u can use method EXPAND_NODES directly
Reward point if helpful
Edited by: Amitava De on Jun 24, 2008 4:17 PM
06-24-2008 12:05 PM
08-17-2010 1:42 PM
You can try the below code...
Everybody forgot to write that - you can only use this code in PAI and not in the PBO of the screen..
LOOP AT node_table INTO wa_node WHERE isfolder IS NOT INITIAL.
APPEND wa_node-node_key TO it_exp.
ENDLOOP.
CALL METHOD g_tree->expand_nodes
EXPORTING
node_key_table = it_exp
EXCEPTIONS
failed = 1
cntl_system_error = 2
error_in_node_key_table = 3
dp_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
Take care..
06-24-2008 12:49 PM
Hi,
For list display we use following function modules :
1. RS_TREE_CONSTRUCT
2. RS_TREE_LIST_DISPLAY
Below example will help you to generate list tree.
TABLES : mast,
stpo.
PARAMETERS : p_matnr LIKE mast-matnr,
p_werks LIKE mast-werks.
DATA char1.
DATA x TYPE i VALUE 1.
DATA qmenge(10) VALUE '1'.
DATA : node_tab LIKE snodetext OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
node_tab-tlevel = x.
node_tab-text = p_matnr.
node_tab-tlength ='18'.
APPEND node_tab.
CLEAR node_tab.
PERFORM drill_down1 USING p_matnr p_werks.
*&--------------------------------------------------------------------*
*& Form drill_down1
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM drill_down1 USING lv_matnr lv_werks.
WRITE : /'|-' NO-GAP.
DO x TIMES.
WRITE : '-' NO-GAP.
ENDDO.
SELECT SINGLE * FROM mast WHERE matnr = lv_matnr AND werks = lv_werks.
WRITE : lv_matnr.
IF sy-subrc = 0.
x = x + 1.
SELECT * FROM stpo WHERE stlnr = mast-stlnr.
lv_matnr = stpo-idnrk.
MOVE stpo-menge TO qmenge.
PERFORM drill_down1 USING lv_matnr lv_werks.
ENDSELECT.
ENDIF.
ENDFORM. "drill_down1
*&--------------------------------------------------------------------*
*& Form show_tree
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM show_tree .
CALL FUNCTION 'RS_TREE_CONSTRUCT'
* EXPORTING
* INSERT_ID = '000000'
* RELATIONSHIP = ' '
* LOG =
TABLES
nodetab = node_tab
* EXCEPTIONS
* TREE_FAILURE = 1
* ID_NOT_FOUND = 2
* WRONG_RELATIONSHIP = 3
* OTHERS = 4
.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
* CALLBACK_PROGRAM =
* CALLBACK_USER_COMMAND =
* CALLBACK_TEXT_DISPLAY =
* CALLBACK_MOREINFO_DISPLAY =
* CALLBACK_COLOR_DISPLAY =
* CALLBACK_TOP_OF_PAGE =
* CALLBACK_GUI_STATUS =
* CALLBACK_CONTEXT_MENU =
* STATUS = 'IMPLICIT'
* CHECK_DUPLICATE_NAME = '1'
* COLOR_OF_NODE = '4'
* COLOR_OF_MARK = '3'
* COLOR_OF_LINK = '1'
* COLOR_OF_MATCH = '5'
* LOWER_CASE_SENSITIVE = ' '
* MODIFICATION_LOG = ' '
* NODE_LENGTH = 30
* TEXT_LENGTH = 75
* TEXT_LENGTH1 = 0
* TEXT_LENGTH2 = 0
* RETURN_MARKED_SUBTREE = ' '
* SCREEN_START_COLUMN = 0
* SCREEN_START_LINE = 0
* SCREEN_END_COLUMN = 0
* SCREEN_END_LINE = 0
* SUPPRESS_NODE_OUTPUT = ' '
* LAYOUT_MODE = ' '
* USE_CONTROL = STREE_USE_LIST
use_control = 'L'.
* IMPORTING
* F15 =
ENDFORM. "show_treeThis will surely help you.
Plz reward if useful.
Thanks,
Dhanashri.