ALV Sum N columns how to?

Hi all,
I'm doing a report on ABAP for a timesheet of the current month. The output i want is similar to this:
Year      Month     Type         Item       #days  tue-1      wed-2    thu-3 ...
2009     September  Project    Project1      3        1        1          1
2009     September  Project    Projec2       5        1        1          0
2009     September  Task       Task1         1        0        1          0
The field #days is a sum of all the days columns for september next right to the #days column.
I can have an SQL wich can extract all the data to fill year,month,type,item and #days. But then, i need to flat these #days in the correct days column. I think i can do it with 2 sqls, but then i need to join these data to display it right.
Finally, present that data in an ALV.
I have a structure defined in ABAP dictionary with all the static fields. The columns representing the days (sat-1,sun-2,...) are not in the structure.
I've tried to define a new structure wich include the old one and define the remaining columns, but i can't show the fields defined in this extra structure, only the static fields defined in ABAP dictionary.
This is probably simple, but i'm just starting in ABAP, and this seems odd and confusing right now.
What's your advice to solve this problem?

Hi vasanth,
I'm trying to define my ALV from 2 structures.
The YTS_REPORT_PROJ has year,month,type_item,item and #days
The YTS_WEEK_DESC is a static structure with an interval of weekdays such as : saturday1,sunday1,monday1,...,saturday2,sunday2,... until i get the 31 days possibles to show for a month.
I'm declaring this way:
  DATA: BEGIN OF IT_ALV_YTMSHT.
          INCLUDE STRUCTURE YTS_REPORT_PROJ.
          INCLUDE STRUCTURE YTS_WEEK_DESC.
  DATA: END OF IT_ALV_YTMSHT.
For field catalogs i call this subrutine:
*      Form  get_LayoutTable - Set Up Columns/Headers
FORM GET_LAYOUTTABLE.
  DATA: LS_FCAT TYPE LVC_S_FCAT.
  REFRESH: FIELDCAT.  CLEAR: LS_FCAT.
  LS_FCAT-REPTEXT    = 'Year'.
  LS_FCAT-FIELDNAME  = 'YEAR_ITEM'.
  LS_FCAT-REF_TABLE  = 'IT_YTMSHEET'.
  LS_FCAT-OUTPUTLEN  = '4'.
  LS_FCAT-FIX_COLUMN = 'X'.
  LS_FCAT-COL_POS    = '1'.
  APPEND LS_FCAT TO FIELDCAT.  CLEAR: LS_FCAT.
  LS_FCAT-REPTEXT    = 'Month'.
  LS_FCAT-FIELDNAME  = 'MONTH_ITEM'.
  LS_FCAT-REF_TABLE  = 'IT_YTMSHEET'.
  LS_FCAT-OUTPUTLEN  = '6'.
  LS_FCAT-FIX_COLUMN = 'X'.
  LS_FCAT-COL_POS    = '2'.
  APPEND LS_FCAT TO FIELDCAT.  CLEAR: LS_FCAT.
  LS_FCAT-REPTEXT    = 'Type_of_item'.
  LS_FCAT-COLTEXT    = 'Type of item'.
  LS_FCAT-FIELDNAME  = 'TYPE_ITEM'.
  LS_FCAT-REF_TABLE  = 'IT_YTMSHEET'.
  LS_FCAT-FIX_COLUMN = 'X'.
  LS_FCAT-OUTPUTLEN  = '12'.
  LS_FCAT-COL_POS    = '4'.
  APPEND LS_FCAT TO FIELDCAT.  CLEAR: LS_FCAT.
  LS_FCAT-REPTEXT    = 'Item'.
  LS_FCAT-FIELDNAME  = 'ITEM'.
  LS_FCAT-REF_TABLE  = 'IT_YTMSHEET'.
  LS_FCAT-FIX_COLUMN = 'X'.
  LS_FCAT-OUTPUTLEN  = '20'.
  LS_FCAT-COL_POS    = '5'.
  APPEND LS_FCAT TO FIELDCAT.
  CLEAR: LS_FCAT.
  LS_FCAT-REPTEXT    = 'Number_of_days'.
  LS_FCAT-COLTEXT    = 'Days number'.
  LS_FCAT-FIELDNAME  = 'DAYS_ITEM'.
  LS_FCAT-REF_TABLE  = 'IT_YTMSHEET'.
*  LS_FCAT-FIX_COLUMN = 'X'.
  LS_FCAT-OUTPUTLEN  = '11'.
  LS_FCAT-TOOLTIP    = '#Days=Hours/8'.
  LS_FCAT-COL_POS    = '6'.
  APPEND LS_FCAT TO FIELDCAT.
DO 30 TIMES.
    CLEAR: LS_FCAT.
    LS_FCAT-REPTEXT    = 'day of week'.
    LS_FCAT-COLTEXT    = 'Day of week'.
    LS_FCAT-FIELDNAME    = ' '.             ----------> HOW CAN I REFERENCE HERE "SUNDAY1,SATURDAY1,..."?
    LS_FCAT-REF_TABLE  = 'IT_ALV_YTMSHT'.
*  LS_FCAT-FIX_COLUMN = 'X'.
    LS_FCAT-OUTPUTLEN  = '11'.
    APPEND LS_FCAT TO FIELDCAT.
As you can see, at the end of the routine i try to create 30 more columns, and those columns actually appear, but i don't know how to fill the data of those columns.
To construct the ALV i'm using
DATA: VARIAVEL LIKE IT_ALV_YTMSHT OCCURS 0 WITH HEADER LINE.
*IT_YTMSHEET[] has the first part that i want to show (year,month,type,item and #days.
  VARIAVEL[] = IT_YTMSHEET[].
  CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
      IS_LAYOUT = GD_LAYOUT
      I_SAVE = 'A'
    CHANGING
      IT_FIELDCATALOG  = FIELDCAT[]
      IT_OUTTAB        = VARIAVEL[].

Similar Messages

  • Row with sum of column- how to?

    Hallo,
    i have a jspx-site with a table.
    one of the columns help prices. about these column i want to show a row with the sum of the column. how can i do that.
    any help is appreciated.

    Hi,
    See:
    Displaying a total sum value in the af:table -> footer
    Kuba

  • ALV sum various columns problem

    Hi all,
    I'm doing a report on ABAP for a timesheet of the current month. The output i want is similar to this:
    Year      Month     Type         Item       #days  tue-1      wed-2    thu-3 ...
    2009     September  Project    Project1      3        1        1          1
    2009     September  Project    Projec2       5        1        1          0
    2009     September  Task       Task1         1        0        1          0
    The field #days is a sum of all the days columns for september next right to the #days column.
    I can have an SQL wich can extract all the data to fill year,month,type,item and #days. But then, i need to flat these #days in the correct days column. I think i can do it with 2 sqls, but then i need to join these data to display it right.
    Finally, present that data in an ALV.
    I have a structure defined in ABAP dictionary with all the static fields. The columns representing the days (sat-1,sun-2,...) are not in the structure.
    I've tried to define a new structure wich include the old one and define the remaining columns, but i can't show the fields defined in this extra structure, only the static fields defined in ABAP dictionary.
    This is probably simple, but i'm just starting in ABAP, and this seems odd and confusing right now.
    What's your advice to solve this problem?

    Hi,
    The question is not very clear but, u can try this.
    while populating the field catalog try using
    set_column_name,
    set_short_text,
    set_medium_text,
    set_long_text for the extra fileds added.
    if possible make it clear what exactly r u using asin, the reuse alv's or oo alv's or object alv's.

  • How to sum the column in a table seperated by sign.

    How to sum the column in a table separate by sign.
    For Example:
    A B
    10 MOHAN
    -15 KUMAR
    -25 MARCH
    50 MAY

    SELECT  SUM(CASE SIGN(A) WHEN 1 THEN A ELSE NULL END) SUM_POSTIIVE,
            SUM(CASE SIGN(A) WHEN -1 THEN A ELSE NULL END) SUM_NEGATIIVE
      FROM  tbl
    /SY.

  • How to Suppress Report Total When Using Sum on Columns & Break Formatting

    I need to know how to NOT show the report total line when using the sum functionality with a break in a report.
    I am summing two columns, a debit amount and credit amount. I am breaking on the first column which is the level of a hierarchical query. I want to see something like this:
    Parent Record xxxxxxxxxxxxxx
    Parent Sum $$ $$
    Child Record xxxxxxxxxxxxxx
    Child Record xxxxxxxxxxxxxx
    Child Sum $$ $$
    However, when I run the report, I also get a report total line under the child sum which is really meaningless for this report.
    I have also tried creating this report as an interactive report. When applying the sum on the two columns, I do get the sum totals on the break only - no report total - however, it is reversing the order of the hierarchical query results putting the child records first and the parent records second.
    Thanks in advance for your help.

    Hi, and welcome!
    I don't think that there's an easy way to "switch off" the Total line on a report. The nearest I could suggest would be to either hide the entire row or colour the text so that it's the same as the background - either way, the total is calculated but the user won't see it.
    If you put something like the following into your report region's Region Footer:
    <script type="text/javascript">
    var outertable = document.getElementById("#REGION_ID#");
    var innertable = outertable.getElementsByTagName("TABLE")[1];
    var rs = innertable.rows;
    var lastrow = rs[rs.length-1];
    if (lastrow.cells[0].innerHTML == '<b>TOTAL</b>')
    rs[rs.length - 1].style.display = "none";
    </script>Then, on your report's Report Attributes page, scroll down to the Break Formatting section and put TOTAL into the "Display this text when printing report sums" setting. Also, in the "Layout and Pagination" section, set "Enable Partial Page Refresh" to No.
    The above code is based on the report and region templates that I'm using here: [http://apex.oracle.com/pls/otn/f?p=267:147] (Theme 18, "Report Region" region template and "Standard" report template). Your report may use different templates, so the first two lines on the code may have to change. #REGION_ID# would be replaced with the region's ID value (which would be "R" followed by a long number). As long as you can identify the HTML tag that uses this ID value, you can then get to the actual table that contains the data as it would be a TABLE within that tag - the [1] above is the second table within the region. In some instances, you may have to use "region_#REGION_ID#" as the starting point.
    Andy

  • How to sum a column in SQL server??

    How do I sum a column called 'expenditureamount' in a sql table 'expenditureform', such that I get the total expenditure amount displayed in a text box??

    You can sum it with the SQL SUM function, of course, but what that has to do with how your program display that sum, I don't know. IOW, how you display is not anything related to JDBC, and how you SUM it is not anything related to JDBC. The first one is SQL (check on an SQL forum or Google for it) and the second depends on how you want to display it, and there are more appropriate forums than the JDBC one, for that.

  • Sum 2 columns in alv report (not separately)

    Hi,
    I have an alv report and I use do_sum = 'X' in order to sum separately 2
    columns.
    The demand here is that at the end of the report there will also be
    a total of the 2 columns together.
    I tried to implement it but so far - no success.
    Mayby someone has an idea ??
    Promise to award points...
    Thanks.
    Ruthie.

    Hi,
    For summing say column EBELN, MATNR for eg.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
       fieldcatalog-outputlen   = 10.
      <b>fieldcatalog-do_sum      = 'X'.</b>
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      <b>fieldcatalog-do_sum      = 'X'.</b>
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    You will get the sum at the end also, try this.

  • How do I dynamicaly sum a column in Pages without specifiying start/end?

    How do I dynamicaly sum a column without specifiying a start/end range?
    I want to add a new row anytime and have that sum total reflect the new row value.

    The best answer will depend upon knowing what file format.  Audacity app is a popular answer but if you are dealing with a lossy format such as AAC/.m4a or .mp3 you are better off using using editing tools for those (MPEGStreamclip and MP3Trimmer respectively).

  • How to sum a column value using CAML Query?

    Hi All,
    I would like to sum the column value using CAML qeury. Actually in my list, I have two column "Projects Name" and "Number of Issues". Now need to get sum of "Number of Issues" column. How to achieve in CAML Query.
    Thanks in advance!

    Hi Sam,
    it looks like you can use your current view based agregation, otherwise it is not possible(
    http://msdn.microsoft.com/en-us/library/ms467521.aspx) and you need to work on custom bit on this requirement.
    use the below link and create a view element as described and see if that works for you
    Aggregations Element
    http://msdn.microsoft.com/en-us/library/ms468626%28v=office.12%29.aspx
    Another reference
    Query Element
    http://msdn.microsoft.com/en-us/library/ms471093.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • How to sum subgrid column in CRM 2013

    Hi,
    I want to sum Subgrid column named "Quantity" and show in alert.

    Hi,
    You can also try this code to calculate subgrid amount total for crm 2013.
    Add your subgrid name in place of "testing"  and amount field name in place of 'new_amount'.
    function RetrieveSubGridRecords() {
        if (document.getElementById("testing")) {
            var grid = document.getElementById("testing").control;
            var ids = grid.get_allRecordIds();
            var sum = 0.00;
            var cellValue;
           for(i = 0; i < ids.length; i++) {
               var cellValue = grid.getCellValue('new_amount',ids[i]);
               var number = Number(cellValue.replace(/[^0-9\.]+/g,""));
               sum = sum + number;
           alert('s'+sum);
        else {
           setTimeout("RetrieveSubGridRecords();", 2500);
    Hope this help..
    Thanks

  • How Format Text in ALV Colum when Column set as TEXTVIEW

    I am displaying ALV with Multiple Column's , One of the Column is TEXTVIEW .
    When ALV is Displayed TEXT Column Comes as Continues TEXT  and is Not Formatted .
    Now when i want to edit this text i am Calling another View which contains UI element Formated textview  . This Formated textview  will display correct Formatted Text . but when i save it and Come back to ALV again i do see continues text .
    I use the cl_salv_wd_uie_text_view to set the ALV Column as text view.
    Is there any way where in i can display the Formatted text in ALV Column ?
    Thanks in Advance
    Badarinarayan patil

    Hi ,
    You cannot use the Formatted TextView as a celleditor in table or ALV , its not provided by SAP .
    Regards
    Yash

  • In Alv table, a column is editable mode, but want few cells in read only

    Hi All,
    I have a ALV table which column A and B.
    Both are in editable mode. I want to make fews in column B, to be read only.
    How to make it. Please help me.
    Thanks
    Vimalraj

    hi,
    refer this program,
    *& Report  ZALV_COLOR_DISPLAY_EDIT
    REPORT  zalv_color_display_edit.
    TYPE-POOLS: slis.
    TABLES : zcust_master2.
    INTERNAL TABLE DECLARATION
    TYPES : BEGIN OF wi_zcust_master2,
            zcustid LIKE zcust_master2-zcustid,
            zcustname LIKE zcust_master2-zcustname,
            zaddr LIKE zcust_master2-zaddr,
            zcity LIKE zcust_master2-zcity,
            zstate LIKE zcust_master2-zstate,
            zcountry LIKE zcust_master2-zcountry,
            zphone LIKE zcust_master2-zphone,
            zemail LIKE zcust_master2-zemail,
            zfax LIKE zcust_master2-zfax,
            zstat LIKE zcust_master2-zstat,
            field_style  TYPE lvc_t_styl,
    END OF wi_zcust_master2.
    DATA: it_wi_zcust_master2 TYPE STANDARD TABLE OF wi_zcust_master2
                                                     INITIAL SIZE 0,
          wa_zcust_master2 TYPE wi_zcust_master2.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER
    line,
          wa_fieldcat TYPE lvc_s_fcat,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
          gd_repid     LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM set_specific_field_attributes.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      wa_fieldcat-fieldname   = 'ZCUSTID'.
      wa_fieldcat-scrtext_m   = 'CUSTOMER ID'.
      wa_fieldcat-col_pos     = 0.
      wa_fieldcat-outputlen   = 10.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCUSTNAME'.
      wa_fieldcat-scrtext_m   = 'CUSTOMER NAME'.
      wa_fieldcat-col_pos     = 1.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZADDR'.
      wa_fieldcat-scrtext_m   = 'ADDRESS'.
      wa_fieldcat-col_pos     = 2.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCITY'.
      wa_fieldcat-scrtext_m   = 'CITY'.
      wa_fieldcat-col_pos     = 3.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZSTATE'.
      wa_fieldcat-scrtext_m   = 'STATE'.
      wa_fieldcat-col_pos     = 4.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCOUNTRY'.
      wa_fieldcat-scrtext_m   = 'COUNTRY'.
      wa_fieldcat-col_pos     = 5.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZPHONE'.
      wa_fieldcat-scrtext_m   = 'PHONE NUMBER'.
      wa_fieldcat-col_pos     = 6.
    wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZEMAIL'.
      wa_fieldcat-scrtext_m   = 'EMAIL'.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      wa_fieldcat-col_pos     = 7.
      wa_fieldcat-outputlen   = 15.
      wa_fieldcat-datatype     = 'CURR'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZFAX'.
      wa_fieldcat-scrtext_m   = 'FAX'.
      wa_fieldcat-col_pos     = 8.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZSTAT'.
      wa_fieldcat-scrtext_m   = 'STATUS'.
      wa_fieldcat-col_pos     = 9.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
    Set layout field for field attributes(i.e. input/output)
      gd_layout-stylefname = 'FIELD_STYLE'.
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_callback_program = gd_repid
          is_layout_lvc      = gd_layout
          it_fieldcat_lvc    = it_fieldcat
          i_save             = 'X'
        TABLES
          t_outtab           = it_wi_zcust_master2
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          text
    -->  p1        text
    <--  p2        text
    FORM data_retrieval .
      DATA: ld_color(1) TYPE c.
      SELECT zcustid zcustname zaddr zcity zstate zcountry zphone zemail
    zfax zstat UP TO 10 ROWS FROM zcust_master2 INTO CORRESPONDING FIELDS OF
    TABLE it_wi_zcust_master2.
    ENDFORM.                    "data_retrieval
    *&      Form  set_specific_field_attributes
          populate FIELD_STYLE table with specific field attributes
    FORM set_specific_field_attributes .
      DATA ls_stylerow TYPE lvc_s_styl .
      DATA lt_styletab TYPE lvc_t_styl .
    Populate style variable (FIELD_STYLE) with style properties
    The following code sets it to be disabled(display only) if 'ZFAX'
    is NOT INITIAL.
      LOOP AT it_wi_zcust_master2 INTO  wa_zcust_master2.
        IF  wa_zcust_master2-zfax IS NOT INITIAL.
          ls_stylerow-fieldname = 'ZFAX' .
          ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                          "set field to disabled
          APPEND ls_stylerow  TO  wa_zcust_master2-field_style.
          MODIFY it_wi_zcust_master2  FROM  wa_zcust_master2.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "set_specific_field_attributes
    Regards,
    K.Tharani.

  • Sum of columns in union query

    hi, i am using oracle 10g database..
    how to get the sum of column in union query ?
         select * from (select 100 records from dual), (select 50 available from dual)
    union
    select * from (select 200 records from dual), (select 150 available from dual)
    display should be like
                     records         available
                      100               50
                      200               150
    total            300               200thanks ...

    Peter vd Zwan wrote:
    try this:Grouping by records will not produce correct results:
    SQL> with a as
      2  (
      3  select * from (select 100 records from dual), (select 50 available from dual)
      4  union
      5  select * from (select 100 records from dual), (select 100 available from dual)
      6  union
      7  select * from (select 200 records from dual), (select 150 available from dual)
      8  )
      9  select
    10    case when grouping(records) = 0 then null else 'total' end tot
    11    ,sum(records)   records
    12    ,sum(available) available
    13  from
    14    a
    15  group by
    16  rollup (records)
    17  ;
    TOT      RECORDS  AVAILABLE
                 200        150
                 200        150
    total        400        300
    SQL> select  case grouping(rownum)
      2     when 1 then 'Total'
      3   end display,
      4          sum(records) records,
      5          sum(available) available
      6    from  (
      7            select * from (select 100 records from dual), (select 50 available from dual)
      8           union
      9            select * from (select 100 records from dual), (select 100 available from dual)
    10           union
    11            select * from (select 200 records from dual), (select 150 available from dual)
    12          )
    13    group by rollup(rownum)
    14  /
    DISPL    RECORDS  AVAILABLE
                 100         50
                 100        100
                 200        150
    Total        400        300
    SQL> SY.

  • Can you sum a column in FormsCentral?

    Similar to how you would sum a column of numbers in a Excel spreadsheet, Can you sum a column in FormsCentral or are you required to only do this once it has been saved to an Excel sheet?
    Regards
    kevin

    One of my biggest grievances with Forms Central is the lack of any kind of calculating (living in hope Adobe!)... you will have to do it in Excel.

  • Sum datagrid column values

    I am looking for a way (action script code?) to sum datagrid
    column values.
    I am using Flex2 with Cold Fusion MX7.
    I populate a DataGrid by setting dataprovider to the result
    of a Coldfusion query.
    (this.masterList.dataProvider = event.result as
    ArrayCollection;)
    This all works fine.
    The masterList datagrid has debit, credit, and unitcost
    columns. I want to sum those columns individually, and display the
    results in text boxes in another panel.
    I could run a Coldfusion query to return the sums, but would
    like to do it on the client side with action script.
    I want to sum them everytime I update the datagrid, so need
    action code that I can put in the result function.
    I am new to ActionScript, and not sure how to loop through
    the array collection(and/or) dataprovider and sum the items.
    Any help would be appreciated.
    Thanks.

    Loop through your array..if the arrayCollection was named
    myArray;
    private sumFunction():Number{
    var sum:Number=0;
    for(var i:uint=0;i<myArray.lenght;i++){
    sum+=myArray
    .debitValue;
    return sum;

Maybe you are looking for