Skip to Content
Former Member
Jul 20, 2009 at 04:49 PM

Percentage subtotals in ALV


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!