SAPSCRIPT - adding LAST PAGE

Hello experts,
I am facing a problem on an existent sapscritp.
The existent form contains the FIRST and NEXT page, the flow is: FIRST -> NEXT -> NEXT.
It was asked me to add one LAST page with terms and conditions (etc)...
I created the LAST page in the form.
At the program level, right before the "close_form", I added the command "control_form" > "new-page LAST".
The LAST page was printed (ok), however, the content of "sapscript-formpages" seemed to get lost (=0).
In consequence, all the existent conditions: "IF &PAGE(C)& EQ &SAPSCRIPT-FORMPAGES(C)&" (if current page = "last page") didn´t work anymore. The data/windows to be printed on the last of the FIRST/NEXT pages didn´t appear anymore.
Also, the "page" information get lost "Page 1/0".
Before my LAST page, the content of "sapscript-formpages" = 1 (currently only one page is displayed) and "Page 1/1" was fine.
After I added the command "control_form" > "new-page LAST", the "sapscript-formpages" = 0 and "Page 1/0" (?).
Does anybody knows why???
I tried other ways to print the LAST page such as:
1) Added an element /E called "lastpage" on MAIN window (also tried other windows that comes after the MAIN).
This element contained the command "new-page LAST".
I called this element on the program (after the last element printed).
Result: New-page LAST was "ignored". It passed by this on debug mode but nothing happened (the first page was totally ok but LAST page didn´t appear).
2) Added "start_form" > startpage = "last" and "end_form" (before "close_form").
Result: Error message when running the sapscript ("start_form is invalid, end_form is missing").
Obs: there was not "start_form" and "end_form" on the current program code.
Please, does anybody has an suggestion to help me solving this problem?
Thank you!
Tatiana

Hi Tatiana,
In Main window,
Delcare:
/E PAGE.
/: NEW-PAGE
In Editor.
CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        ELEMENT                        = 'PAGE'
*       FUNCTION                      = 'SET'
*       TYPE                          = 'BODY'
*       WINDOW                        = 'MAIN'
*     IMPORTING
*       PENDING_LINES                 =
      EXCEPTIONS
        ELEMENT                        = 1
        FUNCTION                       = 2
        TYPE                           = 3
        UNOPENED                       = 4
        UNSTARTED                      = 5
        WINDOW                         = 6
        BAD_PAGEFORMAT_FOR_PRINT       = 7
        SPOOL_ERROR                    = 8
        CODEPAGE                       = 9
        OTHERS                         = 10.
Regards,
Venkat.

Similar Messages

  • Adding Text to the last page in SAP Script RVORDER01

    Hi Experts,
                     I have copied RVORDER01 and changed the log for it and added my ZRVORDER01 in NACE.
    Now they want Some text to be added to the last page of the script how to do this without changing Standard Print Program ? Please guide me.
    Regards,
    Dheepak

    Hi,
    If you copied the the Standard Script to a ZScript then why is the problem adding a Text to the Last page......You should be able to do this easily .....i believe...Sorry if i misunderstood......

  • How to print header in first and last  page only in SAPSCRIPT

    Hi!
    How to print header in first and last  page only in SAPSCRIPT,
    in between pages,  I need to print all line items in MAIN window only .
    Thanks in anticipation!
    Aki.

    Hi All,
    Thanks for your early update...but my requirement here is
    I have two pages (FIRST , NEXT ) First is having Header, Main and Footer
    NEXT is having Main and Footer ..I am printing PO here..let us think that my PO is having 20lines items , let us assume that it takes five pages...
    Now how application is printing is ..first set of data is printing in FIRST page and remainiang data distributed to 4 pages printing in NEXT page ..but what my requirement is , I need fifth page print on FIRST page, instead of NEXT page... Ultimately I need last set of data always print in FIRST ie out of 5 pages 1st print on FIRST 2nd 3rd 4th print on NEXT and 5th print again on FIRST .
    hope you this will clear you.
    Thanks!

  • Sapscript bottom text in Main, just for the last page, but printing only in the last page

    I need to print a text but only for the last page in the main window.
    I have tried with IF.
    IF &PAGE& = &SAPSCRIPT-FORMPAGES&
    BOTTOM
    ....TEXT
    ENDBOTTOM
    ENDIF
    But it prints in all pages in every main window.
    Can someone point me what I am doing wrong or how can I do this?
    Regards,
    Carlos

    Hello Carlos,
    the problem with this condition is the following.
    The Sapscript composer cannot know during the processing of e.g. the first page,
    how many pages will follow. So &SAPSCRIPT-FORMPAGES& still contains the same
    value like& PAGE& and is filled with the correct values only at the very end of the processing.
    (when the total number of pages is known).
    So I suggest you to use the BOTTOM command in the print program,
    when the processing of all item of the MAIN window is ended.
    There is an other variable &NEXTPAGE&.  &NEXTPAGE& will always be 0
    when it reaches to last page to print. The problem with this variable that
    it can not be used in a condition in MAIN window too, only in a separate page window.
    Regards,
    Hedvig

  • Print on the last page of a Sapscript form

    Hi,
    Is it possible (and how) to print something (a filed of an internal table) only to the last page of a sapscript form?
    Thanks

    Hi
    if you want to print something at the end of a page....
    You can write it as this...
    in the main window...
    in the data element write it...
    /E END_DATA
    /: IF &PAGE&  EQ  &SAPSCRIPT-FORMPAGES&.
    &W_VALUE&.
    /: ENDIF.
    SAPSCRIPT-FORMPAGES variable is a system variable which stores the total pages.
    PAGE variable stores the current variable accordingly it will check for last page and print it.
    Now call it in the driver program .
    Regards.

  • Double side printing from SAPScript, last page missing

    Hello all,
    I try to setup double side printing from SAPScript, but have a problem and hope that somebody might help me.
    In my form I have two pages with main window (FIRST and NEXT) which have print mode set to 'D' and next page set to 'TANDC'. Page 'TANDC' has only one VAR window which contains terms and conditions text.
    Now, everything works fine except that T&C text isn't printed after last page (ie. after last 'NEXT' page). Is there a way to force printing of last (back side) page?
    PS: Calling 'WRITE_FORM' from the print program at the end didn't help either.
    Thanks in advance.
    Grigor

    Hi Vinod,
    this has a same effect as calling NEW-PAGE from form.
    Again, window 'FOOTER' is printed on a new page instead bellow 'MAIN' window and there are no T&C on the last sheet. I also tried to explicitly call text element in window 'FOOTER' before calling 'CONTROL_FORM', like this:
    CALL FUNCTION 'WRITE_FORM' "last element in 'MAIN' window
           EXPORTING
                element = 'LAST'
           EXCEPTIONS
                OTHERS  = 01.
      CLEAR sy-subrc.
    CALL FUNCTION 'WRITE_FORM'
           EXPORTING
                element = 'FOOTER'
                window = 'FOOTER'
           EXCEPTIONS
                OTHERS  = 01.
      CLEAR sy-subrc.
    CALL FUNCTION 'CONTROL_FORM'
           EXPORTING
                 COMMAND = 'NEW-PAGE'
           EXCEPTIONS
                 UNOPENED = 01
                 UNSTARTED = 02.
    It looks like the 'FOOTER' window is under control of SAPScript, not of print program.
    Note: 'CONTROL_FORM' call is placed immediatelly before 'CLOSE_FORM', so at the last possible place.
    Kind regards,
    Grigor

  • SAPscript last page windows.

    Dear all,
    I would like to shows windows a,b,c on the first page only if the first page is the last one. Otherwise I would like the windows a,b,c are displayed on the last page only. How to proceed?
    Regards.
    Nozome.

    Hi
    I'm not sure the system symbol SAPSCRIPT-FORMPAGES has a value while the sapscript is run, but perhaps only at the end it'll have a value, so your control &PAGE& = &SAPSCRIPT-FORMPAGES& could fail.
    You can try to use the system symbol NEXTPAGE instead of SAPSCRIPT-FORMPAGES, your control'll be:
    IF &NEXTPAGE& = 0
    ENDIF
    You can see the values (at runtime) of system symbols NEXTPAGE and SAPSCRIPT-FORMPAGES by running the sapscript in debug.
    If you can't do any controls you should insert your window in main window.
    max
    Message was edited by: max bianchi

  • Going to the last page of a table when adding a new object

    I added a Table(com.sun.rave.web.ui.component.Table) on my page and a button outside of that table to add new object rows. My problem is that I want the table to move to the last page when I add a new object. Instead the default bahaviour is showing the first page. Even if the newly added row is on a page > page 1.
    e.g If I have a table with 5 pages and I am on page 1 and I add an object I want to see the last page of the table where I added the new object. In other words I want it to go to page 5 or page 6 in case the number of the new object is > the number of displayable rows of a page.
    I did it with Javascript but I just dont like it. I wanna do it programmatically.
    Any help?
    Thanks in advance guys!!!

    Hi!
    Try to look here:
    http://forum.java.sun.com/thread.jspa?threadID=5142038&tstart=45
    Thanks,
    Roman.

  • 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

  • How to print last page in sap script in ladscape format?

    Hi all,
    can any 1 tell me How to print last page in sap script in ladscape format?
    Thanks In advance.
    Pravin

    Hi Pravin Sherkar,
    we can do this in SAP Scripts.
    we need to create two pages, one of landscape and another of potrait.
    now after filling the data at last we need to call the page which is of format landscape using START_FORM  function module.
    You can use condition &PAGE& = &FORMPAGES&.
    Please check this link
    Printing Portrait/Landscape in sapscript
    Re: Landscape and potrait in same layout?
    http://www.sap-img.com/ts013.htm
    Best regards,
    raam

  • On the browser's last page of website, cannot engage the index ...

    I have 3 other websites using the same format of the INDEX displayed on top of each webpage. The current one I have constructed was all right until I added 2 more pages [total of 27 pages; another site has 38 pages with no problems engaging the Index when on the last page].
    Upon checking the 'publish site' on the server [Safari] before uploading, when I was on the last page, I could not engage other pages on the Index. I noted this occurring on a friend's computer [MacBook using Safari] — after the website had been uploaded — thinking it their problem. However, when the same inaccessiblity to engage the Index occurred on my browser, I am concerned. It means I have to use the 'Back' command to re-engage the Index.
    Is this specific to this new published website as 'server' related, or is it an iWeb glitch?
    Rather strange when I have not encountered the problem on my other published websites until I was at my friend's computer's Safari browser [Snow Leopard] and today on my own Safari browser [Lion] for this new website.
    HELP!    

    there are a couple of items overlapping the navigation and, I am not sure what they are. But, all the links are there:
    WELCOME! MINISTERIAL CALL LOCATION-MAPS-PASTORAL CHARGE MINISTER'S PAGE CELEBRATING OUR CHRISTIAN HERITAGE OUR SACRAMENTS BALDERSON'S MAIN PAGE GROUPS AT BALDERSON FRIENDSHIP CLUB-BALDERSON FUND-RAISING EVENTS-BALDERSON SUNDAY SCHOOL-BALDERSON ST. ANDREW'S MAIN PAGE GROUPS AT ST. ANDREW'S CARES GROUP-ST. ANDREW'S SUNDAY SCHOOL-ST.ANDREW'S PASTORAL CHARGE YOUTH GROUP UPCOMING PASTORAL/COMMUNITY EVENTS COMMUNITY OUTREACH-PASTORAL CHARGE FOOD PANTRY & THRIFT SHOP MEN OF THE CLYDE GOOD SAMARITAN FOODGRAINS PROJECT INSPIRATIONAL THOUGHTS SCRIPTURES-HYMNS OF PRAISE DALAI LAMA INSPIRATIONAL THOUGHTS PRAYERFUL CONSIDERATIONS ACKNOWLEDGEMENTS
    If you cannot find what is over lapping your navigation you may want to duplicate one of your other pages & add the information for your "Acknowledgements" Page

  • Invoices suumary = last page does not work

    All,
    I am creating the invoice new invoices report in rtf.
    I need to add the invoices summary sheet at the end(as a last page) of all the invoices.
    This is what I have done to achieve that:
    insert a page break for new page.
    on that page I added the TAGS <?start@last-page:body?><?end body?> For testing purpose I just a line which says "I am a last Page".
    When in preview this in pdf I get an error:
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    Please advice if anyone has done this. I can send the rtf and dat asample, if any one cal please look at it.
    Thanks in advance,
    Padma.

    Tim,
    I am using 5.6.2.
    Please advice as to why it does not like the last-page syntax.
    Padma.

  • Image not printed in SapScript, only after page break

    Hi,
    I have a problem in printing an image (stored as text) in a sapscript. The image was uploaded correctly from a TIF file in tcode SE78. The image contains a signature and I need to print it at variable positions within the form. That is I need to print it in the MAIN window. The image does not get printed when a page break occurs when outputing the text element containing the picture. If the page break occurs when outputing any (other) text, the image is printed correctly (after that text).
    Has anybody else encountered this problem? Could it be a sapscript bug?
    Thx in advance.
    Claudiu

    >
    > Looks like the last page is not called !!! I can see data only on one page and it shows page 1 of 1.
    >
    > "make sure ST_TEMP is filled with data" how do I do this ?? My program line node has the data filled in the internal table it_temp and the loop node has the data transferred to st_temp for every row. How can I debug the program lines code ??
    > > Have a break <username> in the program lines. and check it_temp has data in it.
    > "use a command and call the last page at end of the loop on internal table"...how to do this ?
    > > like program lines there is a "command line" do a little search on SDN for more info on how to use command lines for next page.
    >

  • How do I determine whether the current page in Forms is the last page.

    I have a requirement of printing amount in words using SPELL_AMOUNT Funtion Module, in SAP Scripts.
    When I have only one Item Line, I am able to successfully, print the amount.
    The moment i have line items pouring to the next page, I see that the I am unable to retrieve the spelled amount from the Function Module.
    I think may be i need to find out if the current page is the last page, and if it is so, print the amount on the last page, .i.e., the page where the item lines have overflowed to. How do i find this out.
    Can anybody, suggest something.
    Regards,
    Owais...

    I wonder if you could do something like this.  Wrap your logic with this IF statement.
    /: IF &PAGE& = &SAPSCRIPT-FORMPAGES&
    /: ENDIF
    Regards,
    Rich Heilman

  • How To trigger last page in sap script of customer account statement

    Hello all,
    I am working on customer account statement.
    It has it's own standard script(F140_CUS_STAT_02). But my client's requirement was completly diffrent,so i copied that to z script and made some changes like delete some window and some another window.
    Now on first page , i have following windows,
    1) Header
    2) address
    3) main
    4) Account
    5) Footer.
    Next Page having following windows,
    1) Header
    2) Main
    3) account
    4) footer
    Now i want to print account window on lsat page, so i put the condition nextpage = 0.
    and it is working fine , but as account window is physically present after Main window , so that much blak sapge is getting creted after main window on every page.
    To remove that blank space i am thinking of creting one more page and everytime i want display account window on that page.
    I have creted the last page also. but in my output it not detecting that last page.
    For First page - next page is next.
    For Next page - next page is next.
    for Last page- next page is last.
    Also i have added following code at last in  main window.
    /: NEXT-PAGE LAST.
    But i think i am placing this code at incorrect position in main window.
    I am not able to find out the correct podition to put the above code,but main window of that script conataing so namy text element, and that text element are getting handled from driver program based on some conditions.
    I have added my code in main window but not changed the original code.
    Plz let me know where to write /: NEXT-PAGE LAST. in main window.
    Or provide me some another solution to trigger thet last page in sap script.
    Regards,
    Anuja Dhondge

    Hi ,
    actually in account window i have used tha box command to print account statement.
    Previously i was printing this account statement in main window itself but without using bottom and end bottom command.
    So , as i made some changes or add some code in main window then lines of this account statement  were getting dismental.
    So my question is using bottom and end-bottom command this will happen or not????

Maybe you are looking for

  • Why does left side text in my fillable PDF disappear when I export from ID6?

    Hi there! Looking for urgent feedback on fillable forms. I created a form using InDesign 6 - mainly text fields using the interactive: convert to text field function. I used these settings: Event: Release on Tap; Printable, Required, Scrollable; Font

  • Switchover to 1 of 3 Physical Standby (oracle 10g R2)

    Hi all, Previously I already had done switchover primary to standby (only 1 Physical standby was in the configuration) now i have some additional physical standbys (3 Physical standbys) stby1 stby2 stby3 i want to switch to stby1 ,what needs to be do

  • Filter Predicate information

    Hi, Below is the execution plan for one long running query. I would like to get one information clear from any of you. ID 7 returns 1145 rows as per plan. I ran the 7th operation manually ( 7 - access("FCT"."CND_KEY"=1 AND "FCT"."MRKT_KEY"="MKT"."MRK

  • Creating Local Product in SRM System.

    Hi All, I want to create Local Material in SRM system. while creating i am getting error. 1) Set type 380BDF7B502D63F7E10000009B38FA0B does not exist. in table TADIR there is no set type : COMM_PR_SHTEXT. while mantaing this it is asking for Package.

  • Upload documents from ESS Web Dynpro through Archivelink

    Hi Guys I am aware that ESS Whos Who has a functionality where the user can upload his own Photo and this makes use of the SAP Archivelink Architecture. We wish to make an iView that enables users to upload documents (other than photos) using Archive