Google Search - Blog...........

ABAP - Simple Tree ALV Structure.

REPORT ztree_test_pgm.

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.
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.
APPEND node_tab.
CLEAR node_tab.

node_tab-type = 'P'.
node_tab-name = 'Germany'.
node_tab-tlevel = '03'.
node_tab-nlength = '7'.
node_tab-color = '4'.
node_tab-text = 'Hello'.
node_tab-tlength ='5'.
node_tab-tcolor = 4.
APPEND node_tab.
CLEAR node_tab.

node_tab-type = 'P'.
node_tab-name = 'Berlin'.
node_tab-tlevel = '04'.
node_tab-nlength = '6'.
node_tab-color = '4'.
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 = '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.

node_tab-type = 'P'.
node_tab-name = 'Bombay'.
node_tab-tlevel = '04-'.
node_tab-nlength = '6'.
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'
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
use_control = 'L'.



ALSO READ:

- ALV Subtotals In Different Blocks.

- ALV With Page Numbers & Subtotals.

- Footer Functionality In ALV Reports.

- Calling One ALV From Other ALV Report Program.

..... Back To Index On ALV List/ Grid Display.

..... Back To MAIN INDEX.


No comments:

Post a Comment