cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform total sum

Former Member
0 Kudos

Hi All,

I am a newer of smartform. Now I face a problem, I want to do total sum at the bottom of main table without showed at each page. But I tried many method and it is not ok.

Plz help me.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

I got all the result of sum. My problem is how to display the result at the end of the main window.

Former Member
0 Kudos

hi yang,

Read the count (v_tot_ent) mean total number of entries in Internal table of main window.

declare a variable (count) and increment it within the loop mean for each item it increments.

place a condition on footer of ur table

count = v_tot_ent

then only the footer will be displayed and in that ur total text element.

Former Member
0 Kudos

Hi,

I used the method as u mentioned. But i faced a problem.

for example,

I have 3 items to be print in the table and one page only can have 2 item.

the output is quite strange.

count is calculations of loop use the operation number.

v_tot_ent is the number of of entries in Internal table .

<b>fist page</b>

item no. qty count v_tot_ent

1111 1 1 3

2222 1 2 3

sum 3

<b>second page</b>

item no. qty count v_tot_ent

3333 1 3 3

Former Member
0 Kudos

Hi,

in main window there is 3 sub windows like herder main & fotter

in that fotter window pass the filed which u r declear the sum for ex: &itab-netwr&

drag & drop the particuler palce then whenver page break is trigger the total will displayed on the that page it self next page again it will calculat add the previous total lastely displyed ground total of all iteam.

in fotter window u place like this

total : &t_itab-netwar&

t_tab-netwr is decleard in the global data of type netwr

t_tab-netwr type netwr.

in the table there one tab called calcultion in that u pass this files give the option after the loop.

this will help u...

thanks...

Former Member
0 Kudos

Hi,

In the node where u r printing the value , u will be printing each value in the textelement. so Before that text elelment u create a program line.

u take a variable and assign the variable as zero .

in the program lines u put the code as

variable = variable + (text-value).

ex:-itab-menge.( uwant to make sum of menge).

var type menge. = 0.(This u do in global def.).

in the program lines.

var = var + itab-menge.

after the loop.

var will be sum of the all .

Assign points if useful.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Use calculations tab in table for calculations and then use text element footer to display the total.

Former Member
0 Kudos

Hi

After your main window create a final window. copy paste the table from main window to final window. do al the necessary calculation and place the field in the footer section of the table.

hope ur problem is solved.

regards,

shiva

Former Member
0 Kudos

Hi,

In your total text field click check box only after end of main window.

or create a template put the condition as only at end of main window

Regards

Shiva

Former Member
0 Kudos

I can't use at end of main window. Since I used the command for page break. If i choose at end of main window, the sum will be showed on the last page. It is wrong.

former_member196280
Active Contributor
0 Kudos

Do it like this...

Inside the loop,use program lines. Declare input variable as field name to be summed, declare output variable which contains the summation value.

now for displaying the total after all line items or tale lines,

Do a doubleclick on table node you will see the tabs goto EVENTS tab.

Choose EVENTS and set the flag of FOOTER checkbox.

Now a FOOTER node is opened into the TABLE NODE (at the end of the table) and so you can insert a text for the total and value that is calculated in program lines.

Close the thread once your question is answered.

Regards,

SaiRam

Former Member
0 Kudos

I already inserted a text for the total and value under the footer node. It is not ok.