cancel
Showing results for 
Search instead for 
Did you mean: 

How to sum up for a page in SMARTFORM?(urgent)

Former Member
0 Kudos

Hi,

I'm using SAP system version 4.6C. (Dont have the new SUM tab in SMARTFORMS as in the newer version.

I'd like to enquire..

Is there a way for me to fix loop 15 rows in a page?

(But need to overflow the rest of the rows into another page. Each page must only have 15 rows)

and

Is there a way for me to total-up the 15 rows of amount in a page?

(Need to refresh the total sum of 15rows to be output on that same page layout as it loops to to many pages)

tq very much.

Accepted Solutions (1)

Accepted Solutions (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

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 15.

set counter = 0.

Then inside alternate use command to go to new page.

Hope this helps.If so,kindly reward points.

Former Member
0 Kudos

But this way only calls the next new page to appear, without the overflow data loop into the new page.

And the data doesnt stop looping at 15th in a page.

How to loop the more than 15th rows to the next page?

Thanks.

Message was edited by:

Evelyn Kuang

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

As I mentioned arlier,reset the counter after every 15 entries in program lines.

Former Member
0 Kudos

Yes, I've already reset the counter to 0 in the alternate you mentioned but still cannot...

so, i use restrict the size of the main window to the size of 15 rows. So the rest of the rows can loop into the next page. (but the table header doesnt appear at the next page).

What about the sum?

In smartfrom, how can we sum up the rows of a page?

Thank you..

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

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 15 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.

While the cnt is 15,try to print the total.

Former Member
0 Kudos

Hi Jayanthi,

Is there some bug in Smartform or something?

Why is my 2nd row of data (starting from 2nd page, 3rd page and on) always copying the last row of data in my table?

FYI, I limit the size of my main window so that the rows of data will flow to the next page.

Any advise??? Thanks.

Answers (1)

Answers (1)

Former Member
0 Kudos

declare variable type i.

within a loop.

create a command line, increment the variable.

create a command - Go to new page. in conditions give variable is 15.

Former Member
0 Kudos

But this way only calls the next new page to appear, without the overflow data loop into the new page.

And the data doesnt stop looping at 15th in a page.

How to loop the more than 15th rows to the next page?

Thanks.