09-10-2007 1:25 PM
hello abapers,
for example a classical report containing of 10 pages...
using aggregate operator sum() we can display the total of the particular field at the end of the report......hw to display subtotal of that infield in each page....
09-10-2007 1:27 PM
in ur code u need to write...
while printing....
val1 = val1 + field-value.
at end of page...
write:/ val1.
clear val1.
endat.
09-10-2007 1:29 PM
Hi,
While printing the report you use the LOOP AT and ENDLOOP. inbetween this take a new Global variale, and count the Total for every reocrd like
G_TOT = ITAB-FIELD + G_TOT.
then at the end of page write this G_TOT then clear that variable
Regards
Sudheer
09-10-2007 1:32 PM
Hi
You can use the number of line per page as logic each line you write this is the system variable SY-LINNO. if this variable is on the last line you can write the subtotal.
if you still have problem let me know.
Regards,
Lakshmikanth
09-10-2007 1:32 PM
hi...
This is the Sample code for ur Requirement.
DATA : V_PGTOT TYPE I. "For Page total Calculation
TOP-OF-PAGE.
V_PGTOT = 0. "Initialize in every page
LOOP AT ITAB.
WRITE: <FIELDS>.
V_PGTOT = V_PGTOT + <YOUR FIELD>.
AT LAST.
SUM.
Write:/ 'Grand Total = ', itab-<field>.
ENDAT.
ENDLOOP.
END-OF-PAGE.
Write:/ 'Page Total = ', V_PGTOT.
reward if Helpful.