Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

totals

Former Member
0 Kudos

hi guru's,

In my report i want totals that if any page changes 'it have display total amount up that page in report foooter'.

how can i get it. help me.

thanks in advance,

1 ACCEPTED SOLUTION

varma_narayana
Active Contributor
0 Kudos

Hi Surendra.

I assume that u have be processing the data of an internal table.

We can Use the SY-TABIX field to capture the index.

Check the code below.

TOP-OF-PAGE.

v_start_tabix = sy-tabix.

END-OF-PAGE.

v_end_tabix = sy-tabix.

Loop at Itab from v_start_tabix to v_end_tabix.

v_pagetotal = v_pagetotal + <yourfield>.

Endloop.

write:/ v_pagetotal.

clear v_pagetotal.

Note : If you want to print the page total in the END-OF-PAGE the above code is ok.

Otherwise you have to use the Read line and Modify line statments additionally.

Let me know if it works/not.

regards.

4 REPLIES 4

mohammed_moqeeth
Active Participant
0 Kudos

Hello Surendra,

You can use control break statement: AT LAST..

Ex:

loop at itab.

....

<b>at last.

sum.

write:/ itab-tot_amt.

endat.</b>

endloop.

Regards,

Moqeeth.

Former Member
0 Kudos

Hi Surendra,

In the REPORT statement, you would have declared the number of lines a page can hold.

REPORT ***** LINE-COUNT page_lines[(footer_lines)]

If you have declared page_lines as 50 and footer lines as 3, then at line number 47 page-break will occur.

So here you can directly mention the system variable SY-PAGNO, which would give you the current page number as the output.

I guess this is what you have asked for.

Allot points if you find this answer useful.

With regards,

Ram.

0 Kudos

Thats ok but i have to write totals in footer such that 'up to the page end how much is the total value ,that will be display in footer of eachpage'

varma_narayana
Active Contributor
0 Kudos

Hi Surendra.

I assume that u have be processing the data of an internal table.

We can Use the SY-TABIX field to capture the index.

Check the code below.

TOP-OF-PAGE.

v_start_tabix = sy-tabix.

END-OF-PAGE.

v_end_tabix = sy-tabix.

Loop at Itab from v_start_tabix to v_end_tabix.

v_pagetotal = v_pagetotal + <yourfield>.

Endloop.

write:/ v_pagetotal.

clear v_pagetotal.

Note : If you want to print the page total in the END-OF-PAGE the above code is ok.

Otherwise you have to use the Read line and Modify line statments additionally.

Let me know if it works/not.

regards.