cancel
Showing results for 
Search instead for 
Did you mean: 

protect

Former Member
0 Kudos

what is the purpose of protect and end-protect in scripts and smartforms.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Let us take an example to discuss that.

Suppose there is a table with 8 records. Now, while printing the line comes to such a position where the page will end after printing only three lines. So generally the system will print those three lines there and print the rest of the 5 lines at the second page. But there may be a requirement that in such a condition print all the lines together (entact) at the scond page.

In that condition if you write that ELEMENT in the write form within the PROTECT and END PROTECT, then the system will write those lines entact, without even a page break.

The same thing is there for the smart form also.

Let me know if you require more clarification.

Rewards points if found useful.

Regards.

Abhijit.

Answers (2)

Answers (2)

Former Member
0 Kudos

hi sndeep ,

You can specify either in the style or in the layout set that a particular paragraph should not be slit in two by a page beak. If the page protect attribute is set then the complete paragraph is always output ona single page.

This property applies only to that particular paragraph. SAPScript provides the PROTECT... ENDPROTECT command pair to allow you to define the areas to be protected against a page beak on an individual basis.

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.

and While using Scripts, if u don't want to break a

paragraph text which aparts to another page

i.e. if u wanna display the paragraph with out

breaking in between two pages, u have to use

protect...endprotect.

REWARD ME IF USEFUL

THANKS,

GUPTA PULLIPUDI

Former Member
0 Kudos

Hi sandeep,

If you need texts to be printed in the same page you can use this statement and the texts will printed all in the same page. If there is no space enough in the current page a new one will be called and all the text will be printed there.