Triggerring new page in the script

Hi
can anybody tell me how to trigger a new page in the script on condition.
my problem is i want to print material & its discription based on the MRP controller using scripts.
if the MRP controller changes then it has to trigger a new page in the script.
page 1.
MRP controller 102
material1  material1-discription.
material2 material2-discritpion.
new page shoud trigger here
page 2
MRP Controller 103
material1  material1-discription.
material2 material2-discritpion.
Thanks in advance

Hi,
First Call That text Element Were U Used New-page Coomand.
SAPscript automatically inserts a page break when the main window of a page (MAIN) is full. You can use the NEW-PAGE command to force a page break in the text at any point you want one. The text following this command then appears on a new page. The page break is always performed (it is an unconditional page break).
The NEW-PAGE command completes the current page. This means that all the windows that are still on the page are printed immediately. If you use the NEW-PAGE command without parameters, the page defined in the current form as the next page will be taken next. If, however, your form contains a number of different pages, then you can specify any one of these as the next page to be used.
Syntax:
/: NEW-PAGE page_name
/: NEW-PAGE
The current page will be completed and the text in the following lines will be written to the page specified in the form.
/: NEW-PAGE S1
As above, except that the page S1 will be taken as the next page.
If, in a NEW-PAGE command, you specify a page not contained in the form, the specification is ignored.
Take care that there are no blank lines immediately before a NEW-PAGE command. If an implicit page break occurs within the blank lines, an unexpected blank page may be printed.
2.it can be set in two way
1 using SE71 ur Script transaction
u can create new page by clicking page tab in Se71 and goto edit->create Element.. that will create a new page..
2 Using ur SE38 itself by setting a flag variable = X u can create a new page..
if page = ' X '.
new-page.
endif.
reward if helpful
Shiva Kumar

Similar Messages

  • Triggering NEW-PAGE in the SAPSCRIPT

    Hi All,
    In the SAPSCRIPT for purchase order, in the last page i need to print terms and conditions. For this i have created third page(in MEDRCUK there are two pages) and i am trying to check the following condition.
    IF &sapscript-formpages& = &page&
       NEW-PAGE THIRD
    ENDIF.
    But the condition never becoming true. Can somebody tell me how to achieve this.
    Thanks in advance

    > Hi
    >
    > Your control can't work, becuase the &PAGE& is the
    > current page and &sapscript-formpages& is total
    > number of page, but the system can know this data
    > after loading completly your sapscript.
    >
    > If you want to know when you are at the last page,
    > check the variable &NEXTPAGE& (for the number of next
    > page), it'll be 0 if you are in the last page.
    >
    > IF &NEXTPAGE&  = '0'
    > NEW-PAGE THIRD
    > ENDIF.
    >
    > Max
    >
    >
    > Message was edited by: max bianchi
    Hi Max,
    Thanx for your ur reply. I have tried with IF &NEXTPAGE& = '0' also, now also it is not working. In debug mode i checked the value of &NEXTPAGE&, only when the control leaves main window that time its value becoming ZERO. Actually in the last element of the main window the condition is written.
    Regards
    Rajavardhana Reddy

  • Need to add a new page in the SAP Script as last page

    Hello,
    I need to add a new page in the SAP Script as last page.
    Currently I have three pages in the form(FIRST,NEXT,LAST). For this I created one more page END.
    FIRST page next page is NEXT
    NEXT page next page is NEXT
    LAST page next page is LAST
    END page next page is END.
    I used NEW-PAGE END in the main window but it is not working and also I trired with CONTROL_FORM this also not working.
    Thanks,
    Ravi.

    Hello,
    I need to add a new page in the SAP Script as last page.
    Currently I have three pages in the form(FIRST,NEXT,LAST). For this I created one more page END.
    FIRST page next page is NEXT
    NEXT page next page is NEXT
    LAST page next page is LAST
    END page next page is END.
    Create the text element in the main wondow of your form
    /E           ENDPAGE
    /:           NEW-PAGE END
    and call the element from your print program by using write_form, where you want the END page in your print.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          element = 'ENDPAGE'
        EXCEPTIONS
          element = 1
          window  = 2.
    Thanks,
    Ravi.

  • New page in sap script

    hi all,
    my requirement is i want to display internal table items in new page when forst page is filled.
    ihve given the code like
    loop at it_table.
    write form
    given the text element inthe write form.
    endloop.
    how to trigger new-page when the first page is filled. in this code.ihve created new page and in script and first pages next page is new page.how to call this page.data is displayed in new page with out any format.
    regards,

    Hello everyone.
    I have a similar requirement. When printing a sales order, I need to always print a bitmap in the 2nd page. This means that:
    If the order's line items can fit in the first page's main window, I want to have a two pages output, one page with line items and one page with the bitmap.
    If the order's line items cannot fit in the first page's main window, I want to have three (or more) pages output, first page with line items, second page with the bitmap and the remaining pages with line items.
    I have defined three pages: "first", "second" and "next".
    "First" page has "second" page as next.
    "Second" page has "next" page as next.
    "Next" page has "next" page as next.
    The problem is that when all line items fit in the main window of the "first" page, the "second" page is not triggered. How can I figure out that there will be only one page printed in order to trigger a new one explicitly as soon as the loop in the line-items' internal table finishes?
    Can it be done with an 'IF &SAPSCRIPT-FORMPAGES& = 1' statement? If yes, where should I put it? I have tried it and it doesn't work.
    Thank you in advance.
    Edited by: George Serfiotis on Oct 30, 2009 10:52 AM

  • Cannot open favourites using the Firefox tag that usually opens up the menu and a new page.. Now I get the dropdown menu but cannot open a new page, losing the homepage every time I explore, can you say WHY? all other versions worked fine!

    I cannot open a new page from the Firefox favorites menu, it worked before in other versions and this new 5.1 version, but stopped working a few days ago, uninstalled, downloaded a fresh program.. same problem exists. I usually leave my 'Home Page' as a stable page and just open 'new' pages for i.e. Google, Internet Banking etc. the '+' sign on my home page or other loaded pages does not operate, hate having to now constantly sign in to my hotmail home page if and when I open new pages, can you help?

    Websites remembering you and automatically log you in is stored in a cookie.
    * Create an allow cookie exception (Tools > Options > Privacy > Cookies: Exceptions) to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    Make sure that you do not run Firefox in Private Browsing mode.
    * https://support.mozilla.com/kb/Private+Browsing
    * In [[Private Browsing]] mode all cookies are session cookies that expire if that session is ended, so websites won't remember you.
    * Do not use [[Clear Recent History]] to clear the "Cookies" and the "Site Preferences"
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    * http://kb.mozillazine.org/Cookies

  • Why does a box that says "uninstal set" keep popping up when i go to a new page, refresh the page, or ever open up the browser ever i upgraded to the new firefox?

    I upgraded to the newer version of firefox, and ever since then every time i go to a new page, refresh the page, or open it the interned a box pops up and says "uninstal set" and won't let me continue until i click "ok" why is this happening, and how can i fix it?

    go to Tools, add-ons, then only disable java 6.0.22 ONLY, then you have to click on restart. That solved my problem.

  • How to print in the last page of the script..?

    Hi,
    I am working on a script. I have a header window and one main window. In the main window, I am printing the line items of the Invoice. Once the line items finish, I have to print the sub totals there. and also to print the company agreement details(around 10 lines of text) in the last page of the script.
    So, <b>how to print the agreement details in the last page of the script..?</b>
    Can anyone provide me a sample code to find the last page of the Script layout..?
    And regarding writing the agreement details, is it better to hard code the text or use the standard texts..? which one is better..?
    Regards,
    Paddu.

    HI,
      Just create a Standard text, if you are going to use this standard text in other layouts also... and use it otherwise you can hard code it as this its of only 10 lines.
    declare one more element in the  main window itselft and call it atlast it would print in the last page..
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'FOOTER'<b><- This element should contain the agreement details</b>
    FUNCTION = 'SET'
    TYPE = 'BODY'
    WINDOW = 'MAIN'
    EXCEPTIONS
    ELEMENT = 1.
    Thanks
    Mahesh

  • How do you make a link open on a new page (typically the target="_blank" command) in MUSE?

    how do you make a link open on a new page (typically the target="_blank" command) in MUSE?

    Newer version does not have the same interface.  I'm stuck trying to understand how to add a "blank" target to a hyperlink...  See how your screenshot has a dropdown associated with the "Hyperlink" object?  Mine doesn't...

  • How to insert a new page at the beginning of a chapter

    I tried to do that but not successful. Can we do that? What are the limitations of page/section adding on iBook Author?

    Hi narin1975,
    Welcome to Apple Support Communities.
    It sounds like you want to add a page in your iBooks Author project. Take a look at the iBooks Author Help webpage below, it will walk you through adding or deleting pages, chapters and sections.
    Add, reorder, or delete chapters, sections, and pages
    http://help.apple.com/ibooksauthor/mac/#blsa47d9392
    Add a new page
    In the Book pane (shown above), select the chapter or section you want to add pages to.
    Click Add Pages in the toolbar, and choose Pages > Option.
    Tip:  You can also add a new page by Control-clicking a page in the Book pane and choosing Insert Page from the shortcut menu. The new page uses the default layout for the chapter or section.
    I hope this helps.
    -Jason

  • When links are clicked, they do not fully display the NEW page until the mouse is moved.I know it is a current bug, and appears in no other browsers that I know of.

    It was pointed out that my links do not function correctly on Firefox on a Windows platform. When links are clicked, they do not fully display the NEW page until the mouse is moved! I have now observed it for myself on my fathers PC running Windows XP on Firefox.My PC is on Windows7
    It is the 5 version of Firefox, so I know it is a current bug, and appears in no other browsers that I know of.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
    In Firefox 4+ you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Can't add new page in the middle of document

    I am creating a manual and inserted page breaks at the end of each page as I created the document. Now I am trying to add a new page to the middle by inserting page breaks and even section breaks, but every time I try to add it in, it just goes to the bottom of the document and I am unable to move anything into the original 50 pages. Any tips here?
    When I look at the thumbnail view of the document it has all 50 pages in one yellow box instead of one page individually. A bit odd.

    The thumbnail browser shows one small page thumbnail for each page of your document. Each yellow bounding box indicates a section. So the thumbnail browser indicates your document has a single section with 50 pages in it.
    As you've typed your document it has naturally flowed from one page to the next. If you place a page break at the end of the page you are simply mandating what Pages has already voluntarily done. But if you insert a second page break you should get a new blank page. In other words, if you put your cursor at the bottom of page 6 and insert a page break you will move to the top of page 7 which has text because it is still page 7. Insert another page break and page 7 becomes page 8 and you'll have a blank page 7.
    Note: if you move your cursor into the middle of the document and insert a section break you'll see that the thumbnail browser shows two sections; one ending on the page above your cursor and one starting on the page your cursor is in. This is useful to understand.
    Second Note: if you use the Insert>Sections option it always inserts a new section at the bottom of the section your cursor occupies. Since your document currently has one section, that's why you wind up with the inserted page at the end of your document.

  • Can i Open a new page behind the current one in the browser?

    Using Safari, if I press a link to 'open in new page' is there a way to have the new page open behind the current one? I can choose it on my laptop browser(windows). It's really annoying when I choose 'open in new page' and the current one is whisked away, then I have to minimise it and go back to the original.

    There are other browsers available that have the tabs feature which is so much handier when navigating from page to page like you want to do.
    Look at iCab (my favorite), Mercury and Atomic. All three have many more features than Safari has.

  • Creation of New Page in SAP Script

    Hi Experts,
    Please advice when will a new page trigger in SAP Script :
    As per my requirement I need to create a new page for an existing layout and make changes to the second page alone...
    but this page should be triggered only for a specific condition. Is it possible to trigger second page when it satisfies certain conditon?
    I have searched SDN regarding the same but most of them have recommended to use NEW-PAGE...but as per my understanding NEW-PAGE is used when certain data needs to be printed on the next page ( not on the new page ).
    Thanks
    Karthik.R

    Ok friend,
    Try using the conditions in your driver program using 'CONTROL_FORM' function module. or using some other condition in it.
    You can also give conditions in text editors and you can trigger the pages.
    i think these links will help you in solving your solution just check these Link: [new page based on condition in sap script|new page based on condition in sap script; this is just an hint from this you can develop the idea.
    Link: [Breaks in Smartforms|LAST PAGE FOR SAP SCRIPT;.
    Also there are other few related links in SDN which will help you.
    I think this must solve your issue if you still face any queries please revert back to me i will help you.
    Thanks,
    Sri Hari

  • How to create new page in SAP Script?

    Moved to correct forum by moderator.  Duplicate deleted.  Do NOT post the same question in two forums.
    Hello friends,
    I am modifying one SAP script.
    It is already contains 2 pages. FIRST and NEXT.
    All I have to do is to create one more page which should be display as last page.
    And this last page should display some data.
    I tried and created a new page in SE71 but when i execute the program, it doesn't show newly created (LAST) page.
    Please guide me.
    REgards,
    RH
    Edited by: Matt on Nov 7, 2008 4:26 PM

    Hi
    U need to force the call of this new page.
    I suppose your sapscript is arrange with 2 page: FIRST and NEXT, where FIRST has NEXT as next page.
    So the system automatically print the pages FIRST and NEXT: u need to insert the statament:
    /: NEW-PAGE LAST
    in the MAIN window.
    U can create a text element NEW_PAGE and you'll call it as soon as you've finished to print the main data:
    /E NEW_PAGE
    /: NEW-PAGE LAST
    U can use the fm CONTROL_FORM
    Max

  • Send Welcome Email to New User using the Scripting Agent

    Hi
    I require some assistance please.  I have found a number of scripts online to send a Welcome Email to new users whereby they make use of the ScriptingAgent.xml file.
    I like the way the scripts have been configured and have mashed up one or two scripts together for my desired result however when testing in my lab (Exchange 2013) I have found tow problems.
    The problems are:
    1. When creating a new user and mailbox (New-Mailbox) via the ECP the script throws out an error which I will post later in this post. The mailbox is created fine but it does not send out a welcome email.  When a user is created in ADUC and then a mailbox
    is created (Enable-Mailbox) the welcome email is sent out correctly.
    2. In the script i have a section to check for NewUser00 in the HTML file and replace that with the Users Name and Surname, however this does not work correctly, I just come up blank:
    The Script:
    <?xml version="1.0" encoding="utf-8" ?>
    <Configuration version="1.0">
    <Feature Name="WelcomeEmail" Cmdlets="New-Mailbox,Enable-Mailbox">
    <ApiCall Name="OnComplete">
    if($succeeded) {
    # Waiting for synchronization after mailbox has been created.
    Set-ADServerSettings -ViewEntireForest $true
    Start-Sleep -s 10
    # New-Mailbox triggered. Taking SamAccountName parameter.
    if ($provisioningHandler.UserSpecifiedParameters.Contains("SamAccountName") -eq $true) {
    $UsrSamAccountName = $provisioningHandler.UserSpecifiedParameters["SamAccountName"]
    $USRdfirst = $provisioningHandler.UserSpecifiedParameters["FirstName"]
    $USRdlast = $provisioningHandler.UserSpecifiedParameters["LastName"]
    $UsrAlias = (Get-Mailbox -Filter {SamAccountName -eq $UsrSamAccountName}).Alias.ToString()
    $USRdname = $USRdfirst + " " + $USRdlast
    # Enable-Mailbox triggered. Taking Identity parameter, this is the only one avalaible in this case.
    if ($provisioningHandler.UserSpecifiedParameters.Contains("Identity") -eq $true) {
    $UsrIdentity = $provisioningHandler.UserSpecifiedParameters["Identity"].ToString()
    $USRdfirst=$provisioningHandler.UserSpecifiedParameters["FirstName"]
    $USRdlast=$provisioningHandler.UserSpecifiedParameters["LastName"]
    $UsrAlias = (Get-Mailbox -Identity $UsrIdentity).Alias.ToString()
    $USRdname= $USRdfirst + " " + $USRdlast
    # Defining variables.
    $UsrAddr = (Get-Mailbox -Filter {Alias -eq $UsrAlias}).PrimarySmtpAddress.ToString()
    $UsrOU = (Get-Mailbox -Filter {Alias -eq $UsrAlias}).OrganizationalUnit
    # Sending email notification to the user in specific OU.
    if ($UsrOU -match "Contoso.com") {
    # HR #
    $fromHR="[email protected]"
    $SubjectHR="'Welcome to Contoso'"
    $BodyHR = [string] (get-content ("c:\welcome\WelcomeMSG.htm"))
    $BodyHR = $BodyHR -replace "NewUser00",$USRdname
    $fileHR = "c:\welcome\WelcomeMSG.htm"
    $smtp="192.168.x.x"
    Send-MailMessage -From $fromHR -To $UsrAddr -Subject $SubjectHR -Body $BodyHR -BodyAsHtml -Encoding ([System.Text.Encoding]::UTF8) -SmtpServer $Smtp
    # Clearing variables. Each one in its own line in order to prevent error messages from being shown on EMC.
    if ($UsrAlias) { Remove-Variable UsrAlias }
    if ($UsrAddr) { Remove-Variable UsrAddr }
    if ($UsrOU) { Remove-Variable UsrOU }
    if ($UsrMsg) { Remove-Variable UsrMsg }
    if ($UsrIdentity) { Remove-Variable UsrIdentity }
    if ($UsrSamAccountName) { Remove-Variable UsrSamAccountName }
    </ApiCall>
    </Feature>
    </Configuration>
    The Error for issue 1:
    The cmdlet extension agent with the index 5 has thrown an exception in OnComplete().
    The exception is: Microsoft.Exchange.Provisioning.ProvisioningException: ScriptingAgent:
    Exception thrown while invoking scriptlet for OnComplete API: You cannot call a method on a
    null-valued expression.. ---> System.Management.Automation.RuntimeException:
    You cannot call a method on a null-valued expression. at CallSite.Target(Closure , CallSite , Object ) at
    System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at
    System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame) at
    System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    --- End of inner exception stack trace --- at Microsoft.Exchange.ProvisioningAgent.ScriptingAgentHandler.OnComplete(Boolean succeeded, Exception e)
    at Microsoft.Exchange.Provisioning.ProvisioningLayer.OnCompleteImpl(Task task, Boolean succeeded, Exception exception)
    Any assistance in resolving these two issues will be really appreciated

    Ok I am gonna to answer my own question.
    I have persevered through the day and have resolved my two issues.  I hope this assist others within the community.
    Script:
    <?xml version="1.0" encoding="utf-8" ?>
    <Configuration version="1.0">
    <Feature Name="WelcomeEmail" Cmdlets="New-Mailbox,Enable-Mailbox">
    <ApiCall Name="OnComplete">
    if($succeeded) {
    # Waiting for synchronization after mailbox has been created.
    Start-Sleep -s 30
    Set-ADServerSettings -ViewEntireForest $true
    # New-Mailbox triggered. Taking SamAccountName parameter.
    if ($provisioningHandler.UserSpecifiedParameters.Contains("Name") -eq $true) {
    $UsrSamAccountName = $provisioningHandler.UserSpecifiedParameters["Name"]
    $Usrname = (Get-Mailbox -identity $UsrSamAccountName | Select Name | foreach { $_.Name})
    $UsrString = $Usrname | Out-String
    $UsrAlias = (Get-Mailbox -Filter {Name -eq $UsrSamAccountName}).Alias.ToString()
    # Enable-Mailbox triggered. Taking Identity parameter, this is the only one avalaible in this case.
    if ($provisioningHandler.UserSpecifiedParameters.Contains("Identity") -eq $true) {
    $UsrIdentity = $provisioningHandler.UserSpecifiedParameters["Identity"].ToString()
    $Usrname = (Get-Mailbox -identity $UsrIdentity | Select Name | foreach { $_.Name})
    $UsrString = $Usrname | Out-String
    $UsrAlias = (Get-Mailbox -Identity $UsrIdentity).Alias.ToString()
    # Defining variables.
    $UsrAddr = (Get-Mailbox -Filter {Alias -eq $UsrAlias}).PrimarySmtpAddress.ToString()
    $UsrOU = (Get-Mailbox -Filter {Alias -eq $UsrAlias}).OrganizationalUnit
    # Sending email notification to the user in specific OU.
    if ($UsrOU -match "contoso.com") {
    # HR #
    $fromHR="[email protected]"
    $SubjectHR="'Welcome to CONTOSO'"
    $BodyHR = [string] (get-content ("c:\welcome\WelcomeMSG.htm"))
    $BodyHR = $BodyHR -replace "NewUser00",$UsrString
    $fileHR = "c:\welcome\WelcomeMSG.htm"
    $smtp="x.x.x.x"
    Send-MailMessage -From $fromHR -To $UsrAddr -Subject $SubjectHR -Body $BodyHR -BodyAsHtml -Encoding ([System.Text.Encoding]::UTF8) -SmtpServer $Smtp
    # Clearing variables. Each one in its own line in order to prevent error messages from being shown on EMC.
    if ($UsrAlias) { Remove-Variable UsrAlias }
    if ($UsrAddr) { Remove-Variable UsrAddr }
    if ($UsrOU) { Remove-Variable UsrOU }
    if ($UsrMsg) { Remove-Variable UsrMsg }
    if ($UsrIdentity) { Remove-Variable UsrIdentity }
    if ($UsrSamAccountName) { Remove-Variable UsrSamAccountName }
    </ApiCall>
    </Feature>
    </Configuration>

Maybe you are looking for

  • What is new in RoboHelp 8 for Word ?

    Did Adobe make any fixes or add any new stuff to the RH for Word with the version 8? The only features they describe where RH for Word is mentioned on the Feature page was how to NOT install it by default. Any one using this that used past versions s

  • Setup ACE probe for HTTP host headers for multiple sites on rservers

    We have multiple sites on each server. Is there a way to have the probe only stop traffic to a specific site or header and not take the complete rserver offline? Thanks Greg

  • Nokia 5800 problem(The file simply cannot be remov...

    Some time ago, i tried to download a movie via my torrent client(symtorrent) on my nokia but i have changed my mind and aborted the operation. It said that the movie is 1.4 gb, so i found the folder and delete it. But the memory on my card remained t

  • Pages not always displaying properly

    Hi. For some reason certain websites I use often as well as various others aren't always displayed properly (e.g. they often have the menu at the top/side and no main content). Sometimes refreshing the page a number of times or hitting back helps and

  • Sizing the SGA

    Hi, I would like to know how to size the initial SGA size while creating the database. What are the things that we have to consider for sizing the SGA? If we have to consider if it is OLTP/DSS system, how many concurrent transactions, how many users