Skip to Content
author's profile photo Former Member
Former Member

calculations at subtotals and totals lines in alv grid

Hi Gurus,

Need help,

I need to do calculations at subtotals and totals level lines in ALV GRID output.

                          date         site       val1      val2      margin %
subtotal line 1:  01012011 ab01    2100     3100     (val2-val1)/ val1 * 100.
subtoal line2  :  02012011 bb02    2200     4100     (val2-val1)/ val1 * 100.
total line                       4300     7200     (val2-val1)/ val1 * 100.

I have done loop at internal table and used control break statements 'at end of..'

and displayed the subtoals and totals in grid output.

but the user want to trigger another ALV out of this subtotals lines so that he can view in detail of selected line.

there are there are subtotals lines where I need to do the calculations at sutotals level.

MOD: kindly dont move this to 'TEST & Playground'.





Moderator Message: OK. I wont move it to Test & Playground Forum. I'll simply lock it, because it's a duplicate thread.

Edited by: kishan P on Jul 18, 2011 11:31 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Jul 16, 2011 at 06:44 PM

    Hi DeepakNandikanti,

    in a comparable or even more complex requirement (not only calculations, even editable total fields) we just created additional records in the display table, deactivated SORT and SUM in the ALV, gave our 'artificial' total line yellow color - and felt good.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 19, 2011 at 08:59 AM

    Hi All,

    Thank you for your replies.

    Well.. I have used an alternative way like:

    1. Did loop at itab and usign 'At end of' did the sum and also the margin % calulation and displayed in the ALV GRID.

    2. When the user selects a row using EXPORT ..memory.. I copied date and site values and did SUBMIT <detail_report> AND RETURN.

    The end user is OK with this solution.. BUT I personally want to do it by getting back totals line back to program do calulations and push it back to ALV GRID.

    If requested to close the thread I will do it.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.