cancel
Showing results for 
Search instead for 
Did you mean: 

sap-script: printing of page total

Former Member
0 Kudos

hi gurus,

i require your help in printing the total of any numeric value being displayed in a table at every page break.

eg: page 1/3

matno unrestricted_stock stock_under_inspection stock_under_quality

m1 50 40 60

m2 60 40 60

m3 70 40 60

m4 10 40 60

total 190 160 240

page 2/3

matno unrestricted_stock stock_under_inspection stock_under_quality

m5 50 40 60

m6 60 40 60

m7 70 40 60

m8 10 40 60

total 190 160 240

page 3/3

matno unrestricted_stock stock_under_inspection stock_under_quality

m9 50 40 60

m10 60 40 60

m11 70 40 60

m12 10 40 60

total 190 160 240

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Harini,

You need to create one more window just below main window to print totals.

Create the variables necessary for summing values and sum them inside the loop of main table (Just below 'WRITE_FORM' of main window ).

The newly created window will hold the totals. We are not required to call this new window explicitly. The SAP will print the totals from the variables after printing the main window.

Use the perform routine from the new window to clear the totals of the program (So totals does not get accumulated for next page from the previous page).

Hope this helps!!

Former Member
0 Kudos

Hi,

1.&SAPSCRIPT-FORMPAGES& Total number of pages in currently formatted layout set .

2.&PAGE& Page

you need (1/3)

&PAGE& / &SAPSCRIPT-FORMPAGES&.

Regards,

If helpful reward with points(Don't forget).