05-16-2008 8:00 AM
HI friends,
I have come across a situation where I have to sum the alternate rows for a column in ALV display.
Can somebody help me to resolve this problem..
Thanks in Advance
Regards,
Rajesh
Edited by: Rajesh Akarte on May 16, 2008 10:16 AM
05-16-2008 9:24 AM
you do the calculation manually....
and either put the total at the end of itab.. as a line of itab..
or display the total in the footer
05-16-2008 9:27 AM
Before displaying the internale table in ALV, can you add it ?
If yes..then apply this logic.
CLEAR W_FLAG.
LOOP AT ITAB.
IF W_FLAG IS INITIAL..
W_SUM = ITAB-VALUE + W_SUM.
W_FLAG = 'X'.
ELSE.
CLEAR W_FLAG.
ENDIF.
ENDLOOP.
And while displaying ALV, add a last record with this value.
Edited by: Swastik Bharati on May 16, 2008 10:28 AM
05-16-2008 9:35 AM
Hi friends,
Thanks for the reply..Yes even I had thought the same thing .But as I am doing both sub total and total.
So I may need to high light the sub total row..So that user can easily identify..
Is there any suggestion..plz guide me.
05-16-2008 9:49 AM
ALV does not have such functionality to add alternate records. You do that programatically and add sub total and total records into internal table. Regarding coloring the rows, you can use ALV functionality to color the rows.