Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Total 1st page and display, on 2nd page 1st+2nd = total and display.

former_member317781
Active Participant
0 Kudos

hi good day,

i have a subtotal where i sum up all the values of the 1st page and display as the subtotal

on second page i sum up all the values of the 2nd page and display as the subtotal

on third page i sum up all the values of the 3rd page and display as the subtotal etc...

now the requirement is,

1. user wants the total of the first page and display as the sub total.

2. when 2nd page he wants the total of the 1st page + 2nd page = subtotal (in 2nd page subtotal)

3. on 3rd page  total of the 1st page + 2nd page + 3rd = subtotal (in 3rd page subtotal)

ex : 1st page  = values (1 +1 + 1 = 3 as subtotal )

        2nd page = values (2 + 2 + 2 = (3 + 6 = 9 as the subtotal))

       3rd page  = values (1 + 1 + 1 = (3 + 6 + 3 = 12 as the subtotal))

how would i get it to this point please?

4 REPLIES 4

former_member188827
Active Contributor
0 Kudos

Are you using smartform or just a simple list?

In any case, please declare a variable say tot. just before subtotal is printed use:

tot = sub_tot + tot.

then use this variable "total" for subtotal printing. On first page,it's value would be equal to value of sub total on first page and on subsequent pages it would have the values of previous pages plus the sub total of current page.

Please paste section of your code where sub total is printed, in case this does not help.

Regards

former_member420878
Active Participant
0 Kudos

Hi,

Declare Total as global variable and subtotal  as local.

total = total + subtotal.

clear subtotal.

Thanks

.

former_member184958
Active Participant
0 Kudos

Hi Jacob,

    You are completed almost everything just do the following,

       lv_total = subtotal + lv_total.

Very first time tot haven't any value so it will print sub total in the first page after the consequence pages it will add the previous total into it.

Warm Regards,

John.

arindam_m
Active Contributor
0 Kudos

Hi,

Just declare GLOBAL variables.

Cheers,

Arindam