Protect and endprotect

if we wrote code like this what happens
protect
protect
endprotect
endprotect

hi,
SAPscript provides the PROTECT .. ENDPROTECT command pair to allow you to define the areas to be protected against a page break on an individual basis. 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 output on that 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.
u2022 An ENDPROTECT command without a preceding PROTECT command has no effect.
u2022 If the terminating ENDPROTECT is missing, then it will be assumed at the end of the text.
u2022 PROTECT .. ENDPROTECT command pairs cannot be nested. If a second PROTECT command occurs before the first one has been terminated by an ENDPROTECT, it will be ignored.
u2022 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 output in the normal way. It is then unavoidable that a page break will occur at some point within the text.

Similar Messages

  • Equivalent command in Reports like Sapscripts's PROTECT and ENDPROTECT

    Hi,
    What is the equivalent command in Reports like Sapscripts's PROTECT and ENDPROTECT?
    - Selva

    Hi,
    I don't think you have any particular command for that in reports. but if you are talking about headers / footers then you may use the events TOP-OF-PAGE and END-OF-PAGE.
    Regards,
    Anand Mandalika.

  • Need help regd SCRIPT PROTECT and ENDPROTECT

    hi,
    Actually 3 elements are written in between
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    Command = 'PROTECT'
    and
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    Command = 'ENDPROTECT'
    I am getting the data for which the page is not enough.In this case it is printing 85% of data in the second page and 15% of data in the 3rd page by skipping 1st one eventhough size of 1st page and 2nd page are equal.
    Please suggest me what is happening here .
    thanks
    SAM

    HI,
    You can try out Protect-End protect directly in the form itself by /:.
    If the data is enclosed in this way,
    Protect
    endprotect.
    It is protected for this particular call of the window.
    whereas,
    ENDPROTECT
    PROTECT
    captures the data uptil the next call of the window.
    This first scenario can be useful when you can estimate the amount of data you are printing and the later in random instances such as you want to print the details of flight pertaining to a Carrid to be existing on that page itself, it can be achieved using the second method, where the window is called for every change of carrid.
    Try it out as per your requirement
    Thanks and regards
    Sharath

  • How to use protect and endprotect in smart form

    hi to all experts,
                        im still begineer in smart form , i have two headings like
    company_code:              purchase doc no:
    after this i have a table to be displayed with four columns
    what i want is the whole data should not be split by a page break
    i know this can be achieved by using protect and end protect in sap scripts how to implement in smart form

    probably u have the table inside a loop or a folder or something....
    see this
    Page protection attribute
    Switch for page protection.
    Use
    Page protection switch.
    In some cases you may want to avoid that text is divided by a page break. Therefore, you can protect text sections with a page protection.
    Page protection can extend to
    a paragraph
    a text node
    all output within a folder, for example, several text nodes combined in this folder.
    a line type (table node)
    If on the current page there is not enough space left for the protected text, it is displayed entirely on the next page.
    So u can page protect a line in table...
    in the table node..goto tables tab and click the details tab-->select the line type and check the 'no page break'
    check box

  • How we will have more line of data using protect.. endprotect in main windo

    I have a main window which can have 20 lines and I have paragraph which is of 23  lines, If I use Protect and Endprotect will the data display?(because the protect Endprotect will take whole paragraph in one page but here the paragraph is of 23 lines which cant fit in on window which is of 20 lines)

    Hi
    <u>You have couple of options.</u>
    <b>1) Either you can reduce the font size of the text (To say Courier,  8 Points)
    2) Protect ... Endprotect is for displaying the text inside the block on the same page. Incase the page is geeting ended, then the text printing will not start on that page and will start from the next page to display the whole contents in a page (block).
    3) Increase the page layout from A4 to Letter size if possible.
    View the print preview, to make sure, all the text will come on the desired page as per your requirements.</b>
    Hope this will help.
    Please reward suitable points.
    Regards
    - Atul

  • How to use protect and protect

    how to use protect and endprotect for two different element.
    iam using one element for 'tax' and one for 'item total'
    i wnt to print two elements in one page only.

    Hi
    What does 'Elements' mean for u?
    Text Elements?
    You can try to manage it in print program:
    CALL FUNCTION 'CONTROL_FORM'
      EXPORTING
        COMMAND = 'PROTECT'.
    CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        ELEMENT = 'ELEMENT1'.
    CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        ELEMENT = 'ELEMENT2'.
    CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        ELEMENT = 'ELEMENTN'.
    CALL FUNCTION 'CONTROL_FORM'
      EXPORTING
        COMMAND = 'ENDPROTECT'.
    Max

  • Protect ..endprotect in loop

    Hi
    If u write              
                         protect
                        protect
                       endprotect
                        endprotect   
    like this code in script what will happen?
    In short if u write protect inside protect .. endprotect.  will it work. what will happen?
    Thanks In advance.

    I have not tried that. logically no meaning in that format. Anyway the outer protect..endprotect will avoid a data split and so the inner protect..endprotect will be nullified.
    Cheers
    Kothand

  • Says my computer is no longer protected and that I need to update, but says that my computer is no longer compatable, what does this mean and how do I fix it?

    A warning pops up and says that Firefox is no longer protected, and that I need to upgrade. But then, I'm told that the upgrades are not compatible with my computer. What does this mean, and how to I get the updates?
    Thanks

    http://www.mozilla.org/en-US/firefox/8.0/system-requirements/
    Firefox 3.6.x is the last available from Mozilla for MacOSX 10.4. <br />
    http://www.mozilla.com/en-US/firefox/all-older.html

  • I cannot seem to edit PDF files on Adobe Acrobat as it says the files are protected and I need to enter a Permissions Password?

    I cannot seem to edit PDF files on Adobe Acrobat as it says the files are protected and I need to enter a Permissions Password?

    If the files have a permissions password, you need to know it, and remove security, before you can edit the files. That is correct.

  • Some of my songs from iTunes are AAC (m4a not protected) and some are AAC (m4p Protected).  Why is this???

    Some of my songs from iTunes are AAC (m4a not protected) and some are AAC (m4p Protected).  Why is this???
    Any insights would be much appreciated.

    Because you purchased some of the songs when they were sold as DRM ( protected ) - pre itunes plus, and you bought some of the songs when they were sold as non-drm - itunes plus.
    You can check quick links in the itunes store to see if you have itunes plus upgrades available for purchases.

  • I downloaded the album Hullabaloo and the files are protected and won't let me put them on my iPod touch, even though the computer is authorized. How do i unprotect them?

    Read the title, that's basically it. It says it can't put the songs on my iPod because the computer isn't authorized, even though it is. The files are "protected" and have been like that since i bought the album. Any help? Thanks:)

    De-authorize your computer, then authorize it again.

  • Cjr2 - protect AND unprotect fields in planning layout1-701 for data input

    Where can I configure the field status of a field in teh planning WBS layout 1-702 (profile SAP ALL) in CJR2.
    I would like to protect and unprotect certain fields for input.

    standard planning layouts are protected. you can not change it. create your own planning profile..
    Or try by Using a transaction variant (SHD0)
    may be you can also try GuiXT settings..
    Please search the forum / internet for more informations.

  • Virus Protection and Firewall Question

    I just switched from a PC to a Mac. Should I download virus protection and if so which one is best for a Mac? Also, I believe my computer came with the firewall turned off... should I turn that on?

    Should I download virus protection...
    No. The OS has built-in recognition of known Mac malware in files downloaded from the Internet. All commercial "anti-virus" products for the Mac are worse than useless. Do not install any of them.
    ...and if so which one is best for a Mac?
    Your mind. All Mac malware takes the form of trojans, which depend on the victim's ignorance to be installed. Don't be ignorant.
    Also, I believe my computer came with the firewall turned off... should I turn that on?
    Not unless you are on an untrusted network, such as a public hotspot, and have services enabled in the Sharing preference pane. Under any other circumstances, the firewall should be left off.

  • I've authorized my computer but some files still protected and asking for aol account info which doesnt exist

    I just got a new computer and I'm bringing my music over.
    I authorized the new computer and imported my music. Most of my music is fine EXCEPT some items are still listed as protected and when I click on them it brings up the authorization dialog box. The problem is these files are looking for an AOL account, which I don't have. These files worked fine on my previous system.
    How to I get access to these protected files looking for a non-existant AOL account?

    http://www.apple.com/support/itunes/contact.html

  • Backup is locked with a password protect and i didnt set one...help

    HELP MY BACKUP IS PASSWORD PROTECTED AND I DIDNT SET ONE AND NOW I CANT RESTORE MY MUSIC/PICS/ETC.....

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        

Maybe you are looking for