‎2007 May 28 5:50 AM
Hi,
Can any one send me a example of graphical tree. I want to create a report in tree view.I have used simple tree using type pools STREE and functions.
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
NODETAB = ITAB.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
USE_CONTROL = 'L'.
Thanks in advance.
Rajiv singh
‎2007 May 28 6:00 AM
Hi
From SE37 enter these tree related fun modules
and use the where used list
you will find lot of programs where these fun modules are used
see them and develop accordingly.
or
Go to tcode DWDM>Controls->Tree Controls.
you will find examples of program....
(OR)
Tcode SE83 -->Tree control....
Reward points if useful
Regards
Anji
‎2007 May 28 5:55 AM
SET PF-STATUS 'GUI_STATUS'.
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = tr
EXCEPTIONS
tree_failure = 1
OTHERS = 4.
***************************************
FOR TREE DISPLAY
***************************************
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_user_command = 'TDR_USER_COMMAND'
callback_gui_status = 'GUI_STATUS'
callback_program = report name
use_control = 'L'.
‎2007 May 28 5:57 AM
report zfdzj028 .
tables: knvh.
types: begin of worktype,
level(2),
hkunnr like knvh-kunnr,
kunnr like knvh-hkunnr,
end of worktype.
data: it_knvh type table of worktype,
wa_knvh like line of it_knvh,
it_temp type table of worktype,
wa_temp like line of it_temp,
it_work type table of worktype,
wa_work like line of it_work.
data : begin of it_nodes occurs 0.
include structure snodetext.
data : end of it_nodes.
constants: number_of_levels type i value 6.
parameter: p_hkunnr like knvh-hkunnr.
start-of-selection.
* Parent = 1. hierarchy node
wa_temp-kunnr = p_hkunnr.
append wa_temp to it_temp.
wa_work-kunnr = wa_temp-kunnr.
wa_work-level = 1.
append wa_work to it_work.
* Reading customer hierarchy (max. 6 level)
do number_of_levels times.
check not it_temp is initial.
select kunnr hkunnr
from knvh
into corresponding fields of table it_knvh
for all entries in it_temp
where hkunnr = it_temp-kunnr.
loop at it_knvh into wa_knvh.
wa_knvh-level = sy-index + 1.
append wa_knvh to it_work.
endloop.
it_temp[] = it_knvh[].
enddo.
* Hierarchy nodes -> tree control
loop at it_work into wa_work where level = 1.
perform make_node.
loop at it_work into wa_work where level = 2 and
hkunnr = wa_work-kunnr.
perform make_node.
loop at it_work into wa_work where level = 3 and
hkunnr = wa_work-kunnr.
perform make_node.
loop at it_work into wa_work where level = 4 and
hkunnr = wa_work-kunnr.
perform make_node.
loop at it_work into wa_work where level = 5 and
hkunnr = wa_work-kunnr.
perform make_node.
loop at it_work into wa_work where level = 6 and
hkunnr = wa_work-kunnr.
perform make_node.
endloop.
endloop.
endloop.
endloop.
endloop.
endloop.
* Making the tree control
call function 'RS_TREE_CONSTRUCT'
tables
nodetab = it_nodes
exceptions
tree_failure = 1.
* Display the tree control
data : f15 type c.
call function 'RS_TREE_LIST_DISPLAY'
exporting
callback_program = sy-repid
importing
f15 = f15.
*&--------------------------------------------------------------------*
*& Form MAKE_NODE
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
form make_node.
it_nodes-name = wa_work-kunnr.
it_nodes-color = 1.
it_nodes-intensiv = 1.
it_nodes-text = wa_work-kunnr.
it_nodes-tlength = 16.
it_nodes-tlevel = wa_work-level.
it_nodes-tcolor = 1.
it_nodes-tintensiv = 1.
append it_nodes.
endform. "MAKE_NODE
‎2007 May 28 6:00 AM
Hi
From SE37 enter these tree related fun modules
and use the where used list
you will find lot of programs where these fun modules are used
see them and develop accordingly.
or
Go to tcode DWDM>Controls->Tree Controls.
you will find examples of program....
(OR)
Tcode SE83 -->Tree control....
Reward points if useful
Regards
Anji