cancel
Showing results for 
Search instead for 
Did you mean: 

How to sum up for a page in SMARTFORM

Former Member
0 Kudos

I dont see SUM tab in SMARTFORMS. Is there a way for me to fix loop of 20 rows in a page? Need to overflow the rest of the rows into another page. Each page must only have 20 rows. Is there a way for me to total-up the 20 rows of amount in a page? Need to refresh the total sum of 20 rows to be output on that same page layout as it loops to many pages

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Inside the loop,use program lines. Declare input variable as field name to be sumed(say wa-xyz),the variable you use for summing(say v1) and cnt(type i) for counting 20 rows. Declare output variable as v1 and cnt.

In coding,

if cnt = 15.

cnt = 0.

v1 = 0.

endif.

v1 = v1 + wa-xyz.

cnt = cnt + 1.

Answers (2)

Answers (2)

Former Member
0 Kudos

Declare a global variable(say v1 default 0) in global definitions->Global data.

Create a program line inside loop.

Give input and output parameters as v1.

Increment v1 inside the program lines.

Use alternate to check if the counter is 20.

set counter = 0.

Then inside alternate use command to go to new page.

Former Member
0 Kudos

hi ,

for this type of cases use table for printing.

in table u have calculations there u can find the sum of the value