2009 Apr 24 5:11 AM
Hi SAP Experts,
Currently I have ALV Grid table as below as example :
FIELD1 | FIELD2 | Account | Amount |
-
1. Rev | 1.Rev | Acct1 | 100.00 |
1. Rev | 1.Rev | Acct2 | 50.00 |
-
Subtotal FIELD2 (1.Rev) | 150.00 |
Subtotal FIELD1 (1.Rev) | 150.00 |
-
2. Cost | 2.1 Cost1 | Acct3 | 100.00 |
2. Cost | 2.1 Cost1 | Acct4 | 75.00 |
-
Subtotal FIELD2 (2.1 Cost1) | 175.00 |
-
2. Cost | 2.2 Cost2 | Acct5 | 25.00 |
-
Subtotal FIELD2 (2.2 Cost 2) | 25.00 |
-
| Subtotal FIELD1 (2.Cost) | 200.00 |
-
I have 2 questions.
First, as you can see, I have 2 subtotal for 1.Rev eventhough 1.Rev actually only need one subtotal because there is no subgroup for 1.Rev. Is it possible to have only one subtotal for this 1.Rev but I still maintained 2 subtotal for 2.Cost because 2.Cost has subgroup?
My 2nd issue is I need to insert another row exactly below Subtotal FIELD1 (2.Cost) row like this:
-
Gross Margin | (Some formula) |
-
This row does not come from any sub total. The problem is I can not just insert this column and put Gross Margin description in FIELD1 because I will have 3 row like below :
-
Gross Margin | (Formula) |
-
Subtotal FIELD2 (blank) | (Formula) sub total |
Subtotal FIELD1 (Gross Margin) | (Formula) sub total |
-
Is there any way I can insert Gross Margin Row without creating new subtotal for it so it will only have one line in the ALV Grid table? Please help. Thank you.
Regards,
Abraham
Hi SAP Experts,
Currently I have ALV Grid table as below as example :
FIELD1 | FIELD2 | Account | Amount |
-
1. Rev | 1.Rev | Acct1 | 100.00 |
1. Rev | 1.Rev | Acct2 | 50.00 |
-
Subtotal FIELD2 (1.Rev) | 150.00 |
Subtotal FIELD1 (1.Rev) | 150.00 |
-
2. Cost | 2.1 Cost1 | Acct3 | 100.00 |
2. Cost | 2.1 Cost1 | Acct4 | 75.00 |
-
Subtotal FIELD2 (2.1 Cost1) | 175.00 |
-
2. Cost | 2.2 Cost2 | Acct5 | 25.00 |
-
Subtotal FIELD2 (2.2 Cost 2) | 25.00 |
-
| Subtotal FIELD1 (2.Cost) | 200.00 |
-
I have 2 questions.
First, as you can see, I have 2 subtotal for 1.Rev eventhough 1.Rev actually only need one subtotal because there is no subgroup for 1.Rev. Is it possible to have only one subtotal for this 1.Rev but I still maintained 2 subtotal for 2.Cost because 2.Cost has subgroup?
My 2nd issue is I need to insert another row exactly below Subtotal FIELD1 (2.Cost) row like this:
-
Gross Margin | (Some formula) |
-
This row does not come from any sub total. The problem is I can not just insert this column and put Gross Margin description in FIELD1 because I will have 3 row like below :
-
Gross Margin | (Formula) |
-
Subtotal FIELD2 (blank) | (Formula) sub total |
Subtotal FIELD1 (Gross Margin) | (Formula) sub total |
-
Is there any way I can insert Gross Margin Row without creating new subtotal for it so it will only have one line in the ALV Grid table? Please help. Thank you.
Regards,
Abraham
2009 Apr 24 6:03 AM
Check the UI Programming Sticky Thread for sample codes. or search the forum for More sample codes.
2009 Apr 24 6:23 AM
Hi Vijay.
I'm not posting this before I search everywhere and this is not the first time I post in this forum so I know what I should do before posting. If I miss something, maybe you can give me at least a hint whether it can be done or not.
This report that I am using is ALV Grid using REUSE_ALV_GRID_DISPLAY function module and not OOP using dialog module. I never said I need sample code because I only want to know is there a way to do that using ALV Grid which until now I will say that SAP ALV grid has this limitation where you can not insert row without including it in the subtotal.
So, I would be very thankful if someone can give me some clarity on this thing and Vijay, if you really don't know what is the answer, I really appreciate if you can hold your self from making that kind of reply. It does not need experienced ABAP Consultant to write such remarks. Thanks.
Regards,
Abraham
2009 Apr 24 6:28 AM
To make my question more clear, FIELD1 and FIELD2 already has do_sum in their field catalog, that's why it is sub-totaled. What I want to do is insert an independent row that is not affected by this sub-total where as of now I can not do that using ALV Grid.
2009 Apr 24 6:32 AM
Insted of using subtotal functionality of alv , u just loop thrue your internal table and do subtotal manualy , by this u can insert the extra row where ever u want
2009 Apr 24 6:50 AM
Hi Rakash,
thanks for the answer. This is also one of the option that came up when I first heard about the requirement. The problem with this option is user can not collapse and expand like what subtotal function has and when it is exported to excel also will not have the collapse and expand function in Excel.
Regards,
Abraham
2009 Sep 16 6:27 AM
2009 Sep 16 6:33 AM
implement this logic
data: sum type i.
sum = sum + tb_itab-netwr (field name)
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |