2024 Aug 25 7:41 AM
Hi,
I have an ALV Tree like this
Here I want the subtotals for every node in their parent node level. So those nodes should have the summation of it's child node values instead of 0.00 - In this case GL Senders should be added to GL Account, GL Accounts to FS Items, FS Items to TSIJ.
I have used cl_salv_tree=>factory method to make the ALV Tree. I have checked there is a do_sum method but that only works for Field Catalogues.
Can you please help me with an example code on how to do it?
Thanks in advance!
2024 Aug 25 9:32 AM
Sorry but CL_SALV_TREE doesn't contain a method named DO_SUM.
There is no concept of "field catalog" in SALV.
For totals, averages and so on, use the "aggregations":
tree->get_aggregations( )->add_aggregation(
columnname = 'YOUR_COLUMN_NAME'
aggregation = if_salv_c_aggregation=>total ).