Discount in 2 pages invoice Smartform

Hi;
i calculate the given discount in an invoice, if the invoice is a one page invoice the total discount is ok, but if it is a 2 pages invoice, in the first page the calculate of the discount is just for the items of the first page, then i turn to the 2nd page and the total of the discount is for the items of the 2nd page:
example:
page 1 discount: 85.11
page 2 discount: 00.38
the total should be 85.49 and should be shown in each page but instead is shown in parts in the 2 pages.
what should i do to get this discount in on variable that doesn't change on each page?
Thanks on advace.
David Fúnez
Corp. Mandofer/Asin
Tegucigalpa, Honduras

It is going to be little bit tricky. But I hope I will explain you better.
1. Create a one Dummy Window just before after the main window and before the Discount window.
Set the flag "Only After End of Main window"
Create one Code under this window
Put code like:
L_LAST = 'X'.
2. In Discount window:
Put this code:
if l_last = 'X'.
clear l_last.
clear: l_sub_tot_dis.
print_tot = 'X'.
endif.
l_sub_tot_dis = l_sub_tot_dis + discount_amt.
l_Tot_dis = l_tot_dis + discount_amt.
Print these both variables in separate text element
Put condition as PRINT_TOT = 'X' for the TOT_Discount
Hope this works.
Regards,
Naimesh Patel

Similar Messages

  • Regarding Purchase Invoice Smartform

    Hi.I need to develop a purchase invoice smartform.I am having the following fields.
    1) g/l Account
    2)Narration
    3) Posting Date
    4)Bill Number
    5) Bill DAte
    6)PO No
    7)PO Text
    8)Voucher No
    9)Voucher date
    10)quantity 11) rate 12)amount13)discount 14 ) sales tax
    What are the tables & Fields required for these.I'm not sure whether to take these from rbkp rseg or from purchase tables.
    It's very urgent.
    Helpful answers would be appreciated

    Hi
    Look at the tables EKBE.
    RKPF and RSEG  for the pur invoice info and if needed look at the tables BSIK and BSAK also for the accounting info
    Regards
    Anji

  • Regarding Purchase Invoices Smartform

    Hi.I need to develop a purchase invoice smartform.I am having the following fields.
    1) g/l Account
    2)Narration
    3) Posting Date
    4)Bill Number
    5) Bill DAte
    6)PO No
    7)PO Text
    8)Voucher No
    9)Voucher date
    10)quantity 11) rate 12)amount13)discount 14 ) sales tax
    What are the tables & Fields required for these.I'm not sure whether to take these from rbkp rseg or from purchase tables.
    Helpful answers would be appreciated.

    hi
    you can use RBKP and RSEG tables for Vendor invoice (purchase) form output
    if needed you can use EKBE, BSik and BSAK tables alos
    Regards
    Anji

  • Printing extra pages in smartform

    Hi All,
    i'm new to smartforms.i got an issue on invoice(smartforms).i'm getting 3 extra blank pages in smartform.how and where should i rectify that.can any one help me please.
    thanks in advance

    Hi Mr Rao & Mr Reddy,
    thanks for your prompt responses...added to the question, in the extra page i'm getting spool information.actually the program is set in background.once the invoice is issued the form is sent to printer.and in the spool it is displaying the actual pages only.its not showing the extra pages.but once it is out from the printer,i'm getting the extra pages with the spool information
    the information on the extra page is....
    user:
    host:
    class:
    job:
    these are the four lines i'mm getting on the extra page.could u please help me.
    thanks in advance.

  • Invoice Smartforms

    Hello,
            I have written a bespoke invoice smartforms. The problem I am having is that sometimes the smartform is generating a 'next page' when it does not need to. There is a Footer detail defined within MAIN. The smartform lists the items and then prints the footer detail and then it sometimes prints the next page but with just the general information (i.e logo, title, invoice number, etc).  In some instances there is no item information so there is no secondary window expected to displayed on the next page.
            My question is, how do I stop this additional page from being produced when there are no items to be displayed on this page? I thought that the 'next page' is only suppose to be generated when it cannot fit the items all on the first page.
            Has anybody experienced the same  problem? Any help would be appreciated.
    Thanks in advance.

    Hi,
    I had this requirement, where the items should be displayed only on 1 page, as it was an Excise Invoice.
    If the Items spill over to the next page, I generate an error Pop-up message, thereby stopping the Print-preview processing.
    In your MAIN window, put this code to chk the current page no.
    if sfsy-formpages > 1.
      message 'Items splilling over to next page'  type 'E'.
      return.
    endif.

  • How to print specific page in smartform !

    Hello Friends,
                  I like to print specific page in smartform. for Ex. page 4. But when I give page no. 4, the print preview not showing the exact page.
    Thank you for your time.
    Senthil

    Hi Senthil,
    chk this link you get a brief idea abt Smartforms.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf
    Reward points if you find this helpful
    Regards,
    Harini

  • How to Print next Page in smartform ?

    Hello ,
    I want to print next page in smartform.
    The situation is :-
    I am passing an internal table containing list of personal numbers.
    I have to print their details . Every candidate's detail should be printed on a new page .
    I have designed the whole form , but I am not print their details on a New Page.
    Please guide.
    Thanks in Advance.

    Hi, Nikita.
    Please Have a Look the following Link
    [MODERATOR MESSAGE: SapScript/Smartform questions go in FORM PRINTING forum|/thread/1360534 [original link is broken];
    So, Please Post Questions Regarding SapScript and Smartform in FORM PRINTING.
    1. First of all you need to set a Flag at the end of every Personal Number.
    2. Than Right Click on the object Like Main Window
    --> Create --> Flow Logic --> Command
    3. From First Tab of Command General Attributes Check the Check Box Go to New Page and Select Your Page
    4. In the Conditions Tab Give you Flag Condition.
    Hope will help you to solve out your problem,
    Please Reply if any Issue,
    Best Regards,
    Faisal

  • How to Print two pages in smartforms

    Hi All,
    How to create two different pages in smartforms.In my requirement the first page contains Table data in main window and in second page only the hard coded desription should be printed containg instructions,but the second page is mandatory after first
    page is completed,the first page may have n number of pages after printing those pages my second page should trigger.Help me if any one knows.
    Thanks in advance............
    Regards,
    Satya.

    hi ,
    once a main window size is declared , then that space will be placed in each page created.
    eg. if a table with header and footer is created, first of all the space for header and footer are allocated and body page is allocated.
    so we cannot dynamically change the size of the main window , even it is a copied main window.
    Otherwise another option is to continue the main window into the second page.
    for that first page main window -> create table -> add page break command to page 2 -> hard code description in template.
    page attribute for first page --> GOTO assign same page ( for continuing the same page)
    Page attribute for second page --> no need default is enough

  • How to break a page in smartforms

    Hi all experts
    I want to break the page in smartforms i am using window in last cell of footer but it is giving me error message  "Page break is allowed  only in the main window"
    can any body tell me the solution ........
    thanx in advance

    hi!!!!
    The page to which you want to branch must exist. You can branch to a new page only as long as you are still displaying the contents of a main window.
    Choose Create -> Command in the context menu to create a command node in the main window of the page.
    On the General Attributes tab strips  Tick Go to new page.  Determine the new page using the list box next to the checkbox (it can be the same page if you want).
    The output of the main window will continues on the new page.
    reward if helful..

  • How to print text on back and back of page in smartforms

    How to print text on back and back of page in smartforms.

    Prince,
    in page's output option you can set D for double-sided.
    Default: No change of print mode
    S     Begin new page in SIMPLEX mode (single-sided)
    D     Begin new page in DUPLEX mode (double-sided)
    T     Begin new page in TUMBLE DUPLEX mode (double-sided)
    Amit.

  • Getting Runtime error while adding Second page in Smartform.

    I added 2 pages in smartform. When I worked with single page. smartform working properly. Now I added one more page(i.e Second page) I am getting runtime error.  ("The current ABAP/4 program encountered an unexpected
    situation".   A RAISE statement in the program "SAPLSTXBC" raised the exception
    condition "ERROR".)   When I debug this standard program Something width problem getting on line number 110. Both width not matched so program raising exception. Can you please tell me to solve this problem what changes will I do in my smartform?

    Please let me know the details of each page.
    Error can occur in these cases.
    1) You copied the first page to second. and later you change the width of second page
    2) You created the second page and there is template in second page. each column width is not matching with the total width of the template.
    3) windows width is greater than the page width
    Please have a look.
    Regards,
    Nikhil
    Edited by: Nikhil V Kumar on Jul 27, 2010 12:16 PM

  • How to print headings in every page of smartforms.

    Friends,
    we have a requirement to print hedaings in multiple pages.
    like if we have  100 line items those will accomidate more tahn one page , i need to print headings in each page.
    pls help me.
    Regards
    Jagadeeshwar.B

    hi ,
    can u check this...
    how to use new page in smartforms
    If you are calling window to display header, then just un check the output option->display on first page only.
    regards,
    venkat.

  • How to print grandtotal in table footer only in the last page in SMARTFORMS

    Hello Experts,
    How do I print the GRANDTOTAL in the table footer only on the LAST PAGE in SMARTFORMS.
    What I have done is in the text element of CELL1 of the table footer i wrote the folowing logic but not working.
    /: IF &SFSY-PAGE& EQ &SFSY-FORMPAGES&.
    * V_SUM.
    /: ENDIF.
    I even tried this.
    /: IF &NEXT-PAGE& EQ 0.
    * V_SUM.
    /: ENDIF.
    but still it displays the grand total on all pages at table footer.
    How do i go for this experts.
    Regards,
    Ranjith N

    HI Nambiar,
    To print the grand total only on the last page then create the secondary window --> create the text node for the grand total -->In the condition tab check only after the end of the main window.
    This grand total will be displayed after all the items and end of the main window.
    Footer in the table displays as the subtotals i.e on every page total is displayed..
    Regards,
    Sravanthi

  • Could u tell me how2control printing out the certain page in smartforms?

    there are many pages when I preview ,
    but I only need one  or several of the pages.
    How to print the certain page in smartforms?
    and if there are several windows in one page
    how can I just print out one or several windows of them?
    what should I insert "command" or "program lines" into
    the "flow logic" ?
    It's very kind of you to explain that in detail.
    Thanks very much in advance.

    pls help me,thank you

  • Problem in displaying total no of pages in Smartform

    Hello experts,
    I have a problem while displaying total no of pages in Smartform.
    When no of pages are more than 10 then in total no of pages , a * is shown till current page is 9, then after it is displaying correct no of pages.
    I am using &sfsy-formpages& to get total no of pages.
    Ex: Like if I have 12 pages to print then i am getting 1/, 2/, 3/* .......... 9/* then 10/12 , 11/12, 12/12.
    Do i have to write some code for that ?? Please give your inputs to get the total no of pages.
    Thanks !

    Hi,
    Try this.
    Page &SFSY-PAGE& of &SFSY-FORMPAGES(4ZC)&
    Thanks,
    Anitha A

Maybe you are looking for

  • Slow Mac Mini Server after upgrading to OS X Yosemite

    I Have a Mac Mini Server mid 2010. With 2.66Ghz intel Core 2 Duo and 4Gb DDR3 and after upgrading to OS X Yosemite the computer is really slow and get stuck very often. Please help me figuring out what's the problem and to make it run faster.

  • Popin in the table diappears when sorting is done

    Hi Experts, I have an unusual problem here. I have a table with popins for every row. I have also implemented the sorting functionality for the table. But when the table is sorted, the popins in the table ( the data in those popins which is actually

  • How to mount windows share as a drive letter?

    I have a user that has interlinking excel spreadsheets that are located on a network share. Spreadsheet A on K: links to Spreadsheet B on K:. The links in excel are defined as K:\adirectory\spreadsheetb.xls... How do I mount a drive on a Mac, such th

  • Utorrent messed with my browser settings among other things?

    So I had downloaded utorrent yesterday but ended up not needing it like I did and I realized that it had changed my browser settings to go straight to Yahoo Search. I fixed the extensions and reset the browser home page and everything and continued o

  • Syncing Numerous devices on icloud

    I will be backing up my new Mac Pro to the iCloud along with my iPhone, iPad and iPad mini.   I would like my music and music videos that I own from CDs to be stored on my Mac Pro hard drive but to be kept in sync with my Mac mini server in New York