Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CL_SALV_TREE Agregation

Hi guys, I have created an hierarchical ALV tree using CL_SALV_TREE but having problem when doing aggregation...

The hierarchy consists of the Org Unit and the Org Units below it, if no aggregation it will look something like this, no problem...

Org. Unit           No. of Emloyees

001                         10

    011                        5

    012                        2

002                            5

     021                       1

     022                       3

-----

Here's the problem, if aggregation is turned on, it will look something like this, it seems that the top Org Unit is overwritten with the total from the below Org Units and doesn't count the top level.

Org. Unit           No. of Emloyees

001                            7

    011                        5

    012                        2

002                            4

     021                       1

     022                       3

Any help is greatly appreciated.

Thanks!

Tags:
replied

Ok, sorry guys, I thought nobody has encountered this issue before and I thought the requirement was unique to our company.

Anyways, I sent an OSS message to SAP and explained that this could be bug with the ALV Tree system but they came back and said that it is the standard behavior and therefore not going to do anything, as always.

So what I did to resolve it is to append another record in the hierarchy with the same node and parent, so if the original hierarchy looks like this"

NodeParent
001
011001
012001

The new hierarchy will look like this (notice the new record added to the bottom of the table), but you only do this if the user selected or turn "ON" the aggregation, otherwise the above hierarchy is used:

Header 1Header 2
001
011001
012001
001001

This method will duplicate the parent node details but you can always control this in your code.

If you have any question just let me know.

Regards,

Ricky Orea

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question