Page-total in script

hi,
i am working on a script.
in my output i  have 3 pages in form
for each page i have to display page total
and on last page i have display the grand total.
Can any one tell me how shud i do it.
Rgds,
Fattesingh

Just have a separated element for your total. You are probably looping a table in the print program and writing some detail lines. After that loop just write the Totals element. Doing this will put the totals on the last page of the sapscript.
Loop at itab.
      call function 'WRITE_FORM'
         EXPORTING
              element = 'ITEMS'
              window  = 'MAIN'
         EXCEPTIONS
              others  = 1.
Now write the SUB totals.
    call function 'WRITE_FORM'
         EXPORTING
              element = 'SUBTOTALS'
              window  = 'MAIN'
         EXCEPTIONS
              others  = 1.
endloop.
Now write the totals.
    call function 'WRITE_FORM'
         EXPORTING
              element = 'TOTALS'
              window  = 'MAIN'
         EXCEPTIONS
              others  = 1.

Similar Messages

  • Problem with total page numbers in Scripts

    Hi,
    I have a problem with total number of pages in the Script.
    I have a script of 15 pages.
    On every page, I am using &PAGE& of &SAPSCRIPT-FORMPAGES(C)&.
    Problem is : I am getting only single digit for SAPSCRIPT-FORMPAGES as long as the page number remains in single digit - like -
    1 of 1
    2 of 1
    3 of 1... till 9 of 1.
    But from 10th page, it is printing :
    10 of 15
    11 of 15
    12 of 15... till 15 of 15.
    So, i think the symbol SAPSCRIPT-FORMPAGES(C) is filled with value 15 , but it is prinitng only the first digit '1' for pages 1 to 9 and then printing both the digits '15' for pages from 10 onwards.
    So, please help me out in this problem.
    Thank you.

    Hi Ven,
    The CONDENSE option cannot be used on the program icon SAPSCRIPT-FORMPAGES
    (C) without an explicit length specification: This symbol is
    only replaced with a value after the form has been completely edited, as the
    total number of pages of a form is first known in the program function
    END_FORM or CLOSE_FORM. However, the size of the symbol (number of
    characters) is reserved correctly when the symbol first occurs, with the
    current page number. Therefore, only one character is reserved for option C
    (CONDENSE) on pages 1-9, two characters on pages 10-99, and so on.
    If you are sure that the total number of pages doesn't cross 99(i.e 2-digit number), then use the FORM pages as SAPSCRIPT-FORMPAGES(2CZ).
    Here Z will suppress the leading zeros, for the total number of pages.
    Hope this information would be useful for you.
    Reward points if this is useful.
    Pavan.

  • System symbol for total number of pages in SAP Script

    Hello All,
    I need to display the total number of pages in a SAP Script. Say there are 4 pages and I want to display "Page 1 of 4" at the footer of first page.
    Is there any system symbol to get the total number of pages in SAP Script?
    Many thanks in advance for your help.
    Regards
    Indrajit Chakraborti

    Hi,
    In the Footer window, use this fields
    &Page& of &SAPSCRIPT-FORMPAGES&
    &PAGE& --> Current page No
    &SAPSCRIPT-FORMPAGES& --> Total No of pages Regards
    Regards
    Sudheer
    Message was edited by:
            Sudheer Junnuthula

  • Printing LAST page in SAP script on the back side.

    Hi ,
    I have a problem with the printing of the LAST page on the reverse side of the form, when done with a vendor.
    At a time we print many vendors together.
    So, when done with printing of a vendor it needs  to print his address on last page, reverse side(address)
    Next will be followed by another vendor details.
    I cannot give 'D' for the first page because it would fail if the form flows more than 2 pages.
    is there any way of triggering the LAST page in SAP Script when it done with printing of one vendor.
    any help would be highly appreciated.
    regards.

    Hi ,
    In Script PO i have to print 'Terms and Conditions' text only on the back side of last page of the PO.
    Presently script contains THREE pages ( FIRST, NEXT, TERMS).
    FIRST with attributes :
    next page as NEXT , Print mode T.
    NEXT with attributes :
    next page as NEXT and print mode T
    TERMS with attributes :
    next page as ' '.
    I Created 'TERMS AND CONDITION' window.For TERMS page i selected 'TERMS AND CONDITION' window only.
    So page window of 'TERMS'  is 'TERMS AND CONDITION'  and i included standard text in 'TERMS AND CONDITION' window.
    If PO contains 9 pages( that means MAIN WINDOW data flows up to 9th page with footer also ).
    So i have to print standard text(Terms and conditions) back side of 9th page only not on all pages.
    So total PO contians 9 pages with 10 prints.
    Please help to solve the issue
    Thanks and Regards
    Venkata swamy

  • 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 to display the page no in script

    HI,
    Can any one tell how to display the page no's as follows in Scripts.
    current page/total no.of pages(ex:1/10)

    Hi,
    For Smartforms:
    Just insert fields: &SFSY-PAGE& and &SFSY-FORMPAGES&.
    Page: &SFSY-PAGE& of &SFSY-FORMPAGES&
    For Sapscript:
    Just add: &PAGE& and &SAPSCRIPT-FORMPAGES&
    Page: &PAGE& of &SAPSCRIPT-FORMPAGES&
    Regards,
    Edited by: Jatra Riwayanto on Jun 4, 2008 9:33 AM
    Edited by: Jatra Riwayanto on Jun 4, 2008 9:34 AM

  • Calculate the page totals

    Hi To All,
        In scripts i need to calculate the page totals.that means for a customer i have lot of invoices for example my line items has been displayed in three pages, then in 1st and 2nd page i need to calculate the page total.and then for 3rd page i need to calculate the total.(but i don't that for a customer how many invoices are there).very urgent........
    U can check the standard form : f140_acc_stat_01
    correspondence type is:sap06
    For the above form i made modifications as well here i need to get the valuse for due now, due later and past due.can any one provide me the logic or field mappings.
    <REMOVED BY MODERATOR>
    Thanx and regards,
    loki
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 11:37 AM

    hmmm ok, i dont aks why you need that
    ok in your SAP-SCRIPT form there is a text element called "ITEM_LINE".
    this is beeing called once for every ITEM you print.
    in this text element make a external perform.
    like:
    /E ITEM_LINE
    /:  DEFINE &ITEM_COUNT& = ' '
    /:  perform calculate_item_count in program YOUR_PROGRAM
    /:  changing &ITEM_COUNT&
    /:  endperform
    your external perform shoulöd then look like:
    form calculate_item_count tables in_tab  STRUCTURE itcsy
                                                     out_tab STRUCTURE itcsy.
      statics:  lv_count       type i.
      lv_count = lv_count +1.
      read table out_tab
      with key name = 'ITEM_COUNT'.
      if sy-subrc = 0.
        out_tab-value = lv_count.
        modify out_tab index sy-tabix.
      endif.
    endform.
    well the variable ITEM_COUNT you defined in your form is now accesible throughout the whole form, and can be printed, like other variables.
    i hope i got you right this time
    Edited by: Florian Kemmer on Feb 19, 2008 4:59 PM

  • Page total in adobe forms

    Hi Experts,
    I want to do page total on a particular field in adobe forms . I am getting grand total but cann't get the page total.
    Is their some java script or adobe script is required for it . If yes then provide me the solution for it.  Its very urgent. Point is garanted for the solution.
    Thanks in advance.
    Regards,
    Anomitro

    Hi,
    I want to do the summation of a particular field separetely for every  page as we do in the smartforms Ihave to do it in adobe forms. I donn't want total number of page . I want sub total of  a field on every page.
    Thanks in advance.
    Regards,
    Anomitro
    Edited by: Anomitro Guha on May 28, 2008 8:44 PM
    Edited by: Anomitro Guha on May 29, 2008 11:56 AM

  • Text is broken in two pages is sap script

    hi all,
    the text is broken in two pages is sap script also total is also breaking. how to fix the problem?
    sanjay

    Hi,
    First in your window goto the text elements. There choose goto->change editor. Now you will be getting a line editor. Here you have to specify protect endprotect and write your code within it.
    Regards,
    Deepthi.

  • Want to carry forward page total.

    Dear all,
    I am using report 6i and want to print total on each page n carry forward previous page total to next page. i.e.
    first page:
    empname sal.
    AA 1000
    BB 3000
    Page Total                           4000
    Second Page:
    empname sal.
    carry forward : 4000
    CC 1000
    DD 3000
    Page Total                              8000
    How to do this?
    Thanks in Advance

    Hello,
    I have uploaded an example here : ftp://ftp.oracle.com/support/outgoing/dsegard/cumul_haut_bas_page.rdf
    The example is based on the table EMP (Script to create the table and populate it are available in ORACLE_HOME\tools\dbtab\demobld.sql)
    Regards

  • Page Totals in Adobe Form

    Hi
    Need some help in Page totals in Adobe forms
    I am having a table which flows into several pages .
    I need to display the Total of a column at the end of every Page .
    How can i achieve that .
    I have tried the Script wih the pageContent method it is not working .i have also tried the sum method but it gives the grand total not the page total
    Since we can not know at what record in the table page break can occur, i can not add in the back end program . It has to be done dynamically .
    Please help me .
    Thanks
    Ramakanth

    Hi
    Thanks Andres
    I am now able to do the Sub Totals , but i am facing a new problem
    My Requirement is
    I have a table in my Design page
    If the data in my table flows for more than one page then
    1) I should show at page end sub total of Net Amount column in the table
    2) The same Amount should be shown in the starting of the Second Page after which the table contents should flow
    3) At the end of Page 2 i should again display the total amount which is addition of total from previous page and sum of all items in page 2 .
    Example
    Page 1
    Documentnumber currecy Amount
    1                             USD      100
    2                             USD      200
    3                             USD      300
    Balance CarryFwd              600
    Page 2
    Balance Carryfwd              600
    4                           USD       1000
    5                           USD       2000
    6                           USD       3000
    Balance Carryfwd              6600
    Page 3
    Balance Carry fwd            6600
    ..... and so on
    I have tried to use the Overflow leader and Trailer to get this functionality but in that case only texts are being displayed
    not the Values .
    I have tried to create the BalanceCarryfwd form in Master page but the sub totals are not comin up there .
    How can i implement this logic , Please help me in this .
    Thanks
    Ramakanth

  • 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

  • How to remove blank page in sap script

    hi ,
    I have a problem in sap script. I copied one std. script and made some changes i.e removing the unwanted pages from the script.
    no where NEW-PAGE kind of command is declared in window but still a new blank page is coming in printing.
    i checked with the posted comments in forum n what i found .. i did that part for my script..but no progress.
    so help needed.
    thnx,
    m

    Hi,
    If there is no any "NEW-PAGE" command in your any window, Pls check following probable causes.
    1. Check your main Window, may be there is blank line at the last of the main window, so check that and remove that,so you won't get the blank page
    2.Please check what have you defined as the NEXT PAGE for your first page. If so change it and make the first page itself as the next page.
    Hope it help you.
    Regrads,
    Lokesh.

  • Displaying page total on a page with fixed number of lines

    Hi ,
    My requirement is to have a fixed number of rows per page (say 20) and to have a page total beneath the table containing the data.I am using a RTF template.The columns in the table are
    Order
    Amount
    Page Total : 3000
    For including a page-break after 20 lines, i have added the following code.
    For - each ______________
    <?if:position() mod 20 =0?> <xsl:attribute name="break-before">page</xsl:attribute> <?end if?>
    end - for_______________
    This limits the no of rows per page to 20.
    I have tried 2 ways to display the page total but both don't seem to work Can someone please point what i am missing here?
    1) Using add and show-page-total
    I added the code (<?add-page-total:at;'Amount'?> to the Amount data column in the template and then used the <?show-page-total:at?> in the page total data column to display the total. But this doesnt work.It doesnt display any value.
    2) Using Variables:
    I declared a variable (<?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', 0)?>) before the table. Then, i used the (<?xdoxslt:set_variable($_XDOCTX, 'RTotalVar', xdoxslt:get_variable($_XDOCTX,'RTotalVar') +Amount)?>) in the Amount data column to calculate the sum. I then used <?if:position() mod 20 =0?> <?xdoxslt:get_variable($_XDOCTX, 'RTotalVar')?><?end if?> in the data column of the page total. But this doesnt work.  The variable loses its value when it is displayed outside the table. Why is it so? How can i declare a global variable? I am not sure why the variable loses it value when taken out of the table. I would want it hold the value through out the document. Is my understanding correct?
    Kindly help me with this issue.
    Thanks,
    Vidhya

    Hi
    I have the same issue. could anyone provide the link or template. I searched in the forums but couldnt find related to this post.
    please help
    Thanks

  • How can I create more than one main window in a page of SAP SCRIPT?

    How can I create more than one main window in a page of SAP SCRIPT? If anybody helps me I will be obliged.
    Regards,
    Subhasish

    Hi Ganguly,
    It is possible to have more than one main window in a same page.
    You create a main window and simply you copy and past it in the same page.. it will create first main window name as MAIN and other main windows as MAIN01,MAIN02.... up to MAIN99.
    Contets flow from MAIN , MAIN01, MAIN02.......................MAIN99. contents after filling the current window it flows to next window(by default, you skip as well with some keyword not sure could be NEW-WINDOW)
    you want print the main window data twice? or you want to create two main window in the same page ?
    1. give two copies in the no of copies in the output type screen ( Which pop up is coming after excute the program ).
    2. create two page with the same script form.
    3. you can write the coding inside the program to print twice the same page.
    Hope this information use full to you..

Maybe you are looking for

  • Bleeds not showing up in exported pdf

    Hi. I'm having issues with the pdf after it has been exported. I have added bleeds to the design file and when I export it (and check the bleeds box in the exporting window) they do not show up. What does show up are these crop marks, which is strang

  • Using EEWB Fields

    Hi, We have created a condition table with customer defined fields (eewb fields) . But the condition is not determined dynamically, the pricing is not triggered. Should we implement CRM_PRICING_BADI to trigger pricing when a customer header field is

  • Forgot password option in webdynpro

    Hi all,    I want to provide Forgot password option in all  Webdynpro apllications created. So that users who give the URL in the browser, they should have fields like date of birth and mail id as questions. If they provide these values , they can be

  • Gateway_timeout Error - " WSA in cloud connector mode"

    Users are getting gateway_timeout error On launching browser and entering URL, the above error message appears but when we quit the page and click on the link again that works. Kindly check and help for resolving issue ASAP. pfa for the error screens

  • Creating ejb in servlet

    Hello! I have a code, that looks up a home interface of ejb and creates remote. If I run it in init method of servlet - all is ok and if I run it in static block - all goes wrong - I get an Exception(something about Proxy$ ..) I understand, that stat