2008 Feb 06 1:58 PM
Hi,
I have 3 columns. I am able to get their subtotals.
Now there is a 4th column which shows percentage of first five columns.
Now last record shows all the subtotals..
last record of column 1 shows the subtotal of all the records in column 1.
last record of column 2 shows the subtotal of all the records in column 2.
last record of column 3 shows the subtotal of all the records in column 3.
Now last record of column 4 should show the the percentage of first 3 columns.
How to do this!!
<REMOVED BY MODERATOR>
Regards
Edited by: Alvaro Tejada Galindo on Feb 6, 2008 2:18 PM
2008 Feb 06 2:15 PM
Could you show me an example with numbers of what you need? Maybe I can help you.
Hi,
I have 3 columns. I am able to get their subtotals.
Now there is a 4th column which shows percentage of first five columns.
Now last record shows all the subtotals..
last record of column 1 shows the subtotal of all the records in column 1.
last record of column 2 shows the subtotal of all the records in column 2.
last record of column 3 shows the subtotal of all the records in column 3.
Now last record of column 4 should show the the percentage of first 3 columns.
How to do this!!
<REMOVED BY MODERATOR>
Regards
Edited by: Alvaro Tejada Galindo on Feb 6, 2008 2:18 PM
2008 Feb 06 2:15 PM
Could you show me an example with numbers of what you need? Maybe I can help you.
2008 Feb 06 2:28 PM
2008 Feb 06 2:44 PM
I could but maybe someone else has the same doubt and if it's published here it will be more helpful. Just post a table with some numbers to clear your point and it will be easier for us to understand you.
Regards,
Pablo
2008 Feb 06 2:57 PM
i was trying to paste a small excel sheet, but was not able to do so. That is why i asked for your email so that i van attach it there.
Please tell how to post table with this.
I also try to explain it here with example.
Row 1: values 4 5 6 7 percentage of 4 columns
Row 2: values 1 2 3 4 percentage of 4 columns
Row 3: values 2 3 4 5 percentage of 4 columns
Row 4 contains subtotals
7 10 13 16 here i need percentage of subtotals of first 4 columns . Problem here is subtotals are coming automatically usinf ALV. How to get percentage here?
I hope i am able to explain my problem.
2008 Feb 07 11:36 AM
Ok, I think I understood now. You need to store the porcentage of column X where the subtotal of column X is appearing.
If you are using CL_GUI_ALV_GRID there's a method that returns a field symbol to the subtotals, it is called GET_SUBTOTALS. Since it uses field symbols, you may change the subtotals. Once you have them, you can add them and calculate the porcentage of each one. Then you can replace the values in the field symbol. Here is a sample code of how to call and change the subtotals, maybe you should call the method GET_SUBTOTALS and debug it to better understand it.
CALL METHOD go_alv_serv->get_subtotals
IMPORTING
ep_collect00 = lv_total.
ASSIGN lv_total->* TO <fs_total_serv>.
READ TABLE <fs_total_serv> INDEX 1 INTO ls_zsmmpur003.
ls_zsmmpur003-zporcent = 100.
MODIFY <fs_total_serv> FROM ls_zsmmpur003
INDEX 1 TRANSPORTING zporcent.
* Refresco la grilla para reflejar los cambios
CALL METHOD go_alv_serv->refresh_table_display
EXPORTING
i_soft_refresh = 'X'.I hope it helps, reward points if found useful!
Regards,
Pablo
2008 Feb 07 12:19 PM
Hi Pablo,
Thanks a ton for your reply. You have understood my query correctly.
I am using FM REUSE_ALV_GRID_DISPLAY. Can you please some inputs how to do this using above FM technique.
Regards
2008 Feb 07 12:38 PM
I don't think you can do it with the FM....sorry. Try using that class, it's very simple!