Main Window

You can identify only one window of a form as main window. You use the main window to spread output over several print pages, which is a prerequisite for printing tables. The output control of the main window triggers an automatic page break as soon as the main window is full, that is as soon as in the main window no space is left for printing outout.

However, the main window "keeps in mind" the exact location at which the output was interrupted. On the next page, the output control resumes printing at exactly this position as soon as in the processing tree the main window is reached again. The subsequent print pages may also include other windows or output areas; they are printed unless a condition suppresses them.

Depending on your needs, it may make sense to use the main window either only on one draft page or on several draft pages.


Main Window on One Draft Page

This is the default. The main window appears only on one draft page, which points to itself using the Next page attribute of the page node. The system processes this draft page again and again until it reaches the end of the main window. Depending on the size of the output in the main window, SAP Smart Forms then produces one or several print pages.

In this case, form printing ends at the end of the main window. If you want to print more pages, you must use the command node to include a dynamic page break as the last inferior node of the main window.

Main Window on Several Draft Pages

Even though only one main window per form is allowed, you can copy it to several draft pages. Each main window then points to the same output control. You use this technique if you want the pages on which a table with items is printed to have different layouts. Height and position of the main window may differ on the different pages, but the width must remain the same throughout.

There are two ways to reach the second draft page:

  • If you want to branch to the second draft page immediately after printing the first draft page with the main window, enter this second draft page as next page of the first one in the page node attributes. If the main window is not filled completely on the first draft page, the specified next page is not processed.
  • If you want to branch to a different draft page later, for example, after printing a particular output, insert a dynamic page break at this position.
  • The draft page specified like this is processed even if the main window was not filled completely (for example, because at the end of the form you want to print General Business Terms).

The draft page to which you branched is processed from the beginning. As soon as it starts processing the main window, SAP Smart Forms resumes printing at the break location (after an automatic page break) or directly after the executed command node (after a dynamic page break).