Show total sum in SAPUI5 Table

Hi,
I want to show the total of a column as a final row of the table.
Need help in achieving it.
Below is a mock up of what I am looking for.
Right now the only thing I can think of is table footer text. But Is aligning the same with a particular column is possible (without using padding/spacing /margin) ?
Regards,
Raj

Hi all,
Found the solution.
For each/one column we can set a footer.
new sap.m.Column({ // second column
  hAlign : "Right", // column will be right aligned
  header : new sap.m.Label({ // header of the second column
  text : "Price"
   footer : new sap.m.Label({ // footer of the second column
  text : "15.00 EUR"
this solves my issue.

Similar Messages

  • Total sum to be displayed in a table view control ?

    Hi,
      I am unable to display the total sum of a column in a table view control( using HTMLB ). How should one display the sum of a column ?
    THanks in advance,
    VaraPrasad

    Hi,
    it should work once you are restricting the capacity of the out put port then it should provide that much rows only otherwise its a Bug.
    Alternativily you are tellin to disaply using sorting then add a Sort operator to the output port and the display ur output port in down order.
    But first option should work just check it again.
    On which SP u r working?
    Regards,
    Govindu

  • How to Hide rows in ALV without affecting total sum at the end of table?

    Hi,
    I need some help in hiding particular rows in an ALV Grid without affecting the total sum at the end of the table. I am trying to hide the rows that have negative quantities, but I still need those values so that the user can still compute for the total sums. Can anyone help? Thanks.
    Joseph

    Hi,
    Hopw this way you can hide the rows in the GRID.
    DATA:
      ld_column      TYPE lvc_fname,
      ld_hide          TYPE abap_bool.
    FIELD-SYMBOLS:
      <ls_entry>     TYPE any,
      <ld_fld>         TYPE any.
      ld_column = 'COL_1'.  " column which you want to suppress if everything is zero
      ld_hide     = abap_true.  " = 'X';  default hide column
      LOOP at <gt_outtab> ASSIGNING <ls_entry>.
        ASSIGN COMPONENT (ld_column) OF STRUCTURE <ls_entry> TO <ld_fld>.
        IF ( <ld_fld>   > 0 ).
          ld_hide = abap_false.  " display column because at least single value > 0
          EXIT.  " leave LOOP
        ENDIF.
      ENDLOOP.
      READ TABLE gt_fcat INTO ls_fcat
                           WITH KEY fieldname = ld_column.
      IF ( syst-subrc = 0 ).
        ls_fcat-no_out = ld_hide.
        MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
      ENDIF.
    hop you will get the total with for those columns too.
    Regards,
    Madhavi

  • How to Show Total Calculation in Footer of Table

    Hi everyone, is it possible to show total calculation in footer of table in webdynpro ? For the calculation, I think i can handle it because many thread in forum and weblog discuss it but for show it in footer of table , i can't find.
    Display
    A
    B
    C
    D
    | ____Total | XX |  --> XX shows total calculation for column D
    If this is not possible, how to trick it ? Thank you
    null

    Hi,
    Even i had the same requirement once, but as this is not possible i.e displaying the total as the footeer of the table.
    the other option for this is to hav a seperate table below the main table & then displaying the total in that table.
    You can collect the value of each cell of column D in an integer variable at the time of displaying the data in the table.
    A | B | C | D |
    1
    2
    3
    for(int i = 0;i<node.lenght();i++)
    int tot = wdcontext.element
    now at the end you can create the element of the node & assign this variable "tot" to that element, then add teh element to the node
    Hope it helps you.
    Regards
    Jeet

  • How to Total(Sum) of HH:MM (Varchar2) Format in the Table Region Style of OAF

    Hi All.
    I have Requirement to Calculate the Total Duration in OAF Table Style Region.
    Check In
    Check Out
    Total Hours (HH:MM)
    08:50:59
    15:29:56
    6:38
    07::02:18
    17:05:10
    10:02
    08:20:56
    16:28:33
    8:07
    Total
    24:47
    If i Could not Able to Sum of 6:38+10:02+8:07=24:47 Due to VArchar2 as Display.
    If i use Total (True) in Attribute it is through as sum 0.
    Please Help me to Calculate the Duration Sum in OAF Page.
    Regards
    Rama

    Your question is not clear..
    Provide CREATE tABLE and INSERT statements and expected output. Your DB version also.
    What is the data type of the column RUNTIME?
    And what does your calculation " avg((01:29:40+ 07:10:58)/14)" mean - what is the result of this?
    Please read FAQ: {message:id=9360002}

  • Displaying a total sum value in the af:table - footer

    Hello everyone,
    I have seen various threads on how to calculate a summary column based on a af:column in an af:table. I would like the value of this column to be displayed in the af:table -> footer (right undernead the af:column)
    I'm having trouble putting together the pieces. This is the last requirement I have on this page, so hopefully I won't have to start all over.
    Here this what I have:
    I have created my page. (jspx) I did not create the page with a "backing bean". I have seen in various threads that the backing bean can be used to programmatically populate the table.
    This is what I have done so far.
    For the DataModel:
    I have created my entity object, and I have a view assigned to the object. I assigned the view to my Application Module.
    For the UserInterface:
    On the layout, I dragged the instance of the view from the page definition. I created an af:table.
    My questions/train of thought are:
    I didn't create a "backing bean" when I first created my jspx page. From the various threads that I have seen, they all reference this. Can anyone explain how I can do this when the page has already been created? I'm using jdev version 10.1.3.3
    Within the backing bean, I assume this is where I would then create a method that would do the "sum" of my column.
    To display the column:
    I would then create an af:output_text and drag it to theh table footer. The binding section
    If anyone has a prior thread that I haven't found that can point me in the right direction with what I already I would really appreciate it.
    Thanks

    Kuba,
    By creating a managed bean against the page definition, you are able to access the "iterator". The iterator is an object that is based off of hte View object (which the page is build off of)... From there, you can then loop through the rows and add them together to come up with the total sum.
    You can then reference this method in the TEST.java class since it was created as a managed bean.
    I believe I got the gist of it now... Coming from an Oracle Forms perspecitive, it is actually pretty similar. Now I understand what Managed Beans are used for. Thanks again for the great example.
    Danny

  • How to get total sum of big filtered table?

    Hello
    I'm using JDeveloper 11.1.1.3.0
    I have an af:table with big data source (100 000 rows). The table have filters.
    I want to display total count of the filtered rows and total sum by the one of column of the filtered rows in the footer of the table.
    In my backing bean I can get a Map with all filter values:
    Map<String, Object> filters = ((FilterableQueryDescriptor)table.getFilterModel()).getFilterCriteria();And, in this case, I may create the method for getting sum I need on my own.
    In this method I may create SQL Query dynamically, because I have to process all filter values with different types
    It is possible, but, maybe, there is a more easy way to do it?
    Anatolii

    Hi, sanchezis
    Code example.
    In the jsp:
                    <af:column sortProperty="Sumv" sortable="true" filterable="false" align="end" width="125px"
                               headerText="#{bindings.TransactionView1.hints.Sumv.label}" id="c16">
                      <af:outputText value="#{row.Sumv}" id="qt4">
                        <af:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                      </af:outputText>
                      <f:facet name="footer">
                          <af:panelGroupLayout id="pg41" halign="right"
                                               layout="vertical">             
                        <af:outputText value="#{backing_reptransactions.tableTransactionTotalSumV}" id="ot44">
                          <af:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                        </af:outputText>
                        </af:panelGroupLayout>
                      </f:facet>
                    </af:column>In the backing bean:
        public double getTableTransactionTotalSumV() {
            DCIteratorBinding iter =
                binding.findIteratorBinding("TransactionView1Iterator");
            TransactionViewImpl vo = (TransactionViewImpl)iter.getViewObject();
            return vo.getFilteredTotalSumV();
        }In the ViewImpl (TransactionViewImpl) class.
        public double getFilteredTotalSumV() {
            double sumV = 0d;
            DBTransaction dbTransaction = getDBTransaction();
            ResultSet rs = null;
            String query = "SELECT SUM(SumV) sumvtotal FROM (" + getQuery() + ")";
            String str1 = "WHERE ROWNUM < :Bind_RangePage_High";
            String str2 = "WHERE Z_R_N > :Bind_RangePage_Low";
            int i = query.indexOf(str1);
            if (i > 0) {
                query = query.substring(0, i) + " " + query.substring(i + str1.length());
            i = query.indexOf(str2);
            if (i > 0) {
                query = query.substring(0, i) + " " + query.substring(i + str2.length());
            PreparedStatement st = dbTransaction.createPreparedStatement(query, 0);
            try {
                Object[] params = this.getWhereClauseParams();
                int index = 0;
                for (Object avalue : params) {
                    String key = (String)((Object[])avalue)[0];
                    if ((!key.equals("Bind_RangePage_High")) &&
                        (!key.equals("Bind_RangePage_Low"))) {
                        Object value = ((Object[])avalue)[1];
                        index++;
                        if (value instanceof Integer) {
                            st.setInt(index, (Integer)value);
                        } else if (value instanceof oracle.jbo.domain.Date) {
                            st.setDate(index,
                                       ((oracle.jbo.domain.Date)value).dateValue());
                        } else if (value instanceof java.sql.Date) {
                            st.setDate(index, (Date)value);
                        } else {
                            st.setString(index, (String)value);
                rs = st.executeQuery();
                if (rs.next()) {
                    sumV = rs.getDouble("sumvtotal");
            } catch (SQLException e) {
                throw new JboException(e);
            } finally {
                if (st != null) {
                    try {
                        st.close();
                    } catch (SQLException e) {
            return sumV;
        public long getFilteredTotalCount() {
            return this.getEstimatedRowCount();
        }But, you need to know that in the TransactionView in the "General" - "Tuning" I set up next values:
    "All rows",
    "As needed",
    "Fill Last Page of Rows when Paging through Rowset",
    "Passivate State(..."
    Access Mode - "Range Paging Incremental"
    Range Size - 160
    Range Paging Cache Factor - 3
    If you have other values, then your SQL request may be different, so, you will have to rewrite it.
    I talk about
    "WHERE ROWNUM < :Bind_RangePage_High",
    "WHERE Z_R_N > :Bind_RangePage_Low",
                    if ((!key.equals("Bind_RangePage_High")) &&
                        (!key.equals("Bind_RangePage_Low")))If you have other solution, please, tell me.
    Anatolii

  • Total sum of column for a af:table

    Hi all,
    I am using JDeveloper 11g with ADF BC.
    I've try to create a method in VO to iterate through all the rows to calculate sum as following:
            Row curItem = first();
            while (curItem!=null) {
                Long l = DbsDelegate.attributeAsLong(curItem.getAttribute("field1"));
                if (l != null)
                    result+= l.longValue();
                curItem = next();
            }        I found it is not a good practice. Since the cursor will jump to the last record after that. And most important, the next() method call will fire a NavigationEvent to registered RowSetListeners, by calling RowSetListener.navigated() as documented here: http://www.bisnis.com/doc/rt/oracle/jbo/server/ViewObjectImpl.html#next%28%29
    Is there any better way to iterate through a VO and calculate some summary data?
    Regards,
    Samson Fu

    Let the DB do the calculation. Implement a method in your VO which returns the 'select sum(col) from table'.
    Timo

  • Smartform total sum

    Hi All,
    I am a newer of smartform. Now I face a problem, I want to do total sum at the bottom of main table without showed at each page. But I tried many method and it is not ok.
    Plz help me.

    Hi,
    In the node where u r printing the value , u will be printing each value in the textelement.  so Before that text elelment u create a program line.
    u take a variable and assign the variable as zero .
    in the program lines u put the code as
    variable = variable + (text-value).
    ex:-itab-menge.( uwant to make sum of menge).
    var type menge.  = 0.(This u do in global def.).
    in the program lines.
    var = var + itab-menge.
    after the loop.
    var will be sum of the all .
    Assign points if useful.

  • Crosstab shows empty sums when multiple rows are involved

    Hello,
    Here are the top few lines from a crosstab report I've generated:
                   Billing Percentage          Billing Amount          Billing Tax Percentage          Billing Tax Amount     
              Billing Type     Rental     VAT     Rental     VAT     Rental     VAT     Rental     VAT
    Release Code     Booking Number                                             
    MYRELEASE                                             
         34806          50     NULL     7544810     NULL     5     NULL     377240     NULL
         34810          NULL     NULL     100000     NULL     5     NULL     5000     NULL
         34811               NULL          NULL          NULL          NULL
         34812               NULL          NULL          NULL          NULL
         34813               NULL          NULL          NULL          NULL
         34822          NULL     NULL     100000     NULL     5     NULL     5000     NULL
    Although this probably looks terrible in HTML, hopefully everyone can see that for 34806 and 34810, sums are returned correctly. However, for 34811-34813, the sums are returned as NULL.
    After looking into the database, it appears that the sums only show when there is only a single element making up the sum. For line 34811, there are 2 underlying records which should be getting summed up, but the report is showing NULL.
    I have read some suggestions including changing the default aggregation behavior to show the sum of the contributing cells - but this does not fix anything. Also, I have verified that in the EUL, the data type is "NUMBER" and the default position is "DATA POINT".
    It may be worth noting that the multiple underlying records often contain duplicate data in the amounts that are being summed up. Could this be the issue? If so, how do I get Discoverer to sum up these values despite the fact they are dupes?
    Thanks!

    Okay, how about making sure the items are non-NULL similar to what Puppethead suggests.
    It sounds like you're choosing the SUM for an item for display. Regardless if it's a SUM or DETAIL on the line row level, if there's any NULL in each of those SUM line records, it may be screwing up the total.
    So, where you choose the item name, instead put an NVL function around it (ie: NVL(item,0)).
    Russ

  • USING SUM IN INTERNAL TABLE

    plz give me a simple example for using SUM in internal table and do some calculations in the same internal table.

    HI
    CHECK WITH THIS
    Syntax
    SUM.
    Effect
    The statement SUM can only be specified within a loop starting with LOOP, and is only considered within a AT- ENDAT control structure. Prerequisites for using the statement SUM include using the addition INTO in the LOOP statement, and that the specified work area wa is compatible with the row type of the internal table. In addition, SUM cannot be used when the row type of the internal table itab contains components that are tables.
    The statement SUM calculates the component total with the numeric data type (i, p, f) of all rows in the current control level and assigns these to the components of the work area wa. In the control levels FIRST, LAST, and outside of an AT-ENDAT control structure, the system calculates the sum of numeric components of all rows in the internal table.
    Example
    Control level processing for creating a list. At the end of line groups, the total of reserved places is calculated and issued.
    DATA: sflight_tab TYPE SORTED TABLE OF sflight
                      WITH UNIQUE KEY carrid connid fldate,
          sflight_wa  LIKE LINE OF sflight_tab.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab.
    LOOP AT sflight_tab INTO sflight_wa.
      AT NEW connid.
        WRITE: / sflight_wa-carrid,
                 sflight_wa-connid.
        ULINE.
      ENDAT.
      WRITE: / sflight_wa-fldate,
               sflight_wa-seatsocc.
      AT END OF connid.
        SUM.
        ULINE.
        WRITE: / 'Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        SKIP.
      ENDAT.
      AT END OF carrid.
        SUM.
        ULINE.
        WRITE: / 'Carrier Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        NEW-PAGE.
      ENDAT.
      AT LAST.
        SUM.
        WRITE: / 'Overall Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
      ENDAT.
    ENDLOOP.
    Hope this solves ur problem....
    <b>do reward if useful....</b>
    regards
    dinesh

  • Do not show total price of po in pdf print out

    Dear expert,
    i am going to make a print out of po but in po it shows item wise value, but not show total price at the end of item,this problem is
    particularly for this po only. please help to solve this issue

    Please check in table EKPO against fields NETWR, BRTWR - if the net value or gross value in this certain PO are populating or not.
    Regards,
    Ahmad Farhan Khalid

  • Query that show total discount on A/R Invoice

    Dear all,
    I would like to have query that show summary of each invoice number that show 'Total of discount'  ( 'Total of discount' = total of discount in line item + discount of total invoice ). Data that I would like to show on this query is as follow :
    Invoice No, Invoice Date, Customer Code, Total before discount, 'Total of discount',  Total Amount, Vat amount
    Please kindly suggest the way to get this data.
    Thanks you in advanced.
    Angnam

    Hi Angnam K,
    Try This one...hope this will serve your purpose.
    SELECT  DocEntry, DocNum,   CardCode, CardName, DocDate, [Total Before Discount] , [Totaldiscount]+  [OinvDiscount] as [Total of discount], VatSum [Total Tax]      FROM (
    SELECT T0.DocEntry,T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], SUM(T1.[LineTotal])[Total Before Discount],
    SUM(T1.[PriceBefDi] * T1.Quantity *T1.[DiscPrcnt])/100 as [Totaldiscount]
    ,Case When T0.[DiscPrcnt] <> 0 Then  (SUM(T1.[LineTotal])/ T0.[DiscPrcnt]) Else 0 end [OinvDiscount] ,T0.VatSum
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    Group By T0.DocEntry,T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[DiscSum] ,T0.[DiscPrcnt],T0.VatSum )Sales
    thanks,
    Kumar
    Edited by: itskumaramit on Jul 13, 2011 12:43 PM

  • Show zeroes in a control table (Module Pool)

    Hi all.
    I need showing zeroes in a control table.
    I declared fields type char in the control table (and in the internal table) and it shows zeroes, but I need declare it type QUAN (control table and internal table).
    With all types (except CHAR) I couldn't show de zeroes there.
    If anybody can help me, I Will be grateful!

    Hi,
    In your PBO, inside LOOP ENDLOOP, have a module for screen modifications and for the last row that has totals, you set screen-invisible = 1 inside LOOP AT SCREEN. ENDLOOP.
    For example,
    If your screen has following PBO Logic,
      MODULE ...
      MODULE ...
      LOOP ...
    ****New module here for screen modification if does not ****exist already.
        MODULE modify_screen.
      ENDLOOP.
    and then in MODULE modify_screen.
      MODULE modify_screen.
    ****Basically check MATNR EQ 'TOTAL' or some thing like ****that
        IF <your condition for totals line>.
          LOOP AT SCREEN.
    ****Note instead of screen-name, you can assign a screen ****group to all columns w/o totals and then use
    ****SCREEN-GROUP1 EQ <your grp> logic
            IF screen-name EQ <your column name w/o totals>.
              screen-invisible = 1.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDMODULE.
    On another note, since you are already disabling this fields in the last row, you have all the screen modification logic already I guess, so just add SCREEN-INVISIBLE = 1 for all fields w/o totals..
    Hope this helps..
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • Different value in the sum in a table of Desktop Intelligence

    Greetings, I created a report in Desktop Intelligence and I created a variable that contains the sum of the table. The table gives a value but when I put the variable in other part of the report give a total different value. When I checked the table contains some duplicate values. I used Avoid Duplicate Row Aggregation but the problem is worst. How can I remove the duplicate values in a row of table ?

    Hi  Miguel Rodriguez,
    what is the meaning of sum of table???
    i didnot  understud.
    aggregation performence is good when you make A object as measure Object in Universe level.
    if you want to like this:
    customer      product_1       product_2      product_3
        A             10                  50               60
        B             20                  60               40
        C             30                  70               20
        D             40                  80               80
    create a variable    PRODUCT
    =Sum( [product_1]  + [product_1] + [product_1])
    customer      product_1       product_2      product_3                    PRODUCT
        A             10                  50               60                   120
        B             20                  60               40                   120
        C             30                  70               20                   120
        D             40                  80               80                   200
    Next Click on Product column     File menu   -
    > Insert -
    > calculations -
    >Sum
    customer      product_1       product_2      product_3                    PRODUCT
        A             10                  50               60                   120
        B             20                  60               40                   120
        C             30                  70               20                   120
        D             40                  80               80                   200
                                                                            Sum= 560
    All the best,
    Praveen

Maybe you are looking for