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