cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscriot: How to set foot window only at LAST Page

Former Member
0 Kudos

Hi,

There are there MAIN window at my first page, and I want MAIN_02 to be the foot window of my form

and only appear at the LAST Page, Also I want another window TOTAL to be the foot window , still

only appear at the LAST Page.

Anyone could tell me how to set it?

Thanks,

Julie

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Julie,

To set that an window only has to appear at the last page you shuold use the condition

/: IF &PAGE(C)& EQ &SAPSCRIPT-FORMPAGES(C)&

To make an window MAIN-02 only print on the last page is complicated. Because sap-scripts automatically continues with the next main window on a page when the previous main is full. And to be honest i do not know a way to control that. I do not know a way to check in which MAIN SAP-SCRIPT is printing.

There is only 1 command :/NEW-WINDOW to to the next MAIN. See explanation below.

ONLY the MAIN-02 is the only main on your last page then you can go with /: new-page go to that specific last page.

Gr., Frank

NEW-WINDOW: Next window MAIN

You can have up to 99 MAIN windows on one page. These windows are distinguished by a serial number (0..98) and assigned in this order. So, with SAPscript, it is possible to print labels or to output text in multiple columns. If one MAIN window is filled, then the next MAIN window on the page is automatically accessed. A page break is inserted at the end of the final MAIN window.

Using NEW-WINDOW, even if the current window is not completely filled, you can explicitly call the next window MAIN. If you are currently in the last MAIN window of the page, the command works as a NEW-PAGE.

Syntax:

/: NEW-WINDOW

Former Member
0 Kudos

Hi Frank,

thank you very much for your kindly help.

/: IF &PAGE(C)& EQ &SAPSCRIPT-FORMPAGES(C)&

it works.

And about the window MAIN-02, if after I use command NEW-WINDOW

then I use

/: BOTTOM 
........
/: ENDBOTTOM

Could this ensure the window MAIN-02 appear only the last page? have you used before?

Sincerely,

Julie

Former Member
0 Kudos

Hi,

In the second main Window, try using the following code

/: IF &PAGE(C)& EQ &SAPSCRIPT-FORMPAGES(C)&

/* Your code

/: endif.

One more thing. If you wish to print the second main window in the last page only then why do you need to declare it as the MAIN window(since its only occuring on one page).

Regards

Vijai

Former Member
0 Kudos

Hi Julie,

One thing i know for sure.

If Main01 is filled the sapscript continues automatically in MAIN02 if that is on the same PAGE.

and there is no way to check out if that happens or not.

your idea of doing an /: BOTTOM .... /: ENDBOTTOM is smart.

But i do not know if it will workout. If you use new-window while MAIN02 is in use (see above) then it goes to a new-page. but it starts in then in MAIN00. after that an bottom end bottom will print in that same window i think (but i am not sure).

But do a try and see

Maybe it is easier to do 1 MAIN. And at the of print of the first part you start to start the second part in the driverprogram. Then it will be automatically printed in the last page. and you not have touse new-window, bottom endbottom or new-page etc.

hope this helps you.

Gr., Frank

Answers (0)