Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

sap-script page display

Former Member
0 Kudos

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.

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Make sure that your MAIN window dimensions are correct as well as the HEADER window dimensions.

Regards,

Rich Heilman

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

•&#61472;An ENDPROTECT command without a preceding PROTECT command

is ineffective.

•&#61472;If the last ENDPROTECT is missing, it is implicitly assumed at the end

of the text.

•&#61472;PROTECT .. ENDPROTECT commands cannot be nested. If a second

PROTECT command is recognized while another is active, the second is

ignored.

•&#61472;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

Former Member
0 Kudos

HI

GOOD

YOU CAN USE THE PROTECT-ENDPROTECT COMMAND OF SAP SCRIPT TO DISPLAY THE DATA IN A SINGLE PAGE.

THANKS

MRUTYUN