05-19-2006 5:31 PM
hi,
i am printing a sap script, in which i need to give the column headings in "header" window.
the problem is even if the data ends on 1 page, the next page gets printed .
Please tell the code which needs to be included to stop
printing next page when data ends in the current page.
05-19-2006 5:36 PM
05-19-2006 6:05 PM
In the SAP Script you can use following standard variables to control the page.
IF &NEXTPAGE& = 0
Measn it is last page
&SAPSCRIPT-FORMPAGES(2)& will print the total number of pages
&PAGE& will giv eyou the current Page
like if &PAGE& < 2 means you are on first page
Regards
Aman
05-19-2006 6:15 PM
hi Ravindra,
just check the adjustments of mainwindow and footer window(if u defined)
i thinks the dimensions r going to the next screen
Regards,
Naveen
05-19-2006 6:49 PM
Swich on the Graphic Form painter and from ther you can easily check the height and width of the MAIN window.
Also check the Defination and text of the SAP Script from
menu FORM - > CHECK -> DEFINATION and TEXT
Regards
Aman
05-22-2006 6:24 AM
Hai
go through the following Document
PROTECT: Protect from page break
You can determine that a paragraph must not be separated by a page break in the style or layout set. If the attribute page protection is set, then all the lines of this paragraph are always output together on one page. This attribute is linked to the respective paragraph.
It certainly does not make sense, to provide all the paragraphs with a page protection attribute to neutralize an unwanted page break. This event is much too dynamic for this and only results from the current text. Furthermore, it can also happen that you only want to protect parts of a paragraph from a page break. In principle, you could solve this problem using the command NEW-PAGE, by explicitly starting a new page before the affected parts of the text. However, this procedure is not very easy to make changes to. Assume that you have formatted your text using the NEW-PAGE command so that you have no unwanted
page breaks. If you now insert new lines or delete existing ones, you would have to check all the NEW-PAGE commands inserted after this point in the text, as changes can result in the movement of page breaks. With the command pair PROTECT. ENDPROTECT, SAPscript offers you the option of individually defining protection from a page break. If you parenthesize the text in question using these commands, SAPscript automatically guarantees that all the lines it contains are printed together on one page. If the lines fit on the current output page, they are output there, in exactly the same way as if the PROTECT
command was not used. If, however, the space is not sufficient, the PROTECT command then works as a NEW-PAGE and generates a form feed .For this reason, you can view PROTECT/ENDPROTECT as a conditional NEW-PAGE command, whose condition consists of whether the included lines fit into the current window MAIN or not.
Syntax:
/: PROTECT
:
:
/: ENDPROTECT
The lines to be protected lie between the two commands.
An ENDPROTECT command without a preceding PROTECT command
is ineffective.
If the last ENDPROTECT is missing, it is implicitly assumed at the end
of the text.
PROTECT .. ENDPROTECT commands cannot be nested. If a second
PROTECT command is recognized while another is active, the second is
ignored.
If the text between PROTECT and ENDPROTECT is so extensive that it
would not completely fit on an empty page, then only one form feed is
generated and the text is then output normally. Thus, in this case, the
section to be protected can be separated by a page break.
You need to set the USER_SETTINGS perameter in your SmartForm to SPACE
Thanks & regards
Sreeni
05-22-2006 6:57 AM
HI
GOOD
YOU CAN USE THE PROTECT-ENDPROTECT COMMAND OF SAP SCRIPT TO DISPLAY THE DATA IN A SINGLE PAGE.
THANKS
MRUTYUN