Subt totals in smartform

Hi
How to make subtotals in SMARTFORMS?
Regards
Shashi

Hi
One can insert static and dynamic tables. These include the line feeds in the individual table cells, triggering events for table headings and subtotals and sorting data before output.
Sub window-->Position text on one or more pages
Main window-->Display text in relation to other nodes in the main window, it may cover several pages
Template -->Displays texts for table cells of a static table
Table-->Display table contents
Header and footer-->Display column headings and grand totals in tables
Event node-->Display subtotals in a table
SF_EXAMPLE_02
Similar to SF_EXAMPLE_01 but with subtotals
Regards
Pavan

Similar Messages

  • Urgent:page wise total in smartforms

    hi,all
    How to do page wise total in smartforms   ?
    use table in smartforms for summary in pagebreak
    ex. page1
    10 (line 1)
    20 (line 2)
    30 (line 3)
    total 100
    page 2
    40 (line 1)
    50 (line 2)
    total 50
    Total in page 1 incorrect = line1(page1) + line2(page1) + line3(page1) + line1 (in page2)
    Total in page 2 inccorrect = line2 (in page2) .
    please help me guys to solve this problem..

    r u printing the internal table data using the TABLE node then--> in the Calculation tab u can do this.
    first create a variable in Global difinations-->global data tab.(ex v_tot)
    then in the TABLE>calculations TAB> 1select ->sum then 2nd colun>give the field name which u want to calculate (ex-wa_itab-netwr) in the Target Filedname tab> give the varialbe u have declared for the total(ex v_tot). in TIME colums select AFTER theLOOP...
    then in theTABLE>footer>inset a line display the variable(total u r using).here
    after the the printing the total..->create a program lines> cleat the v_tot... why u need to clear this is.... u want to display only the total value which are displaying in the current page... after printing this v_tot... clear this... so that in the next page it start totaling the freshly...
    lem me know if u have any clarifications.
    u can calculate as the above way for all the 6 fields.
    please Avoid postin duplicate threads

  • Hi frinds ,how to calculate the  totals in smartforms

    1)how to calculate the  totals in smartforms .

    Hi,
        To calculate totals and sub totals in sap scripts you can use subroutines.
    Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
    /: DEFINE &TOT_PRICE&
    /: PERFORM F_GET_PRICE IN PROGRAM /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
    Then write the variable where ever you want it to be printed (mostly it will be in footer window)
    Then create subroutine pool program and you have to write the code.
    FORM F_GET_PRICE tables int_cond structure itcsy
    outt_cond structure itcsy. data : value type kbert.
    statics value1 type kbert.
    Read int_cond table index 1.
    value = int_cond-value.
    value1 = value1 + value.
    Read outt_cond table index 1.
    outt_cond-value = value1.
    Modify outt_cond index 1.
    ENDFORM.
    regards..

  • Pagewise total in smartform

    hi all,
             i want to know how to do pagewise total in smartform ?
    all those data i am having in an itab...
    plz help.
    With Regards,
    S.Barane

    r u printing the internal table data using the TABLE node then--> in the Calculation tab u can do this.
    first create a variable in Global difinations-->global data tab.(ex v_tot)
    <b>then in the TABLE>calculations TAB> 1select ->sum then 2nd colun>give the field name which u want to calculate (ex-wa_itab-netwr) in the Target Filedname tab> give the varialbe u have declared for the total(ex v_tot). in TIME colums select AFTER theLOOP...</b>
    then in theTABLE>footer>inset a line display the variable(total u r using).here
    <b>after the the printing the total..->create a program lines> cleat the v_tot.</b>.. why u need to clear this is.... u want to display only the total value which are displaying in the current page... after printing this v_tot... clear this... so that in the next page it start totaling the freshly...
    lem me know if u have any clarifications.
    u can calculate as the above way for all the 6 fields.
    Message was edited by:
            Naresh Reddy

  • Line Totalling and page totalling in smartforms?

    Hi,
    Any ideas about displaying line totals and page/grand totals in smartform. Answers would be appreciated.
    thanks

    Hi..,
    in TABLE you will have one tab called CALCULATIONS..
    in that select the type as TOTAL and give the field name for which u want to find out the total. and give the resultant field into which u want the total to be stored !! and select AFTER LOOP in the next list box...
    in the footer you just write this field name. u will get the cumulative total for each .. i mean for second page the total of ( the first page and second page) will get printed !!
    if u want the total for each page then u need to write a program line for the table.. to clear the total field for each page !!
    reward if it helps u,
    sai ramesh

  • Prob with  Totals in Smartforms

    Hi,
    I am having a problem with Totals in my smartform.
    I am Printing SUBTOTALS , GRANDTOTALS and CARRYFORWARD of amounts in my smartform.
    My Problem comes with Carryforward total ( Balance forwarded to next page ).
    Its getting added to a first record in next page and the balace is getting displayed in present page.
    for example if the total in this page is 1000
                        and the next page record amount is 100
                   I am getting the CARRYFORWRD balance as 1100 instead of 1000.
    I am calculating the subtotals and grandtotal in the Main area of the table and printing the Balance carry forward / grandtotal in the Footer area of the total
    I cant use calculation tab because the currency may vary.
    How to get the correct CARRYFORWARD balance
    regards
    Prasanth

    Hi
    For carry_forward:
    In the global data:
    carry_forward type I default value : 0
    In the program lines:
    carry_forward = TOTAL_SAL - TOTAL_SAL_PAGE.
    Create the txt node for the carry forward.
    Condition : not on first page.
    For page_total.
    Create the text node:
    page total : drag and drop the field.
    In the program lines.
    carry_forward = 0.
    total_sal_page = 0.
    For grand_total.
    Create the text node:
    grand_total : drag and drop the field.
    Condition tab : only after end of the main window.
    Regards,
    Sravanthi

  • Reg: Subtotal and final total in smartform?

    Hi Experts,
    I'm working on a smartform where i need to display the line items from lips table.
    This is my final internal table.
    TYPES : BEGIN OF it_final,
              matnr    TYPE lips-matnr,       "Article
              vbeln    TYPE likp-vbeln,       "Delivery Number
              arktx    TYPE lips-arktx,       "Article Description
              vrkme    TYPE lips-vrkme,       "Unit of Measure
              lfimg    TYPE lips-lfimg,       "Delivery Quantity
              kunag    TYPE kunag,            " Sold To
              name     TYPE name1,            " Name
              charg    TYPE lips-charg,       "Batch Number
              vfdat    TYPE lips-vfdat,       "Expiry Date
              lgort    TYPE lips-lgort,       "Storage Location
              matkl    TYPE lips-matkl,       "Merchandise Category
              wgbez    TYPE t023t-wgbez,      "Merchandise Category Desc
              lgpbe    TYPE lips-lgpbe,       "BIN Number
              pikmg(20) TYPE c,               "Picking Quantity
              route    TYPE likp-route,       "Route
           END OF it_final,
    For one material number, there will be many line items, I need to have a subtotal for a particular material and at the end i need afinal total for all the material number.
    I have sorted my internal table as sort it_final ascending by matnr vbeln.
    Then this internal table is moved to smartform.
    In smartform i'm using table to display the complete data. Here i need to segregate into subtotal and total.
    Please help me to display the data in below format.
    For Ex:
    MATNR                    DESC                          QTY                  VBELN
    1000001                  tea                               12                     3500000012
    1000001                  tea                               02                     3500000013
                                              subtotal             14
    1000006                  salt                              01                      3500000013
                                              subtotal             01
    1000008                  sugar                          02                       3500000015
    1000008                  sugar                          02                       3500000012
    1000008                  sugar                          02                       3500000013
    1000008                  sugar                          02                       3500000016
                                              subtotal             08
    Total                                                            23
    Thanks in advance.
    Guys, The data is not getting displayed in Preview properly. Please edit and read it or copy in the notepad and read it.
    Regards,
    Abdur Rafique
    Edited by: abdur rafique on Aug 8, 2009 3:38 PM

    HI,
    for the total it is easy.
    Just calculate the total in a variable just before the table in the smartforms.
    Display the total variable in the FOOTER section of the table.
    To display the subtotal you will have to do i bit of workaround.
    In the table create 2 LINE TYPES.
    The 1st line type will have the four columns to display MATNR DESC QTY VBELN.
    The 2nd line type will be of single column which will be used to display the subtotal.
    In the main section of the table create 2 rows of the above line types.
    In the 1st row display the MATNR DESC QTY VBELN as normal.
    In the 2nd row display the subtotal.
    This should be done as follows:-
    Add one more column in your internal table as follows:-
    MATNR DESC QTY VBELN SUBTOTAL.
    Now you have to do some coding to create your internal table as follows:-
    MATNR DESC  QTY VBELN SUBTOTAL.
    1           test     10    100001
    1           test     10    100002
    1           test     20    100003 40
    2           test2   10    100006 10
    3           test3   50    100009 
    3           test3   60    100010 110
    This internal table should be created before displaying the table in the smartforms.
    Then this internal table should be used in the smartforms.
    The subtotal column should be shown in the 2nd row of the main area of the TABLES.
    Also add a condition to it that it should be shown only when the column SUBTOTAL of the table contains any value.
    So in this way you will be able to achieve your required output.
    i hope you understand my idea.
    regards,
    Ankur Parab

  • Create Grand total in smartform

    Hi,
    I am using the calculation tab in table folder of my smartform. But i am not getting the result ,all blank. Plz help me to solve this issue.
    Thanks in advance.

    Hi Snehashis,
    It will be difficult to visualize your situation .
    But see the following pictures, where Grand Total was computed.
    Individual totals
    For Grand Total calculation, Program lines was created as under, where you want this Grand Total.
    Then
    Obviously SUM1 is flown from another field.  (Calculation filed)
    SUM1, GTOT will be Global Variables. and S_TPREV will be from interface. (s_tprev can be in the form wa_ekpo-ebeln )
    This post just gives you some idea of calculating Grand Totals, to get some clues to apply to your case.
    Jogeswara Rao K

  • Totals in smartform

    Hi,
    I have developed a smartform with 3 pages. Page 1 calls Page 2 as next page and page 2 calls itself (page 2) as next page, recursively. Page 3 has terms and conditions.
    Now the problem is that I want to have the total of the Purchase Order on the last page (page before terms and conditions). How do I accomplish this?
    Thanks and Regards,
    Mick

    Thanks Max.
    We are printing Purchase Orders in the smartform.
    I have inserted the variable for the totals in the footer of a table in the main window. But before the footer I have a program node, in which i have written logic that if the the GUID of the cuurrent line item is equal to the GUID of the last line item in the internal table, then I am setting a flag. I have put this flag in the condition of the text element of the footer.
    Now what is happening is that whenever the last line item of the PO is split over 2 pages, the totals are printed both on the 2nd last page and the last page. Also if I put a page break, I still have the same problem ie if the last line item of the PO is displayed on a new page as due to the page break, the total is displayed both on the 2nd last page and the last page. We want the totals only on the last page.
    Thanks,
    Mick

  • How to display page wise totals in Smartforms

    hi,
    I created Tax Invoice for SD my quetion is i have 10 items 5 items are displaying in first page and rest of 5 items are displaying next page.
    in first page 5 items i have to display the total amount in first page and same like second page also please help me.
    regards

    Hi,
    Create two global data variables called pag_total & currentpage and initialize currentpage as 1.
    if currentpage <> sfsy-page.
       pag_total = 0.
       pag_total = pag_total + column value(which values u want to add).
       currentpage = sfsy-page.
    else.
       pag_total = pag_total + column value(which values u want to add).
    endif.
    Write these lines in main area table row of that particular column cell and store the SFSY-page value also in a global variable(currentpage).
    Then write the pag_total variable in the footer.
    Thanks,
    Venkat

  • Sub total in smart forms

    how to calculate sub total in smartforms
    give step by step
    mak

    Check out the below related thread .... Hope it helps
    total and subtotal in smartform
    HI    SUBTOTAL IN SMARTFORM
    Hi can any one help subtotal in SMARTFORM with sample steps&code
    Regards,
    Santosh

  • Reg: passing totals /subtotals of a ALV to a smartform

    I have a editable ALV report which has a button to call a smartform . Once the user edits some  fields I need to pass the refreshed total to the smartform.  I want to know - in what structure the totals/subtotals  of the ALV report are stored.

    Banu,
    Even if you figure out how to get the subtotals / totals from a ALV, I would still suggest you to use the features of SMART Forms to calculate the same again in the form.
    http://help.sap.com/saphelp_nw04/helpdata/en/55/610e2db57911d4b62c006094192fe3/content.htm
    So, that way if your form is triggered even without doing the subtotalling done by the user you are on the safer side as the form will still display what you have designed it for.
    Regards,
    Ravi
    Note :Please mark all the helpful answers

  • (Smartform) Print grand total on the last page

    Hi everyone,
    I'm trying to print the Grand Totals on the last page of my Smartform. I have two pages - FIRST and SECOND.
    What I did was I created a Text to display the grand total, and I specified that this text should be printed 'Only After End of Main Window'. However, the total is not being printed out.
    I can't change the condition to 'Not on First Page', because my form has more than two pages, and I only want the grand totals on the last page.
    Any help would be appreciated.

    hi,
    we have a window type called final window if u define this type window in second page . create a table in the window and go to calculations tab and define an internal table. i think u can get the grand totals.
    if u want maore clearly go throuh this link
    https://www.sdn.sap.com/irj/sdn/forums
    hope this will help you.
    REWARD ME IF USEFUL.
    thanks,
    gupta
    Edited by: gupta pullipudi on Apr 9, 2008 9:23 PM

  • How to modify total pages in smartforms?

    Hi All,
    In smartform Im printing ' page of total pages' as &SFSY-PAGE& of &SFSY-FORMPAGES(3CZ)&. All are working fine. Now at last I have to print one extra page without page no. So, If the total o/p pages are 16 ( including last page) I have to show i.e
    1 of 15, 2 of 15 .... 15 of 15 , and in the last pages nothing. For this Im moving SFSY-FORMPAGES to one variable and substracting one from it, but its not working, its showing as 1 of 0, 2 of 1 ... 15 of 14..
    so how to decrease the total page number. I think it generates in runtime and in my smartform all windows are in one PAGE.
    So how to do this ? any Idea?

    Hi,
    I think we can try this. Issue new page after all pages. If page less than or equal to total pages, display that, else issue new page.
    /: IF &SFSY-PAGE& LE &SFSY-FORMPAGES(3CZ)& .
    ' page of total pages' as &SFSY-PAGE& of &SFSY-FORMPAGES(3CZ)&
    /: ELSE.
    /: NEW-PAGE.
    /: ENDIF.

  • How to print total stock in smartform by material wise

    Dear Experts,
    I am trying to print total material stock which is issued and receipt during entered date in a smartform ,Here  I want to print totatl stock issued n receipt by material wise in seperate line .For that I fetch alldata and put into one internal table .In smartform I am using table for printing data.
    Edited by: BharatRathod on Mar 8, 2010 11:43 AM
    Edited by: BharatRathod on Mar 8, 2010 11:46 AM

    Hi,
    Try using the CALCULATIONS tab in the tables for printing the total stock in smartforms.
    Regards,
    Sharin.

Maybe you are looking for

  • Confusion between references in recursion

    Hi all, I am trying to create B+ trees for a database. My algorithm for the insert function is: void insert(page_no, entry, newchildentry ) if page_no is not a leaf ,say N find i such that Ki <= entry's key value < K i+1   //choose subtree insert(new

  • Will itunes eat my songs?

    This is a sad story. Until two days ago I was only a PC owner. That's sad enough, but here's the rest of the very sad story. I had added about 3,000 songs to my iTunes library and recently purchased about 38 on iTunes. My computer would not burn the

  • Can't install / find printers.

    Can't install / find printers. Mac newbie here. At home, my printer is on a network and my iMac finds it. Now i have a new iMac at work and I can't find / install any printers from the network. in the printer utility no default printers are listed. I

  • Is there a FM imbedded link used for phone numbers that in a pdf file activates the number on a smart phone?

    When I use the URL hypertext function and type in mailto:<email address> and save it as a pdf. When bringing the pdf up in a smart phone and tapping on the link, it will bring up email to that person. Is there a FrameMaker version that also does this

  • Lock the plant so that other user cannot use the same plant.

    Hi Gurus! I ahve this small report which shows the pro-rate factor . In this report I need to block the plant or lock it(a soft) lock witha  message that some other user is using the plant so that other cannot use the same plant to post.Following is