cancel
Showing results for 
Search instead for 
Did you mean: 

Page Subtotal when Item takes more than one page

Former Member
0 Kudos

Hi!

I have this problem. I'm working on a very big invoice smartform. I need to calculate a subtotal by page of two columns, these columns are within a loop and this loop within a table in Main Window, and each item could have several values in the column I need to sum up, and also each item could take more than one page, in fact, almost every item take several pages, and the subtotal should be shown in each pages, summing the values of each page of the item.

I tried to use the footer at page break, but it sums up the values of the item that begins in the page that it shows, but the value is actually shown in the following page. The page protection does not work because the item could take several pages and it also could make the subtotal to be shown in the last page of the item, and is also incorrect.

I'm starting to believe that what I need to do is impossible, but if anyone has the solution I will be very grateful.

Thanks a lot!!!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

create a window to display the sum. in Main window within table set one flag whenever the page triggers and trigger the window to display the sum. and again set the flag.

Regards

Shiva

Former Member
0 Kudos

Thanks Shiva, it could be something. Could you tell me how do you know when the page triggers? because neither SFSY-PAGE nor SFSY-FORMPAGES show me the exact moment.

Thanks

Mariela

Answers (3)

Answers (3)

Former Member
0 Kudos

I had a very similar problem and solved it by:

As of release 6.10

1. Define Work Area of Interface Table (i.e. WA_T_SUMS LIKE YLIPS (type of LIPS))

2. In Smartforms Table, mark the Table Line type of the Items to NO PAGE to make sure item appears on page relevant to SumTotal.

3. Table DATA Tab (i.e. ILIPS into GLIPS)

4. Table Calculations Tab, Operation: SUM Total, Field Name: GLIPS-NETWR, Target Field Name: WA_T_SUMS-NETWR, Time: After Loop

5. WA_T_SUMS-NETWR printed in FOOTER text.

For previous releases you can use example logic of "GS_4NEXT_ADDITION" in supplied Smartform SF_TOTAL. Be sure mark your Table Item "No Page" as in 2 above.

CROSS

Former Member
0 Kudos

Hi,

in the table node in the calculations tab give the field name you want to sum and the variable(declared in global definitions). in the table footer write the variable. clear the variable in the program lines after you display it.

Regards,

Vidya.

Former Member
0 Kudos

I think you know how many lines for each page in main window,declare one variable,this variable counts how many item records in the page.

let me take one example ,

i have one order ,this order contains 15 Items ,each page you can fit max 8 lines and 2 line for footer.

Now count that item records cross that 8 lines,then print sub totals.

Reward Points if it is helpful

Thanks

Seshu

Former Member
0 Kudos

Thanks Seshu for your response, but the problem is that the items have several lines, actually, each items could take several pages, because it has too much information.

Thanks anyway!

Mariela