Skip to Content
0
Former Member
Dec 07, 2006 at 11:20 AM

Displaying icon in tree view

210 Views

Hi all

I want to display an icon in tree view.These icons must be displayed before the node.for this purpose i am using below code.But i didn't find the icon in my output.Please help me to do this.

Thanks in advance.

REPORT ZTREEVIEW_TEST_PROGRAM no standard page heading.

Type-pools : fibs,stree.

data : t_node type snodetext.

data : node_tab like t_node occurs 0 with header line.

clear : node_tab, node_tab[].

node_tab-type = 'T'.

node_tab-name = 'Earth'.

node_tab-tlevel = '01'.

node_tab-nlength = '5'.

node_tab-color = '4'.

node_tab-text = 'Hello'.

node_tab-tlength ='5'.

node_tab-tcolor = 3.

node_tab-NODEICON = 'C:\Program Files\SAP\FrontEnd\SAPgui\bitmap\l_b_odsa'.

append node_tab.

clear node_tab.

node_tab-type = 'P'.

node_tab-name = 'Europe'.

node_tab-tlevel = '02'.

node_tab-nlength = '6'.

node_tab-color = '1'.

node_tab-text = 'Hello'.

node_tab-tlength ='5'.

node_tab-tcolor = 4.

node_tab-NODEICON = 'C:\Program Files\SAP\FrontEnd\SAPgui\bitmap\l_b_odsa.bmp'.

append node_tab.

clear node_tab.

node_tab-type = 'P'.

node_tab-name = 'Asia'.

node_tab-tlevel = '02'.

node_tab-nlength = '4'.

node_tab-color = '1'.

node_tab-text = 'Hello'.

node_tab-tlength ='5'.

node_tab-tcolor = 3.

append node_tab.

clear node_tab.

node_tab-type = 'P'.

node_tab-name = 'India'.

node_tab-tlevel = '03-'.

node_tab-nlength = '5'.

node_tab-color = '1'.

node_tab-text = 'Hello'.

node_tab-tlength ='5'.

node_tab-tcolor = 3.

append node_tab.

clear node_tab.

CALL FUNCTION 'RS_TREE_CONSTRUCT'

  • EXPORTING

  • INSERT_ID = '000000'

  • RELATIONSHIP = ' '

  • LOG =

TABLES

NODETAB = node_tab.

DATA: type_mapping TYPE stree_ctl_type_mapping_tab.

DATA: wa_type TYPE stree_ctl_type_mapping.

CLEAR: type_mapping[].

wa_type-type = 'A'.

wa_type-icon = '@BL@'.

APPEND wa_type TO type_mapping.

CALL FUNCTION 'RS_TREE_LIST_DISPLAY'

EXPORTING

LAYOUT_MODE = ' '

USE_CONTROL = STREE_USE_LIST.

Regards

Giri