Skip to Content

smartforms - note on last page


i'm trying to print a total only when i'm in the last page of a smartforms, and a subtotal in the footer of every page while is not the last one.

I'm checking the system variables SFSY-PAGE and SFSY-FORMPAGES but they seem to be calculated after the SF is processed. While debugging they have always the same value and i can't test if i am in the last page of the SF. This SF is for transaction VF03.

Thanks in advance!



Message was edited by: Laura Quinteros

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 30, 2005 at 01:52 PM

    Hello Laura,

    The correct way to do this would be to use the Calculations tab in your table in the smarform. Using this, you can use the Total function to add the value of a particular field into another field, and use the Before or After loop addition.

    You can then output the value of the target fields after the table (which would appear on every page).

    While this is the correct way to do it, we did encounter problems with it, because at the end of a page, for some reason, the smartform processor adds the last line of your table into the total!!!

    We eventually gave up, and convinced the user to only have a grand total at the end.

    I have found that running totals are much easier to do in good old Layout Sets (SE71). They never let you down 😉

    If, however, you try the above solution and run into problems, be so kind as to open up a OSS/SAPnet message with SAP and ask them to look into it.

    All the best/Keep trying!


    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Martin,

      About displaying only the total on the last page and not the subtotals in that very same page, I follow a colleague's idea: put the page number and the subtotal per page into an internal table in some code line of some node, and then process this internal table in a window of type L as I mentioned on the last post.



  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2005 at 01:42 PM

    U might b having a main window right ? and is the end of main window signify end of page ? if so, set a flag when main window is over.

    In the total window put the condition taht the flag should be set...and the flag will eb set only when the main window is complete.

    Checking page numbers will not work. because it is computed dynamically.

    Close this if it solves ur problem.

    Remember to reward points !!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2005 at 11:02 AM

    I also find same problem with you, Michael, but now I found the better solution that is,

    1) You should separate to several windows.

    2) Lets say you just want to display 'TOTAL' at the last page after the last items in main window, you can define total at the independent window, double click this window > under 'condition" tab > you can see the box named "additional event" -> tick "only after end of main window"

    3) Then now you can see those window only at the very last page after last item in main window.

    p/s you can define several windows that you only want to print at the very last page (after last item in main window) using same steps above.

    It works well same as commands:-

    If &nextpage& = 0 in Sapscripts

    Hope it helps you although is late.

    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.