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

CL_SALV_TREE

former_member817716
Discoverer
0 Likes
1,226

Hello Experts,

First time I am using CL_SALV_TREE to create Hierarchy ALV for multiple Production Order report display, the logic is working fine for different material/component.

When same parent and child component are same than third child link with the last child component which have to be linked with parent component

If the material having same name of node and item its working

but material having same name of node and node its not working

Required this way

but the out put coming

LOOP AT gt_hier ASSIGNING <fs_hier>.<br>IF <fs_hier>-parent = ''.<br>DATA(lv_tabix) = sy-tabix.<br>* Add the node as root<br>lo_node = lo_nodes->add_node(<br>related_node = ''<br>relationship = if_salv_c_node_relation=>parent<br>row_style = if_salv_c_tree_style=>emphasized_b ).<br>ELSE.<br>* Read the ALV key of parent node and add as a child<br>LOOP AT gt_hier INTO ls_hier FROM lv_tabix.<br>IF ls_hier-node = <fs_hier>-parent.<br>lo_node = lo_nodes->add_node(<br>related_node = ls_hier-key<br>relationship = if_salv_c_node_relation=>last_child ).<br>EXIT.<br>ENDIF.<br>ENDLOOP.

Hello Experts,

First time I am using CL_SALV_TREE to create Hierarchy ALV for multiple Production Order report display, the logic is working fine for different material/component.

When same parent and child component are same than third child link with the last child component which have to be linked with parent component

If the material having same name of node and item its working

but material having same name of node and node its not working

Required this way

but the out put coming

LOOP AT gt_hier ASSIGNING <fs_hier>.<br>IF <fs_hier>-parent = ''.<br>DATA(lv_tabix) = sy-tabix.<br>* Add the node as root<br>lo_node = lo_nodes->add_node(<br>related_node = ''<br>relationship = if_salv_c_node_relation=>parent<br>row_style = if_salv_c_tree_style=>emphasized_b ).<br>ELSE.<br>* Read the ALV key of parent node and add as a child<br>LOOP AT gt_hier INTO ls_hier FROM lv_tabix.<br>IF ls_hier-node = <fs_hier>-parent.<br>lo_node = lo_nodes->add_node(<br>related_node = ls_hier-key<br>relationship = if_salv_c_node_relation=>last_child ).<br>EXIT.<br>ENDIF.<br>ENDLOOP.
3 REPLIES 3
Read only

former_member817716
Discoverer
0 Likes
1,125

node parent

mat2 mat1

mat3 mat2

mat3 mat3

mat4 mat3

mat5 mat3

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,125

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,125

Thanks.

I can see that your logic depends exclusively on the values in GT_HIER, so please post the contents of GT_HIER.