Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Multi Hierarchical ALV

Former Member
0 Likes
1,070

Hi all,

I have header and item internal tables and item table is the header table of other intenal table. how can i display it in ALV.

Regards,

Tejas.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
805

Check this sample code..

REPORT ztree_list .

DATA: nodes LIKE snodetext OCCURS 0 WITH HEADER LINE.
*data: nodes like line of t_nodes.

nodes-id   = 1.
nodes-name = 'level1'.
nodes-type = 'X'.
nodes-tlevel = '01'.
nodes-text = 'level1'.
nodes-tlength = 72.
APPEND nodes.

nodes-id   = 2.
nodes-name = 'level2'.
nodes-type = 'Y'.
nodes-tlevel = '02'.
nodes-text = 'level2'.
APPEND nodes.


nodes-id   = 3.
nodes-name = 'level3'.
nodes-type = 'Y'.
nodes-tlevel = '03'.
nodes-text = 'level3'.
APPEND nodes.

nodes-id   = 4.
nodes-name = 'level4'.
nodes-type = 'Y'.
nodes-tlevel = '04'.
nodes-text = 'level4'.
APPEND nodes.

nodes-id   = 5.
nodes-name = 'level2'.
nodes-type = 'Y'.
nodes-tlevel = '02'.
nodes-text = 'level2'.
APPEND nodes.

nodes-id   = 6.
nodes-name = 'level3'.
nodes-type = 'Y'.
nodes-tlevel = '03'.
nodes-text = 'level3'.
APPEND nodes.

CALL FUNCTION 'RS_TREE_CONSTRUCT'
  TABLES
    nodetab = nodes.

CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
  EXPORTING
    callback_program      = sy-repid.

Hi all,

I have header and item internal tables and item table is the header table of other intenal table. how can i display it in ALV.

Regards,

Tejas.

5 REPLIES 5
Read only

Former Member
0 Likes
805

Multiple Hierachy You have To Use Either ALV Tree or LIST Tree'

For list tree Use the Functions

RS_TREE_CONSTRUCT

RS_TREE_LIST_DISPLAY

Read only

Former Member
0 Likes
806

Check this sample code..

REPORT ztree_list .

DATA: nodes LIKE snodetext OCCURS 0 WITH HEADER LINE.
*data: nodes like line of t_nodes.

nodes-id   = 1.
nodes-name = 'level1'.
nodes-type = 'X'.
nodes-tlevel = '01'.
nodes-text = 'level1'.
nodes-tlength = 72.
APPEND nodes.

nodes-id   = 2.
nodes-name = 'level2'.
nodes-type = 'Y'.
nodes-tlevel = '02'.
nodes-text = 'level2'.
APPEND nodes.


nodes-id   = 3.
nodes-name = 'level3'.
nodes-type = 'Y'.
nodes-tlevel = '03'.
nodes-text = 'level3'.
APPEND nodes.

nodes-id   = 4.
nodes-name = 'level4'.
nodes-type = 'Y'.
nodes-tlevel = '04'.
nodes-text = 'level4'.
APPEND nodes.

nodes-id   = 5.
nodes-name = 'level2'.
nodes-type = 'Y'.
nodes-tlevel = '02'.
nodes-text = 'level2'.
APPEND nodes.

nodes-id   = 6.
nodes-name = 'level3'.
nodes-type = 'Y'.
nodes-tlevel = '03'.
nodes-text = 'level3'.
APPEND nodes.

CALL FUNCTION 'RS_TREE_CONSTRUCT'
  TABLES
    nodetab = nodes.

CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
  EXPORTING
    callback_program      = sy-repid.

Read only

0 Likes
805

Thx ...... can Hierarchical display possible in grid ???

Read only

0 Likes
805

No. it is not possible.

For that we have to go for ALV classes

using CL_GUI_LIST_TREE

Read only

0 Likes
805

hi,

My requirement is to display data from two tables using alv format.

So i tried using hierarchical alv display but it shows in list display.

So how can we make it in grid format using classes?