05-26-2011 4:42 PM
Hello gurus,
I have a problem with ALV tree:
I have a tree with varios sublevels:
-node_l1
-node_l2
-node_l3
-node_l4
-node_l4
-node_l4
...
Im using the same structure (fieldcat) for all levels, but filling out different fields.
I have one Totals field (do_sum = 'X')
I want to pass my calculated total on level 3, for it to sum up to level 2 and level 1.
The problem is, that it is recalculating the value starting from the lowest level. As I'm not passing any information on level 4, the calculated field total will always be 0.
Is there any way to choose which level of total to calculate?
Can I disable or remove level 4 from my calculation?
Thank you all in advance!
MaryM
05-27-2011 7:04 AM
Hi.,
Instead of do_sum = 'X' at field catalog for automatic total calculation, You calculate the total manually and append it at level 3.
Loop at itab into wa.
wa_fin-f1 = wa-f1.
lv_total = wa-f1.
at level 3.
wa_fin-f1 = lv_total.
clear lv_total.
end at.
append wa_fin to itab_fin.
endloop.
now itab_fin contains the required Output . and pass this to ALV .
hope this helps u.,
Thanks & Regards,
kiran
05-27-2011 7:47 AM
Yes,
Manual calculation is an option. I didn't want to do it in the first place, because there will be a lot of modificacions: adding nodes, deleting notes, changing values, and that means I have to recalculate a lot.
But as there seems to be no other option..
Thanks!
MaryM