Condition text on last page of Main window of a SAPSCRIPT

Hi,
     I want to print some condition text in last page of a Main window of my custom sapscript, we can't use &NEXTPAGE& in Main window. Is there any other method to identify the last page.

Hi Venu gopal,
In the print program use the control break statement.
Refer this code
*AT LAST*
call function 'WRITE_FORM'
       exporting
       element                          = 'GRAND_TOTAL'
*   FUNCTION                            = 'SET'
*   TYPE                                = 'BODY'
         window                         = 'MAIN'
Regards,
Sravanthi

Similar Messages

  • How to Print Sales header text at the end of last page of Main Window

    Dear All,
    I have a requirement to print Sales order header text at the end of Main of last page. I don't have footer window.When i use Bottom-End bottom.Only one line is printing.The header has 5 lines.
    Request you to provide <b>code</b>to handle this situation. Your response is highly appreciated
    Best Regards
    Praveen

    Hi,
    If u r using standard layout set RVORDER01.
    U can print that sales order header text in the following text element.
    /E SUPPLEMENT_TEXT.
    U can include ur text objects here.
    Then it gets printed.
    Regards,
    Veda Kumar

  • Printing text in last page main window of a script

    Hi All,
           I want to print some text at the bottom of last page main window.But how can we find that it is last page.I mean which condition we have to put for that.
    I think the below condition like
    If last-page NE ' 0'.
    write : '----
    '..........   will be used for printing at last page footer window.
    what about main window........how to find that it is the main window of last page............
    Thanks in advance ....
    Regards,
    Rakesh.

    Hi,
    you can use this
    IF NEXT_PAGE EQ ' 0 '.
    write the text here.
    ENDIF.
    in the main window itself. Once all the records got printed, it will check that there is no next page. at that time, that was the end of the internal table in the mainwindow and the text will be printed.
    If you want a seperate window, then also the same logic will work.
    If you want a seperate window, then the output look and feel will not be so good.
    I mean where ever the last record got completed, it will print the text if you put it in Main window. other wise statically it will print at a particular position where your window was placed.
    Regards,
    Venkatesh

  • Frame line not display in next page of main window

    hi Xpert,
    I am creating layout in SAP SCRIpt,it working fine only the main window of next page  frame line is not display.
    i m define next page as a FIRST page and writing main window of first page following coding
    /:           POSITION XORIGIN '0.50' CM YORIGIN '7.75' CM
    /:           SIZE HEIGHT '17' CM WIDTH '19.25' CM
    /:           BOX  FRAME 10 TW
    when i run the program first page are coming properly and only when i go in second page of output then main window lines not displaying.
    please guide me how to solve this problem.
    Regards,
    pravin

    Hi Praveen,
    In that case why you have to make the main window in the first page and secondry window.
    You can use it as manin window itself. Print the total amount in the main window itself in the first page. and copy that main window to the second page.
    In the first page under the main window create a text. and there u print the total value and text.
    Now copy the main window to the second page..only COPY DONT CREATE NEW.
    In the second page now under the main window create the table to print the line items. What every u add in the second page main window it will come in the first age also in the smartforms. But it will nto get printed in the first page.After the text to print the totals call the COMMAND option and call next page in that.
    Hope you got me..
    Regards
    Ansari

  • Main window overflowing in SAPScript

    I have a Main window in SAPScript and i have displayed a box around it using the foll. command
    POSITION XORIGIN '-1' MM YORIGIN '+0' MM
    BOX FRAME 10 TW INTENSITY 1
    I also have horizontal and vertical lines for the rows & columns (like a table)
    When the data is more than 1 page it flows to the next page. But on the next page all the horizontal and vertical lines move to the top of the page whereas my data is displayed below. Also the box around my main window no longer appears.
    I think it is mainly becoz i have 2 other windows- Payee and Vendor address before the main window on the 1st page whereas they are not reqd. on the 2nd page. How do i solve the problem so tht the lines and box fit properly on the main window on every page?

    Hi
    You can define different condition for printing the box for Main window.
    And also you can define different Window sizes like Top margin, Window height etc for different pages differntly
    in the main window text elements say
    /: BOX FRAME 10 TW INTENSITY
    So that depending on the size of the MAIN window the Box is drawn.
    Regards
    Anji

  • Print a text on last page of smartform rpt

    Hi All
    I want to print a text on first and last page of report created in smartforms
    plz suggest..........

    Hi,
    In a Smart Form, you can use a similar MAIN window approach. For a secondary window, you might wish to use a conditional event such as <b>'Only After End of Main Window'</b>.
    Map page FIRST to NEXT and page NEXT to NEXT as you have done; page LAST does not need to be mapped to any other page. Make sure the MAIN window is contained on both page FIRST and page NEXT. Then add a command node within your MAIN window at the very end of this window (outside of any tables or loops). In its general attributes click on the 'Go to new page' and select the LAST page here.
    During form output, regardless of whether the MAIN window is completed within page FIRST or NEXT, page LAST will be triggered as your final page.
    Note: Any secondary windows on pages FIRST or NEXT with the condition 'only after end of MAIN window' may no longer print, as form output now will advance to the LAST page before this condition is satisfied.
    Regards
    Sudheer

  • Sapscript  total pages in main window

    Hi,
    in <u>main window</u> of my sapscript i need to know total number of pages,
    i'm using &sapscript-formpages& but it doesn't work;
    also tried with &sapscript-jobpages& but with no result.
    In debug it give me "0".
    What's the way to know number of pages in MAIN?
    Thanks.
    Message was edited by:
            Tony De Vivo

    Hi Vallamuthu,
    Thanks for the reply... I am currently modifying the sapscript F110_PRENUM_CHCK. Here we need only the page "NEXT" for our purpose. For this purpose we deleted pages "FIRST"  & "LAST" from my custom sapscript. Now i have only "NEXT" page in my sapscript. I put the code you mentioned even then i don't see overflow happening here. In debug, i saw page as "2".
    regards
    Ajay

  • Printing text on last page of adobe form

    Hi abapers,
    My requirment is that i have to print a particular text in the footer.
    But this has to be printed only on the last page.
    how do i go about doing this.
    thanks in advance.

    Hi Aditya,
    Give the condition as.
    If &SFSY-NEXT-PAGE & = 0.
    print what text u wanna to print.
    endif.
    Best Regards,
    Flavya

  • How to add totals for each page in main window

    hi
      i have problem in scripts
      how to add total in first page ending and carry it to second page , at the end of second page again adding total and so on until last page.
    very urgent
    regards
    ratna

    Hi,
    Check these
    http://help.sap.com/saphelp_40b/helpdata/en/d1/8035c3454211d189710000e8322d00/content.htm
    http://membres.lycos.fr/jolyeric/SAP/Note_de_Cours_Ben/Sapscript/SAPscript_Control_Commands.doc
    try to use the command 'summing' along with one text symbol .Keep the if condtion when page changes at that time u dispay the total as ur keeping the total in text symbol it can be dispayed in the next page
    or this is round about way
    loop at <table>.
    call write_form.
    endloop.
    here u declare a variable 'c' and increment it by 1 in each loop. Then u chgeck if the program has started printing second page then u can print the number of records before printing the next page.
    eg :
    data : c type c value '0'.
    loop at <table>.
    c = c + 1.
    call write_form.
    endloop.
    in form:
    check when the next page is being printed, then u can print the number
    of lines 'c'.
    Feel free to revert back.
    --Ragu

  • Jumped to next page eventhough first page's main window not full

    Dear All expert,
    I meet a problem that my script form sheet jumped into next page even though the first page is not full.
    I checked in script there is not any new-page command.
    Do you have any suggestion?
    appriciate your help.

    Hi,
    There could be many reason for this.
    Please check the followings.
    1. Page protection command is not used.
    2. size of main window
    try to debug the script and find the exact reason.
    Hope this will help you.
    Regards,
    Raj Gupta

  • Smart Forms: No next page when MAIN-Window is full

    Hi you SmartForms-Experts,
    i've got a SmartForm for Purchase Order. This SmartForm breaks with a error message when the MAIN-window on page "FIRST" is filled up and some more positions should appear in the MAIN-window on page "NEXT".
    The following page for page "FIRST" is "NEXT" and the following page for page "NEXT" is "NEXT".
    The printing program is a customer-copy of SAPFM06P, entry is "ENTRY_NEU".
    There is another window that is to be processed at the end of MAIN-window. I first thaught, that this is the problem, but it doesn't matter if it is deleted oder processed "before end" of the MAIN-window oder "after end".
    I debugged my smartform several times, but only saw the errors occur and did not recognize why.
    MAIN-window has got the same width on page "FIRST" and on page "NEXT".

    Hi Aidan,
    thank you for your answer. I solved the problem yesterday in the late evenening. It was similiar to your answer.
    There are some other windows in my smartform besides of "MAIN" that are copied from page "FIRST" to "NEXT".  One of them was smaller (width) than the original on first page. And therefore it could not be processed.
    I learned: Never change another programmers Smartform, even he left the company three years ago. Try to make your own Form.
    Thanks
    Franz

  • Printing last page (Purchase order Terms) in SMARTFORMS

    Dear SAP Gurus,
    Our Purchasing unit would like to print purchase order terms and conditions after the end of Purchase order. Initially I had two pages (First and Next). The following are the steps I followed to print last page with Purcahsing terms.
    1. Create Command line at end of Main window in First and Next page and in command line output options select Go to page as Last page.
    2. Under last page, I have a secondary window which prints a text. (this is a long text and cant be printed using secondary window. I need Main window to print the text as it would be continous)
    The following are the problems I am facing.
    1. By placing command line at end of Main window, data in secondary window after the Main window are not printing.
    2. Purchase terms Text placed in the last page under Main window is not printing. Text placed in last page under secondary window is printing but instead of 8 pages of terms text only one page is printing.
    How can I handle this.
    Thanks in advance.
    Thanks
    Shanthi

    Hi Shanti,
      From what I've understood from you post, you may try putting the command in the secondary window (which comes after the MAIN Window) of the first page. In the command give Goto Page ->NEXT.
    Hope this helps.
    Thanks,
      Ranjith

  • The main window of third page will not display the text element

    Hey, smartform guru,
    I am working on the smartform to print PO data.
    The smartform has first page and next page as usual.
    I created a third page P_TERMS to print the terms and conditions for PO printout.
    I used commend node to assign the page P_TERMS as the "Go to new page" and it did go to the P_TERMS page but the text element will not print in the main window in P_TERMS page.
    The text element will print in the secondary window.Since the terams and conditions are 4 pages long, I expected it to print in the main window, so I do not have to define several extra pages to print them.
    Any idea?
    Thanks in advance!
    Fisher Li

    Hi Fisher,
    Unfortunately, In a smartform, only single main window is continued to all pages even though you can declare windows under each page as main window, but it actually acts as the same window for all pages. It just means that if text from 1st page is overflowed, it will continue to the next page with main window.
    Command line to go to next page will create an extra page but since text is not flowed in main window, it won't print the text element you have included in main window on third page.
    The solution to your problem as I see is that either you include your terms and conditions in the main window of your first page and just before your text element for T&Cs, use Command to go to third page.
    Hope it helps.
    Ravi

  • Terms and Conditions to display in the last page of Script

    Hi Experts,
    My requirement is to print the Terms and Conditions in the Last Page of a PO. so for that, I have created one LAST page. Previously i have FIRST Page and Next Page in the Script. In the LAST Page it has to windows. One is for Logo and another one is for Terms and Conditions. I am trying to print to Terms and Conditions through a Standard Text ( Created in SO10) in the Terms and Conditions window.
    The page flow are like FIRST-->NEXT, NEXT>LAST, LAST---->LAST
    Please guide me how shall i proceed to get the output. It would be better if we get the output with out doing any change to the driver program.
    Thanks,
    Priyabrata

    Dear Priyabrata
    The page flow should  like FIRST-->NEXT, NEXT>NEXT, LAST---->
    And call your page in main window at last element.
    This will surely solve your problem.
    Regards,
    Vijay

  • Long Text in Main Window

    Hi,
    I am trying to print 'Item Text' from invoice just below each item description(same cell of 'item descripotion' is used to print 'Item Text' in MAIN WINDOW )  in smartform. I had used an include text.
    For Ex: long text maintained is
    TEXT1 TEXT1TEXT1
    TEXT1TEXT1TEXT2
    TEXT1TEXT1TEXT3
    TEXT1TEXT1TEXT4
    TEXT1TEXT1TEXT5
    If suppose maximum size of cell can occupy only 3 lines of above long text , then it should only print remaining last two lines on the next page .
    Main Window
    Page 1
    Item Desciption
    TEXT1 TEXT1TEXT1
    TEXT1TEXT1TEXT2
    TEXT1TEXT1TEXT3
    Page 2
    TEXT1 TEXT1TEXT4
    TEXT1TEXT1TEXT5
    Also in the layout design height of main window on NEXT PAGE  is slightly greater than size on FIRST PAGE.
    But , in my case it is generating three pages.  Page 2 and 3 are printed as shown below.
    Page 2
    Item Desciption
    TEXT1 TEXT1TEXT1
    TEXT1TEXT1TEXT2
    TEXT1TEXT1TEXT3
    TEXT1 TEXT1TEXT4
    Page 3
    Item Desciption
    TEXT1 TEXT1TEXT1
    TEXT1TEXT1TEXT2
    TEXT1TEXT1TEXT3
    TEXT1 TEXT1TEXT5
    Please let me know , how to correct this.
    Note:- Form is Migrated from SAP Script to Smartform.

    Hi Mayank,
    Use Page protection For that TEXT Element (Include) in output options.
    Regards,
    Soorya

Maybe you are looking for

  • Upgrade to 9.2.0.8 from 9.2.0.6

    Hi, Is p4547809_92080_WINNT.zip the correct patch set to upgrade to 9.2.0.8 from 9.2.0.6 ? We are on Win 2003 server. DB is 9.2.0.6. Many thanks.

  • Trying to Salvage Crashed HD Files...am I on the right track?

    Alright. To make a long story short, my hard disk went kerput (not the physical structure, but the file structure or whatever corrupted). I haven't had to do anything like this since I was using OS9 so my OSX skills are crappy. Anyways. Here is what

  • Find Total Number of Rows in Database

    I am trying to find total number of rows in Database? Thanks in advance

  • Parameter Form in OAS and Web, Paper Report Output

    Hello, In the Reports Builder 10g I have this Parameter Form. It starts before a paperreport is generated (with props, LOV and etc.) If I put my rdf in the OracleAS i can call the report trough the browser, but there Is no parameter window. How can I

  • System Pref toggle immediately turns off

    I have a laptop here in the office that won't connect to Time Machine anymore. I deleted his sparseimage on the remote disk and tried to set it up from scratch but the On/Off toggle immediately goes back to Off. Choosing the disk doesn't do anything.