Ask the Expert

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

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?

    Requires Free Membership to View

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:

  /:  IF &PAGE(3ZC)& = &SAPSCRIPT-FORMPAGES(3ZC)&
 *   [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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: