cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscript bottom text in Main, just for the last page, but printing only in the last page

Former Member
0 Kudos

I need to print a text but only for the last page in the main window.

I have tried with IF.

IF &PAGE& = &SAPSCRIPT-FORMPAGES&

BOTTOM

....TEXT

ENDBOTTOM

ENDIF

But it prints in all pages in every main window.

Can someone point me what I am doing wrong or how can I do this?

Regards,

Carlos

Accepted Solutions (1)

Accepted Solutions (1)

hedvig_rohonyi
Employee
Employee
0 Kudos

Hello Carlos,

the problem with this condition is the following.

The Sapscript composer cannot know during the processing of e.g. the first page,
how many pages will follow. So &SAPSCRIPT-FORMPAGES& still contains the same
value like& PAGE& and is filled with the correct values only at the very end of the processing.

(when the total number of pages is known).

So I suggest you to use the BOTTOM command in the print program,
when the processing of all item of the MAIN window is ended.


There is an other variable &NEXTPAGE&.  &NEXTPAGE& will always be 0
when it reaches to last page to print. The problem with this variable that
it can not be used in a condition in MAIN window too, only in a separate page window.

Regards,

Hedvig

Former Member

thank you Hedvig, turns out I only needed to put the if inside the bottom command since once it printed it did it in all the pages

Regards,

Carlos

Answers (0)