on 07-05-2011 1:33 PM
Hi,
I have an multipage Invoice docuement , wherein each record displays an amount field and at the end of the Inovoice document the total amount will be displayed.
My requirement was when the Invoice document is more than one page , then I need to display the Sub-total at end of each page, In order to do this I used ONLY AT PAGE BREAK EVENT option in the footer of the main window. I used to take add each record amount and used to display the same value at PAGE BREAK EVENT
However , The AT PAGE BREAK EVENT is trigerred only AFTER READING the FIRST RECORD of the next page , as a result of which the Subtotal amount it is displaying incorrect amaout as it considers the next page first record also.
Let me know how to sove this isse.
Consider each page displays three records only.. my output is displaying as below which is not correct.
PAGE 1
A 100
B 200
C 200
SUB TOTAL 600
PAGE2
D 100
E 400
TOTAL 1000
As seen above the Subtotal should be 500 but it is displaying 600 as it consders 100 of the next page also .
Kindly guide how to proceed.
Regards,
Senthil
Hi,
You can use the subtotal option in the table.
check this:
[http://wiki.sdn.sap.com/wiki/display/ABAP/Togetsubtotalsoneachpagein+smartforms]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You need to code it accordingly for displaying the sub-total.
Fix the number of records for each page.
Add your code for calculating the sub-total.(lv_tot = lv_tot + wa_tot) and for finding the tabix value.
Once it exceeds the number of recods,print the sub-total.
Jshree
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can write a simple logic to get the correct sub-total. Check below code - fine tune for other cases like if only 1 row in internal table...
LV_SUBTOTAL = LV_SUBTOTAL + LV_VALUE.
LV_VALUE = WA_DATA-FLD1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.