2007 Dec 04 10:02 AM
Hi SDN,
What is the significance of Protect & End-protect in Sapscripts?
Regards,
Rahul.
2007 Dec 04 10:05 AM
2007 Dec 04 10:05 AM
2007 Dec 04 10:07 AM
Hi,
Whatever is given within the PROTECT AND ENDPROTECT stmt will be displayed as a paragraph, there will be no break, provided the content fits into the space available.
Regards,
Vani
2007 Dec 04 10:08 AM
You can use PROTECT...ENDPROTECT.
Protect & endprotect r used in scripts... to prevent page breaks..
If you want to display the data in one page..And do not want to split the data into two pages..you will using PROTECT....ENDPROTECT..
Here is the link, it will make u understand about protect and endprotect..
http://help.sap.com/saphelp_47x200/helpdata/en/d1/80318f454211d189710000e8322d00/frameset.htm
Hope this will help
2007 Dec 04 10:14 AM
Hi Rahul,
The main use of PROTECT ENDPROTECT is to avoid page break.
suppose if u r having some paragraph in ur form, if it appears at the end of page
it may break into 2 piecs ie half paragraph will be in one page and remaining will be in the other page.
If u use this syntax will be in page 1 or it will display in page 2, their will be no any break up in your paragraph.
reward points if help ful.
regards,
desha.
2007 Dec 04 10:16 AM
To allow you to define the areas to be protected against a page break on an individual basis, SAPscript provides the PROTECT.. ENDPROTECT command pair. If you enclose the text to be protected in these commands, then SAPscript will ensure that each line of this text is printed together on the same page. If the complete text fits in the space remaining on the current page, then it is printed on this page just as it would be if no PROTECT command had been used. If, however, the remaining space is not sufficient for the text, then the PROTECT command has the same effect as a NEW-PAGE command and text is printed on a new page.
Thus the PROTECT/ENDPROTECT commands may be regarded as a kind of conditional NEW-PAGE command, the condition being whether or not the lines enclosed between the two commands fit in the space remaining in the current main window.
Syntax:
/: PROTECT
:
:
/: ENDPROTECT
The text lines to be protected are enclosed between the two commands.
An ENDPROTECT command without a preceding PROTECT command has no effect.
If the terminating ENDPROTECT is missing, SAPscript assumes it at the end of the text.
PROTECT.. ENDPROTECT command pairs cannot be nested. If a second PROTECT command occurs before the first one has been terminated by an ENDPROTECT, it is ignored.
If the text enclosed by a PROTECT.. ENDPROTECT pair is itself too long for a single page, then a page break is generated immediately before the text and the text is printed in the normal way. It is then unavoidable that a page break will occur at some point within the text.
Hope dis helps
Reward all helpful answers