07-20-2009 5:49 PM
I need to have percetage subtotals in an OO ALV report. Obvioulsy not the sum of the percetage column but a percentage based on the figures in the report overall. I have used the method GET_SUBTOTALS of CL_GUI_ALV_GRID to allow me to replace the SAP calculated subtotals with my own and this works fine. The problem I have is that if the user sorts the report the SAP derived values return. I have tried to intercept this using the event AFTER_USER_COMMAND and although I can work out the correct subtotals again they are overwritten with the SAP values. Is there another event that I can use or is there a better way to handle this. At the moment I am thinking of removing the sort buttons so the users can't mess up the report!
Rob
07-20-2009 5:56 PM
Hi
I don't know there's the problem, the method GET_SUBTOTALS has the parameter ET_GROUPLEVELS, here u can find out which records belong to a certain subtotal.
Max
07-21-2009 8:40 AM
I have worked this out myself. If I refresh the table dispaly using a soft refresh immediatley after the user command then change the total then refresh again it works.
08-25-2009 2:28 AM
I have a similar issue. But did you notice, if the user uses any of the standard Summation,Avg,Mean, your custom formula is overwritten. Also, if you take a printout, your custom formula is over written by standard and also when you export to an excel sheet, your formula is lost (export to local file and then chose excel; direct export to spreadsheet never works).
I noticed only export to HTML file preserves your formula.. Anyways, good that your solution works for you. A soft refresh wasn't enough for me.