Application Development and Automation 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: 
Read only

sapscript

Former Member
0 Likes
594

in sapscript,"project....endproject",what is the meaning?

thank you.

3 REPLIES 3
Read only

Former Member
0 Likes
556

I think you are looking out for Protect..EndProtect.

Preventing Page Breaks: PROTECT

SAPscript provides the PROTECT .. ENDPROTECT command pair to allow defining the areas to be protected against a page break on an individual basis. If the text to be protected is enclosed 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

Read only

Former Member
0 Likes
556

Hi,

is it protect and endprotect?

if yes then ..This acts like a conditional page break. Putting the text within this command prevents the breaking of the text across multiple pages. If there is not enough space for the entire paragraph to be printed in the space remaining on the page, then the entire paragraph is printed on the next page.

The text which we want to be printed without any break i.e printed completely in a page is

inserted between PROTECT and ENDPROTECT . If sapscript finds that the text cannot be printed on that page completely a implicit page break occurs and the text is printed on the next page

Regards

Sudheer

Read only

Former Member
0 Likes
556

Hi,

there is nothing like project-endproject, but there is protect - endprotect.

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.

Regards,

Richa