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

Similar Messages

  • Dispalying total below the main window.

    Dear All,
    I have one main window in script and there I am disploaying few line items.
    Just below the main window I have created another window for displaying total of the line item.
    How I will adjust the window that TOTAL should comes exactly below the line items.
    Please guide.
    Thanks & Regards,
    Abhay.

    Hi ,
    If it is a Script ,
    Please dont create another window:
    keep the totals in the main window only
    this gets displayed after the total
    Reward if Use full
    Karthick

  • 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

  • Sapscript- data overflow in main window

    Hi All,
    I have a requirement in SAPSCRIPT in which if the data in main window gets overflow then it will not print any values in main window. Only a text "Print separately" will get printed at bottom in main window.
    e.g. if my total records that i am printed in main window, prints everything there then main window will show all values in output. If it goes to 2nd page then it will not print anything in main window and only a text "Print Separately" will be displayed.
    I hope i am able to explain properly my problem.
    Thanks in advance.
    Ajay

    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

  • 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

  • Scripts totals prinint in main window

    Hi,
    i want to print gross value, discount,output tax and total amount after printing all line items in main window. can any one tell me where i have to write the code for this gross value, discount,output tax and total amount. i mean how to check the condition that all lines are over to print gross value, discount,output tax and total amount. i need to print this information at the bottom of main window. can any one pls let me know the process.
    Thanks & Regards
    Munna

    Hi Syed..
    In the Layout MAIN WINDOW:
    1. Create a Text element after the Text element that displays the line items:
    <b>/E LINE_ITEMS</b>
    &WA-MATNR&,, &WA-MENGE&
    <b>/E  ELE_TOTAL
    </b>
    Total = &V_TOTAL&
    2. In the Print program
       Calculate the Total into the Variable V_TOTAL
    Then Call the WRITE_FORM after the LOOP .. ENDLOOP
    LOOP AT ITAB INTO WA.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'LINE_ITEMS'
    TYPE = 'BODY'
    FUNCTION = 'SET'
    WINDOW = 'MAIN' .
    ENDLOOP. 
    <b>CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    ELEMENT = 'ELE_TOTAL'
    TYPE = 'BODY'
    FUNCTION = 'SET'
    WINDOW = 'MAIN' .</b>
    reward if Helpful.

  • 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

  • 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

  • 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

  • SAPscript layout -Repeating Main window in same page

    Hi,
    I have a requirement in sapscript layout to duplicate content within a page in two sections, of which the content can span across multiple pages.
    Can anyone give an idea how this can be achieved.
    This particular layout has 3 sections:
    1st window (Top window): invoice Details (multiple items)
    2nd window (Middle window): Check Details single item
    3rd window (Bottom window): invoice Details (multiple items) {same content of the 1st window}
    The invoice details can span across multiple pages.
    Main window alone works perfect with the requirement.
    I have attempted with a copy of a Main window for the 3rd window, and as it's specified it can only continue from the 1st main Window and i couldn't find a way to control it's value passing from the calling program.
    I have also tried using a dynamic window for the 3rd window, but haven't worked  to get the desired values shown across multiple pages. When it cross to a new page it repeats its last value across all pages.
    Please help me with this. Thanks in Advance.
    Regards,
    Viraj.

    The Standard layout only prints the invoice details once.
    If your existing layout prints invoice repeated, which means that already a customization is in place which repeats the invoice breakdown.
    If the items are being repeated in the main window, it could be that the repetition customization is done on the calling program, then a solution could be to remove/comment that call  in the calling program by searching text element name.
    If the items are being repeated from a non-main window, then a solution could be to remove/comment the entire element in the non-main window.
    hope this helps
    Best Regards,
    Viraj.

  • To display vline if main window flows to next page in SAPScript.

    Hello,
    We are facing issue that we have to put vertical line at the end of page , if main window flows to next page.
    In our case, we have payment done for different currencies as well, so that means if for first currency USD we have 20 records then after 16 records page gets break then we want sy-vline to print there and next 4 records in next page, similarily for next currency EUR, then if we have 4 records it gets displayed on one page only, so no vline is required then.
    So like this if we have 3 pages to be displayed then on first page it should displayed vline as records gets overflowed.
    May be in Script we can have more than 3 pages as well, so at different currency when we have more records then only it should show vline, otherwise not.
    Also we have signature window inside main window, so on next page it should not display line after signature.
    So please help us for finding the solution to this issue as its really urgent.
    Thanks.

    Hi friend,
    So as of now you know that the line count for a page is 16.
    So after displaying records in main window just check the sy-index or keep a variable incremental for the loop.
    Check whether the variable count is 16 and put a sy-vline. So if we have less number of records or if we have a signature window the vline wont be executed.
    This will only be executed when there are 16 records for a page. So for better handling you can use the number of lines per page dynamically. Ie to know the size of lines in the page dynamically.
    Else use of end of page command to draw lines at the end of page. But the end of page command should be used inside an if else command.
    See the link below for more options in Scripts Link : [Editing Format Actions|http://help.sap.com/saphelp_nw70/helpdata/en/ce/6f0f82ea6311d18e2f0000e83dd9fc/content.htm]
    I think this solves your issue. Please revert back to me if you face any issues. I will help you.
    Thanks,
    Sri Hari
    Edited by: srihari.kumar on Jan 31, 2012 4:27 PM

  • Display  6 line items and total in main window

    Hi,
    I want to display only 6 line items in main window( on first page and also total of the main window of first page), and consecutively in all the apges i want to display only 6 line itms and total in each page of main window, how to write logic for this.
    Thanks,
    Donlad

    Hi r u talking about Snmartform if yes
    Let us take the page you are using as PAGE1, you can achuve this using the Command Node. call the same page after 6 items as follows
    1.create Table.--->Main area , Header and footer.
    2.Declare a variable V_count type sy-tabix.
    a.Now click on the table tab>Main Area>right Create>Command (insert a command node after the Line type you r using to print the data), in this COMMAND node give the condition V_COUNT = 6. GOTO>PAGE1 (it maens you r  triggering the new page after the 6 lines.
    b. after this command noder insert the Program lines heate increase the value of V_COUNT.
    Maintain another variable the use that for page totals...
    total can be doneautomatically by using the TABle-->CALCULATION TAB.
    let me know if you more clear info, iam sure u r problem willbe solved.

  • Box in main window (sapscript) problem.

    Hi, all.
    I meet a weird problem....
    I have 2 pages form which have 2 same MAIN window and of course their source code is same one. But when I run the output form, I found that one of the page which main window's box is disappear, while the other page no problem.
    How come like this? Should be the box appear in both MAIN window, right? Hope someone can guide me.
    Thanks in advance.

    Boxes in the main window only get printed in the first page, unless you include them in an element and explicitly call the, But of course that's not the way to go.
    Every other window in the same page which has content that's not inside one element gets printed every page. So to solve your problem, declare another window (perhaps called BOXES) with the appropiate dimmensions and define in it the boxes you need. Replicate this BOXES in the other pages (if you use different page formats inside the sapscript) or leave it in the First page (if it's the only one in the sapscript). The boxes will now print in every page.

  • Box in MAIN window of sapscript keeps misaligning...

    Hello Experts,
    I am currently modifying a sapscript and inside the MAIN window, there is a box command that 'boxes' a
    static text. But the problem is, the box misaligns since the number of line items is dynamic.
    So, how can I make the box command to just 'box' the static text correctly even though the line item is
    dynamic?

    HI,
    Declare the Box and Static text in the main window with a new text element after the text element of the line items . so it will print it in the end when all of the Line items are printed..
    (or)
    Just create another script with the BOX and the text you want inside the BOX. i.e. this becomes another script which is separate from the line items you are printing there.
    call this script in your driver program with start_form FM.
    REPORT  YTEST_SCRIPT.
    DATA:
      ITAB TYPE TABLE OF SFLIGHT,
      FS TYPE SFLIGHT.
    SELECT * FROM SFLIGHT INTO TABLE ITAB.
    CALL FUNCTION 'OPEN_FORM'
      EXPORTING
        FORM                              = 'ZSCRIPT_TEST'.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT ITAB INTO FS.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          ELEMENT                        = 'TEST'
          WINDOW                         = 'MAIN'.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDLOOP.
    CALL FUNCTION 'END_FORM'.      "---------->Ends the previous form
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'START_FORM'    "------------> Starts your new script with BOX and Static text
      EXPORTING
        FORM                   = 'ZSCRIPT_TEST1'.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        ELEMENT                        = 'TEST'
        WINDOW                         = 'MAIN'.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'CLOSE_FORM'.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    This will print the BOX and the Static text in a new page after the line items got printed..
    This will solve your issue...
    Thanks&Regards
    Sarves

Maybe you are looking for

  • We are unable to validate this serial number for CS6 Design Standart. What's wrong with my key or why won't it validate?

    I bought the CS6 Design Standard student and teacher edition over amazon. I activated the product on my adobe account and got a serial number. But when I install the package and enter the serial number I a message saying "We are unable to validate th

  • Serious problem. keytool won't work?!

    Hi everyone! I have a problem with keytool that I really don't know how to solve. When I try to create a new keystore my keytool program hangs. It doesn't consume any cpu or something. I don't know what's wrong and I've tried to solve it in many many

  • Inventory differences

    Hello I'm working with a copy of 0IC_C03 Infocube for inventory,  like a standard process I have loaded: 1.- 2LIS_03_BX  extractor for openning balance 2.- 2LIS_03_BF  extractor for material movements 3.- 2LIS_03_UM extractor for revalorization and a

  • Toolbox won't install

    Installing toolbox on aTt60 series 2007. Hangs at "execute pcdoctor/pcdr5cuiw32.exe-backgroundmonsetup." Have removed previous version of pcdoctor prior to installation. First tried several automatic updates always stalled at 91% complete. Have to st

  • Plz help in the code

    I want to increase the number reduce the number specified in the textbox2  Dim ip1 As Integer = TextBox1.Text Dim ip2 As Integer = TextBox2.Text 'Dim ip3 As Integer = TextBox1.Text 'Dim ip4 As Integer = TextBox2.Text For i = ip1 To ip2 ListBox1.Items