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: 

SAPScript FIRST page

ross_goodman
Participant
0 Kudos

Hi,

I have some content that needs to be in the main window. I do not want this content to appear again on pages after the first. How can I define in the text of the main window that this particular element or text should only appear in FIRST window?

Cheers,

Ross Goodman

9 REPLIES 9

Former Member
0 Kudos

Hi, Ross.

You should have a look at the conditions tab for that particular element. At the bottom part of it, there is a "And Additional Event" subarea, in which the first checkbox has the entry "Only on FIRST page".

Hope this helps.

Regards,

Reenal Chandra

0 Kudos

I can only see the element in the editor, how do i get to see the definition tabs?

Ross

former_member186741
Active Contributor
0 Kudos

what you have to do is have multiple PAGES and PAGE-WINDOWS. The first page is often called FIRST! The normal one NEXT (and sometimes there's a LAST too). You can define these exactly as each other with only the slight differences you need.

So you define all the WINDOWS. You define all the PAGES. Then you define PAGE-WINDOWS which dictate which windows appear on which pages.

This will only work if it is not in the MAIN window. If it really has to be in MAIN you will have to change your print program to only call the specific element for the first page.

Alternatively you could check the page number in the element itself and if it is 1 print your stuff,

eg,

IF &PAGE& = 1.

put your stuff here

endif.

Former Member
0 Kudos

HI

GOOD

USE THE PROTECT ENDPROTECT COMMAND OF SAPSCRIPT TO DISPLAY YOUR ALL THE DATA IN A SINGEL PAGE.

PROTECT .... ENDPROTECT

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

THANKS

MRUTYUN

Former Member
0 Kudos

Hi Ross,

u can proceed like this.

if ur text has to come in the beginning of the main window in the First Page, then put all this text within one Text element and call this Text element in ur program before any other Text Element in the Main window. so, this part of code in the sapscript will be executed first in the main window. now if u dont want this piece of code in subsequent pages, u need not do anything extra, just ensure that this piece of code is not being called ( ie the Text Element ), repeatedly in the program, ie, its not in a loop.. so its only written once...

so, basically the funda is watever variables are there within a text element in sapscript, u can control via 'WRITE_FORM' in ur program as to wen n where u can write them in ur output...

hope it helps...

Pl Reward helpful answers..

Former Member
0 Kudos

Hello Ross,

You can write your statements as shown below.

/: IF &PAGE$ EQ '1'

  • write your statements here

/: ENDIF

Please reward with points if found helpful.

Thanks and Regards,

Nagendra

0 Kudos

sorry it should be &PAGE&

Former Member
0 Kudos

Hai Ross

read 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.

•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.

Thanks & regards

Sreeni

ross_goodman
Participant
0 Kudos

thanks, all good.