The SAPscript system symbol NEXTPAGE also contains a value on the last page of output.
Cause and prerequisitesThe end of the text is not recognized until the last character in the main window is output. The symbol value, however, has already been replaced at that point.
SolutionYou can suppress the output of NEXTPAGE only in type VAR windows, as these process the end-of-page after the main text.
This can be achieved in the following manner:
- 1. At the start of the main layout set text (before the output of the first text element), define a local text symbol LASTPAGE:
/: DEFINE &LASTPAGE& = ' '
- 2. At the end of the main layout set text (at the output of the
last element in the main window), replace the value of the local
text with another value, e.g. "X":
/: DEFINE &LASTPAGE& = 'X'
- 3. In the window with symbol NEXTPAGE, install a conditional
query like the following:
/: IF &LASTPAGE& <> 'X'
* Following page: &NEXTPAGE&
/: ENDIF
NEW-PAGE
On the last output page in all windows that are not type MAIN, the variable &NEXTPAGE& has the value of 0. For example, the following constructs will not be printed. On all other pages the variable NEXTPAGE has a value other than 0. The text "following page" and the variable will, therefore, be printed.
Examples:
&NEXTPAGE(I)&
&'following page: 'NEXTPAGE&
IF &NEXTPAGE& <> '0'
Following page: &NEXTPAGE&
ENDIF
Additional key words
Form, SAPscript, se71, nextpage, command
No comments:
Post a Comment