SAPscript and Smart Forms: Printing only text on the last page

Learn control commands for an SAPscript and Smart Forms to print "End of Page" text from expert Mark Smithson.

In an SAPscript, some "END OF PAGE" text should be printed on the last page below the footer and it is not. How

can I proceed?

In SAPscript, there are a few ways to print text only on the last page. The logical approach depends on whether you are using the MAIN window or a secondary window to print the text. If you are printing this text in the MAIN window, then simply put the words in a text element which prints last. If your footer is outside/below the MAIN window, then you'll want to use a secondary window-based approach.

If using a secondary window, one possibility is comparing the value in SAPscript symbol PAGE with SAPSCRIPT-FORMPAGES. When they are equal, have the text print; otherwise, have nothing print. However, these variables are not exactly the same. To make them 'apples-to-apples', insert a control command in your SAPscript form similar to a formatting command, for example:

 *   [your END OF PAGE text here]
  /:  ENDIF

Another option is to simply check if &NEXTPAGE& ='0'. This should achieve the same results.

In a Smart Form, you can use a similar MAIN window approach. For a secondary window, you might wish to use a conditional event such as 'Only After End of Main Window' instead.

This was first published in October 2006

Dig deeper on SAPscript and Smart Forms



Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: