2015 Sep 10 7:47 PM
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!
2015 Sep 21 3:49 PM
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"
| Node | Parent |
|---|---|
| 001 | |
| 011 | 001 |
| 012 | 001 |
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 1 | Header 2 |
|---|---|
| 001 | |
| 011 | 001 |
| 012 | 001 |
| 001 | 001 |
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
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!
2015 Sep 11 6:35 AM
Hi Ricky,
if the Org. Unit as text/char, so it does the agregation 001 ,011,012,013,014 etc.
so I think, it should be numc, or integer .
just try this out to change the date element which has domain numc or integer,
Regrads
Ibr
2015 Sep 11 1:32 PM
Hi LBR, I was only referring to the "no. of employees" sorry for not specifying. I highlighted it in blue. Like what I said it's actually doing the aggregation but with an issue, please refer to the explaination above...Thanks...:)
2015 Sep 19 3:21 PM
2015 Sep 19 3:53 PM
2015 Sep 19 4:55 PM
You posted your question because you wanted the community to help you. Now you have resolved it, it is only fair that you share the answer with the community and help others.
This site is about helping on another - giving and receiving. Not just receiving.
2015 Sep 21 3:51 PM
Hi Ebrahim, I posted my reply on the original post...
Regards,
Ricky
2015 Sep 21 3:51 PM
Hi Matthew I posted my reply on the original post...
Regards,
Ricky
2015 Sep 21 3:49 PM
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"
| Node | Parent |
|---|---|
| 001 | |
| 011 | 001 |
| 012 | 001 |
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 1 | Header 2 |
|---|---|
| 001 | |
| 011 | 001 |
| 012 | 001 |
| 001 | 001 |
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |