cancel
Showing results for 
Search instead for 
Did you mean: 

Summarize lines in SmartForms Footer

Former Member
0 Kudos

Hi All,

I have a SmartForms wich have a lines and a footer. I print the total values in this footer (End of Page and End of Report).

Ex.

Descr. Value PAG 1

xxxxxxx 1,00

yyyyyyy 2,00

-


Page Break

Total 3,00

Descr. Value PAG 2

zzzzzzz 4,00

-


Page Break and Page's end

Total 7,00

My problen happend when a Have 10 lines in my smartform but my space to print just permit 9. I don't know why but the smartform print the first Total (Page Break) like printed 10 and in the other page print my value and sum again this value in my total.

To do this sum I create a global variable and after I print the value I create section to put my logic (v_global = v_global + v_printed).

Ex.

Descr. Value PAG 1

xxxxxxx 1,00 (line 1) (v_global = v_global (0) + 1,00)

yyyyyyy 2,00 (line 2) (v_global = v_global (1,00) + 2,00)

..... .....

wwwwww 5,00 (line 9) (v_global = v_global (3,00) + 5,00)

(v_global = v_global (8,00) + 4,00) -> the smartform execute this line but not print because no have space to print

-


Page Break

Total 12,00

Descr. Value PAG 2

zzzzzzz 4,00 (v_global = v_global (12,00) + 4,00)

-


Page Break and Page's end

Total 16,00

Sugestions ????

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

what i need is print 8 in the first and 12 in the other page. Sub total by page.

Ex.

Descr. Value PAG 1

xxxxxxx 1,00 (line 1) (v_global = v_global (0) + 1,00)

yyyyyyy 2,00 (line 2) (v_global = v_global (1,00) + 2,00)

..... .....

wwwwww 5,00 (line 9) (v_global = v_global (3,00) + 5,00)

-


Page Break

Total 8,00 (but SAP print 12,00 -> 8 for this page + 4,00 another which line 10 couldn't be printed in this page)

Next Page ---

Descr. Value PAG 2

zzzzzzz 4,00 Line (10) (v_global = v_global (12,00) + 4,00)

-


Page Break and Page's end

Total 12,00 (SmartForm print 16 because in my total i have 12 + 4 this page (again) )

Former Member
0 Kudos

hi

if u follow my above post u can get result as follow

suppos u ahve 5 records in table... first 4 recods priont in 1st page and next 2 records in 2nd page.

xxxxx 2

rrrrrrrr 5

eeeee 6

ddddd 1

fffffffffff 2

rrrrrfg 10.

now in the first page contains

xxxxx 2

rrrrrrrr 5

eeeee 6

ddddd 1

-


total 14

2nd page contains

fffffffffff 2

rrrrrfg 10.

-


total 12

note: u ahve to clear the total value in the footer partof the TABLE by using the Program lines otherwise it prints 26 in 2nd page.

i hope it is clear now.

Former Member
0 Kudos

Yes, I understand but I can't because my total need acumulate the value from first page, second page, etc, etc...

I need show:

Total First Page - summarize lines in First Page

Total Second page - summarize lines in Second Page + Total first page.

....

Because that I can't do what you said me...

thanks again...

another suggestion?

Former Member
0 Kudos

hi

i am sure it works, i am expliinng again here...

<b>u r requirement is</b> to calculate all the values in the table, print the total (in the first page only totals of the printer lines and in the second page totals of firts page and the second page printed lines)

<b>solution is</b>

create a global variable. then in the TABLE node CALCUKLATION TAB-->

Operation--> Sum-TOtal.

field Name--> wa_itab-field

Target Fields-->glbalvariabl u have diclared (ex.. V_TOT)

Time AFTER loop.

and in the FOOTER tab of the TABLE node print the V_TOT

i am sure it works, just do it exacltly wht i said in this POST.

Former Member
0 Kudos

thanks... works...

Answers (1)

Answers (1)

Former Member
0 Kudos

hi Fengler,

for the calculation wht u need to do is... in the table node --> <b>Calculation tabe</b> will there.. intis calculate the value of the total

Opration = sum

field Name -->v_printed

taraget field Name -->v_global

time-->After Loop.

wht is happening in u r logic is it is calculatin the erlier amounts in the next page also..

<b>do u want to print the total as 12 in 1st page and 4 in second page as in ur example..

then u need to iniitalize the value in v_global at the page break. for this insert programlines in the FOOTER tab of the table here clear the value of v_global</b>

Please Close this thread.. when u r problem is solved. Reward if Helpful

Regards

Naresh Reddy K