Skip to Content
author's profile photo Former Member
Former Member

Incorrect subtotals in smartform in SAP 4.6C

Dear all,

first I want to mention I already scanned the forum for my print problem, but didn't find a concrete solution to my problem.

Before you reply, please note I am working in SAP release 4.6C .

I probably have the same problem as Maple Bautista with smartform, subtotal and page break for SAP release 4.6C (so no "Calculation" tabview is available in table node) :

The first page will show one item quantity too much in the subtotal (namely the qty of the first item line of the NEXT page)


the next page will show one item quantity too less in the subtotal (namely the qty of the first item line of the CURRENT page).

Current settings in the smartform :

The item lines all are page protected.

In the text elements the [Only at page break] is switched off.

Unfortunately I am missing the description to the solution in the thread of Maple .

Thanks in advance for your reply in this.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Feb 19, 2007 at 06:18 AM


    The problem you have can be caused when you add your totals. When a page-break is triggered and you use your work area and table of your items in another window it will change the data already in the work area wich would print on the next page as the first item. If you have a seperate window for your totals and loop thru items to add up, do this only after your main window has printed all the lines. Else in the initilization of the form add your totals into a variable.

    Subtotals sum do that in code with you last column and not before your first column. A page break is only triggered when the system won't fit the text to print on the page. At that time it is already in your work area and will print on the next page and why if you change that values will mess up the next page first line to be printed. If you added your value to subtotal it would include the first item on the next page because that code was already executed before the page-break.

    Hope this is somehow understandable and helpfull.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Marius,

      thank you for your answer. Why the subtotal print problem is happening, is clear to me at this moment, but I still have the problem of calculating the subtotal.

      For now, I use a correction during page-break (if SFSY-PAGEBREAK eq 'X' ) in the footer node by subtracting the extra quantity and add the missing quantity in the header node.

      Although I am not proud of this own made logic, it works up till now. Unfortunately the user found an (exceptional) error .

      Therefore I have to look for a more solid program logic.

      We are still working in SAP release 4.6C, but I found some information in the SAP help (for ECC 5.0) about calculating subtotal and grand total in smartform. However, it gets fuzzy at the part of the use of field GS_4NEXT_ADDITION . The explanation of delaying the calculation by using this field seems reasonable, but it is not explicit clear how the program logic in the example works in that way.

      If someone knows what I mean with this SAP help and can explain it more clearly...

      Thanks again !

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2007 at 08:14 PM

    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.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 21, 2011 at 12:31 PM

    Hi Chi Wai Cheung,

    Did you solve this issue i am facing the same issue here please guide if you have got any solution.

    Thanks & Regards,


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.