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

Similar Messages

  • 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

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

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

  • 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

  • Last page doesn't print correctly on 2 page 2 copy Windows 8.1 Wireless printing to HP4630

    On Windows 8.1, when printing 2 copies of a 2 page document (any application) the last page of the last copy fails to print completely (sometimes half a page) or fails to print at all.  It doesn't matter whether I am printing one sided ot two sided.
    A blue alert box is displayed on the desktop with the message "Error printing on HP Officejet 4630 series... The printer couldn't print <file name>"
    When I monitor the printing ("See what's printing"), the job disappears in the monitor just before the error message shows up. There is no indication in the monitor of any printing problem.
    I've looked everywhere and can find no event logs that show this error. 
    Windows is totally up to date.  The latest HP drivers are installed. 
    All attempts to use the various troubleshooting buttons in windows and the driver discover no problems.
    When I print the same exact report in the same way from Windows 7 it doesn't fail.
    I've tried it on 2 different 4630s on the same Windows 8.1computer with the same results. 
    Even though this appears to be a unique problem when printing from Windows 8.1, I need to get help finding out the exact nature of the problem and the error message.

    Hi there @FrankCF , and welcome to the HP Forums!
    I see you're running into print issues.  I would like to help.
    Does this issue occur when making a copy from the machine?
    I would suggest performing a power reset.  Disconnect the power cord from the printer and the power outlet, then wait 60 seconds. After 60 seconds, plug the printer back in. Ensure you plug the printer directly to a wall outlet. Make sure to bypass any sort of surge protector or power bar.
    I would then recommend downloading and running the HP Print and Scan Doctor.
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Print Footer Window of PO Form at end of Last Page of PDF Forms(Adobe)

    Hi,
    I am trying to print PO form using PDF form which includes multiple line items. At the end of last page I am trying to print the footer window that contains Comments and Signature.
    Right now my Footer Window is being printed immediately after the end of line items.
    I have included the Comments text box and image inside a Sub Form.
    Please let me know how to print the Footer window at the end of the page instead of printing immediately after the line items.
    Thanks,
    Rekha

    Hi,
    Please take the footer subform from the tables section and position it on the page where u want to print and write the script so that it will print only on last page.
    Regards,
    sasi

  • Footer window should be in Last Page

    Hi to all..
        I have a issue in printing a form..
       I have to print the footer window only to the last page.
      i have tried all the possiblities like enabled the option 'Only after end of the main window' in the alternative of the footer and  added 'At end of the table' in the table footer of the main window.
    But still facing the problem of overlapping the main window to the final footer.
    i hope you guys can understand what i mean to say..
    Thanks in anticipation....
    regards,
    sathik

    Hi,
    If your footer text should be printed in the last page
    then the above statement write in the footer window editor.
    If it is not you are looking for, can you please little elaborate your requirement.
    Regards and Best wishes.

  • Need to place the window only in last page in script

    Hi,
      I want to place the footer window only in the last page.If it has 2 pages the footer window shhould come in second page only if there is only 1 page then it should come in the first page.
    can anyone tell me how to do this in Script.

    HI Camila,
    In such a case, donot use the footer of the Table , but create another window-FOOTER which is positioned after your table, with such a design, your footer would alwyas come only at the end of the Table.
    This is a simpler approach.
    The other approach could be to set Conditions in the condition tab of the footer , such as it comes only on the last page.
    If you take my suggestion, i would say use the 1st option i have explained.
    This will help you.

  • 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

  • Need to increase main window size except last page in smartforms

    I have only one main window in a smartform to print a invoice. Currently the mainwindow size is small because i added some additional info to print at the end of the main window.{i.e with some tax details}. All the pages execpt the last page has free spaces. Now the requirement is to increase the size of the main window to avoid the blank spaces except the last page.
      I have used the SFSY-FORMPAGES. THIS is not working to identify the total no of pages of the form. i have condenced it also.
    Can anyone give some details to solve this.
    Thanks in advance.

    Hi,
    I don't understand ... the size of the main window is not link between the different page ... so there is no problem.
    My main window in all the form are never the same size between first page and next page.
    Rgd
    Frédéric

  • Rounded/curved edge/corner in page window frame/box of SAPscript

    Hello,
    Can anyone tell me whether SAP ECC6.0 has any functionality which allows a page window frame/box within a SAPscript form to have rounded/curved corners for the rectangular shape?.
    I have reviewed various documentation and forum posts, sap notes etc. but none of them even bothered to mention or explain this. Other forum posts I have seen re this topic simply said it was not possible but I hope for a more explanatory answer than that.
    It wouldn't appear to be a big ask for a form to have boxes of different shapes rather than just hard straight lines and edges but perhaps SAP have some reasoning for it which I've not seen.
    Appreciate if someone out there can elaborate about this and what alternatives there would be, for example could we upload a graphic of a rounded edge box and then place text over that?.
    Thanks in advance,
    Michael

    Thanks but my question is applicable for Smartforms too. I know SAPscript is OLD and new forms should be developed with Smartforms but at the moment we are tweaking some exisitng SAPscripts and when time permits at a future point we will move to Smartforms.
    To other people out there, do you know if there is functionality in either SAPscript or Smartforms to apply Rounded/curved edges/corners in page window frames/boxes?.
    Thanks.

Maybe you are looking for

  • After reinstalling mountain lion i got the question mark on the screen

    hi everyone, after reinstalling mac os x 10.8 from internet recovery, mac restarts itself which is normal. but when it starts there is a question mark on a folder symbol on the gray screen. what should i do?

  • Help with building a select box from a query?

    New thread from a topic I started yesterday. From the responses, and a search of other threads, I realized that I was way off base:-) So, I went back and verified that my TomCat setup was alright. After a few tweeks I verified that I could display th

  • Changing the 1-2 stereo outputs to mono in logic

    I want to assingn the outputs of each track in Logic individually so that it matches each channel of my recently purchased M-Audio Nrv 10 mixer (which also serves as my soundcard). Can't seem to figure out how to change the outputs (right below 'impu

  • Utility / FiOS lines too close to house

    Our neighborhood utilities are run on poles and unfortunately these lines run right along the side of my house. When I say right along side I mean the lines are maybe 5 feet from the side of my house and maybe 10 feet off of the ground. I believe the

  • |Running processflows without using Workflow??

    Hello, Is it possible to run prcoessflows without using workflow, i don't want to depend on workflow to run it on schedules, we will use another schedular technology to run processflows. But, is this possible and is there any package created in OWF_M