Sum of values in a column in alv

i am displaying data in a hierarchical list using OO programming.
I have created a hot spot for a particular field so that i display a
popup on clicking any value in that column.
The popup displays another alv grid.
I need to sum up the values of a particular column in that a;v grid
that is displayed in the popup using OO prog.
Could anyone suggest a mthod that helps summing the column values/

Hello Rohan,
Hope you are ready with the event handler method and other supporting stuff. Only thing missing is before calling second screen you need to set DO_SUM field in field catalog table and pass that field catalog for the second alv.
Refer to SAP help [http://help.sap.com/saphelp_47x200/helpdata/en/52/5f0607e02d11d2b47d006094192fe3/frameset.htm] for more details.
Thanks,
Augustin.

Similar Messages

  • Dynamically assign value to a column in ALV LIST Display

    Hi all,
    How can I dynamically assign value to a column in ALV LIST Display without using classes and methods?
    Thanks,
    Ridhima

    Hi Vikranth,
    I am displaying one ALV list say with columns A and B.
    I have value in A but not in B. Now at runtime user selects one row, clicks on push button in application toolbar, then i have to display value in column B in the already displayed list.
    I searched and came to know it can be done with oops concept. but i am not using classes and methods.
    so how can i do this?
    Thanks,
    Ridhima.

  • Display multiple values in a column in ALV

    I need to display plant order number from AFPO and PLAF table in reference to Goods Recepient(WEMPF) field.
    now in final internal table I assign AFPO--> Plant number value to PLNUM column of ALV.
    how do I add value to same column based on WEMPF common value for both table and append value to PLNUM column below value fetched from AFPO table.
    code for getting value from PLAF table.
    SELECT WEMPF PLNUM
    FROM PLAF
    INTO TABLE IST_PLAF
    FOR ALL ENTRIES IN IST_AFPO
    WHERE PLNNO = IST_AFPO-WEMPF
    AND  ......
    Point is for some WEMPF field entried their will be number of entries in AFPO and PLAF table (in PLNUM column)  so how I do displaying entries from both tables in single row??

    Hi Ankitkumar Dineshkumar Gautam,
    SAP would say: "This is a consulting issue". I would say: What's your problem? Look at some samle programs.
    Regards,
    Clemens

  • Sum of values in same column of all tables

    On the same sheet, I have multiple tables with the same column (F) titled "AMOUNT".
    I want to get the sum of all the values in that column, from every table, without having to specify each table.
    Is there a way to do this?

    It would be nice to not have to specify each table but it can't be done that way. Nonetheless, it is easy to get those sums. Type in =SUM( then click on the column letter (F in this case) of each of those tables until you have them all then add the closing parenthesis and hit return.

  • SUM of values in a column

    Dear All,
    I want to configure a FMS at a title level UDF. I wolud like to save the sum value of a column values in that title field.
    For example,
    A                    B
    1                10000
    2                10000
    3                10000
    4                10000
                      40000
    I want to reflect the 40000 value in a title level UDF through FMS.
    How can I write a query for this requirement??
    Thanks in advance...
    Regards,
    Suresh Yerra

    Dear István K#rös,
    Thanks. I have posted this question, is there any way to get the solution without doing coding. To solve this we need to use SDK.
    Thank you once again for your quick response.
    Thanks,
    Suresh Yerra

  • How to group values in a column in ALV Grid

    Hi ,
        i have got a report layout like below.
          1   4
          1   5
          1   6
          2   7
          2   8
          2   8
    now i want to group the 1st column like below
         1  4
            5
            6
         2  7
            8
            8
      How can i get this in ALV grid display.....pls help me out if any of u have got a sample code.

    Hi,
    Here is a sample program which shows how to do sorting.
    report zsudheer
           no standard page heading.
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    <b>data: sort     type slis_t_sortinfo_alv.</b>
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          matkl type mara-matkl,
          labor type mara-labor,
          brgew type mara-brgew,
          maktx type makt-maktx,
          end of imara.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-001 .
    select-options: s_matnr for imara-matnr .
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select  mara~matnr mara~matkl mara~labor mara~brgew makt~maktx
                into corresponding fields of table imara
                  from mara
                   inner join makt
                     on mara~matnr = makt~matnr
                        where mara~matnr in s_matnr
                          and makt~spras = sy-langu.
    endform.
    *  WRITE_REPORT
    form write_report.
      perform build_field_catalog.
      <b>perform build_sort.</b>
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_sort     = sort
                it_fieldcat = fieldcat
           tables
                t_outtab    = imara.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      data: fc_tmp type slis_t_fieldcat_alv with header line.
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Group'.
      fc_tmp-fieldname  = 'MATKL'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '12'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Sort Group'.
      fc_tmp-fieldname  = 'LABOR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '12'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Gross Weight'.
      fc_tmp-fieldname  = 'BRGEW'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '12'.
      fc_tmp-do_sum     = 'X'.
      fc_tmp-col_pos    = 4.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Description'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      fc_tmp-col_pos    = 5.
      append fc_tmp to fieldcat.
    endform.
    *       FORM build_sort                                                *
    form build_sort.
      data: tmp_sort type line of slis_t_sortinfo_alv.
      clear sort. refresh sort.
    <b>  clear tmp_sort.
      tmp_sort-fieldname = 'MATKL'.
      tmp_sort-tabname   = 'IALV'.
      tmp_sort-up        = 'X'.
      append tmp_sort to sort.
      clear tmp_sort.
      tmp_sort-fieldname = 'LABOR'.
      tmp_sort-tabname   = 'IALV'.
      tmp_sort-up        = 'X'.
      tmp_sort-subtot    = 'X'.
      append tmp_sort to sort.</b>
    endform.
    Regards,
    Sudheer

  • Hide row values for certain column in GRR2

    Hi Experts,
    Looking for some help in report painter. I need to hide row values for certain columns in report painter. The requirement is I have 5 columns in the report, the 5 th column is the sum of col 1 to 4 and in my row i have a formula setup to sum of values for each column, what i would like to do is for column 1 thru 4 i didnt want to display the total values in row total but i wanted to dispaly value for column 5 in row total. I have been trying my best with putting formula, but couldnt succeed.
    Could somebody let me know is there an way to get this addressed.
    Thanks in advance
    Best Regards,
    gj

    How was it achieved ? Did you use sections for the columns for which rows needed to be hidden?
    I have a smiliar issue of hiding certain rows for few columns.

  • Summing Up of Dynamic Group Columns

    Hi Vertri,
    I was stuck up again in summing up values for each column...
    Please give me a hand...
    I emailed you the rtf file I'm working on.
    Thanks.

    Just send an update ,
    use as below
    <?xdoxslt:set_variable($_XDOCTX, ‘SUMCCE’, xdoxslt:round(sum(current-group()[./Level_Code_Label = 'CASH AND CASH EQUIV']/actuals_USD_amount) div 1000) + xdoxslt:round(sum(current-group()[./Level_Code_Label = 'ACCTS RECEIVABLE NET']/actuals_USD_amount) div 1000) +  xdoxslt:round(sum(current-group()[./Level_Code_Label = 'UNBILLED SERVICES']/actuals_USD_amount) div 1000))?>

  • How can I sum the values in a given column on sheet 1 i.e. A1:A50 based on the adjacent columns specific value i.e. B1:B50 = "Living Room" on sheet 2

    How can I sum the values in a given column on sheet 1 i.e. A1:A50 based on the adjacent columns specific value i.e. B1:B50 = “Dinning Room” on sheet 2
    For Example:
    SHEET 1
    A
    B
    $50
    Dinning Room
    $800
    Dinning Room
    $300
    Kitchen
    $1,000
    Master Bedroom
    $100
    Dinning Room
    SHEET 2
    Display the total SUM amount of each Project based on Sheet 1
    Project Name
    Total Cost
    Dinning Room
    $950
    Kitchen
    $300

    Would be a good idea to open iWork Formulas and Functions User Guide and search for the description of the function named SUMIF
    The Guide is available for every user thru the Help menu.
    Yvan KOENIG (VALLAURIS, France) jeudi 19 mai 2011 17:32:42
    Please :
    Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to prefix (-) sign in values column of ALV

    Hi!! every one!!!
         can u please let me know how to prefix sign to the values in values column of ALV Report... when negative values r there  its giving sign after the value so how to prefix that sign to the value. please do the needful...
    thanks in advance..
    neelam.

    us this
    FM
    call function 'CLOI_PUT_SIGN_IN_FRONT'
      changing
        value = itab-value.

  • Summing Selected Rows in Column Depending on Value in Another Column

    I'd like to sum only the values in selected rows in a given column depending on the value of another column in the same row. For example, suppose I have a table (please disregard the underscores, needed for correct alignment):
    ___A____B____C___D
    1__5___10___15___0
    2_20___25___30___1
    3_35___40___45___1
    4_50___55___60___0
    5__sum(D=1)
    In cell B5, I'd like to compute the sum of only rows in column B for which the value of the corresponding column D is 1. In this case B5 would be 65.
    How can I do this using functions? Is it possible to do it for a variable range of rows without specifying each row individually?
    Thanks,
    Dave

    You should place your formula to other collumn then calculated ones or in another table. You will be able to calculate whole collumns with: =SUMIF(D;“=1”;B)
    Formula for your example is: =SUMIF(D1:D4;“=1”;B1:B4)
    VB

  • WDA ALV - value grouping after column sort

    Hi,
    We are using the WDA ALV component in our application. Whem making use of the standard 'sort' functionality by pressing on a column header, all identical values of that
    column are grouped into a single group entry.
    As we still need to access every single cell of that column, I am looking for a way to
    suppress this value grouping after sort. I did not find any methods in the ALV model to do so. Any ideas on how to suppress this?
    Thanks for your help!
    Robert

    Hi Robert,
    You can call the method set_grouping_allowed in the interface if_wd_salv_sort.
    data lo_interfacecontroller type ref to iwci_salv_wd_table .
    data lo_value type ref to cl_salv_wd_config_table.
    data lo_field type ref to cl_salv_wd_field.
    lo_interfacecontroller =   wd_this->wd_cpifc_alv_comp( ).
    lo_value = lo_interfacecontroller->get_model( ).
    lo_field = lo_value->if_salv_wd_field_settings~get_field( fieldname = 'CURRENCY' ).
    lo_field->if_salv_wd_sort~set_grouping_allowed( value  = ABAP_false.).
    Regards,
    Neha
    <i><b>PS:Reward if helpful</b></i>

  • DAX: Sum unique values across columns

    Hello,
    How do I sum unique values of "Yes" across my columns in DAX?
    It should look like this with [Total Yes] being my calculated column:
    Name
    January
    February
    March
    Total Yes
    Bob
    Yes
    Yes
    No
    2
    Jim
    No
    Yes
    No
    1
    Mark
    No
    No
    Yes
    1
    Thanks!
    ~UG

    Simply this
    =IF([January]="Yes",1,0)+IF([February]="Yes",1,0)+IF([March]="Yes",1,0)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to calculate the sum of the values of some columns of a table

    hi
    i want to get in the column averages just the average of the values of some columns not all the columns of the table.what i have to change exactly in this block diagram.even if the size of the table is 25,i want the division to be the number of values in each column(= number of rows)
    just like that:
    Solved!
    Go to Solution.
    Attachments:
    operations on some columns.vi ‏10 KB

    i did exactely what u told me, i think i missed something because i don't get the average value of the rows i want
    Attachments:
    average.vi ‏11 KB

  • Find duplication values from multiple columns in a big table

    Hi All,
    I am working on a 11gR2 database in linux. i want to display record that have duplicate values in 2 columns.
    1. Table Structure :-
    CREATE TABLE A
    ID NUMBER(10),
    F_NAME VARCHAR2(100 BYTE),
    L_NAME VARCHAR2(100 BYTE)
    2. Sample Data:-
    Insert into A
    (ID, F_NAME, L_NAME) Values (1,'TONY' ,'SUMIT');
    Insert into A
    (ID, F_NAME, L_NAME) Values (2,'SUMIT' ,'KEITH');
    Insert into A
    (ID, F_NAME, L_NAME) Values (3,'NORA','SMITH');
    Insert into A
    (ID, F_NAME, L_NAME) Values (4,'APRIL','TONY');
    Insert into A
    (ID, F_NAME, L_NAME) Values (5,'ROSS','TAM');
    ID F_NAME L_NAME
    1 TONY SUMIT
    2 SUMIT KEITH
    3 NORA SMITH
    4 APRIL TONY
    5 ROSS TAM
    4. My requirement is i need display IDs that it's F_NAME or L_NAME has duplication in F_NAME or L_NAME columns.
    The result should be
    ID
    1 reason: F_NAME (TONY) equals to L_NAME of record 4, L_NAME (SUMIT) equals to F_NAME of record 2
    2 reason: F_NAME (SUMIT) equals to L_NAME of record 1
    4 reason: L_NAME (TONY) equals to F_NAME of record 1
    record 3, 5 aren't in the result because there is no duplication in F_NAME or L_NAME columns for NORA,SMITH, ROSS, TAM
    The table contains 10 million records, i really need to consider the performance.
    kindly suggest me the solution

    Note: Forum members please suggest better approach to this -- below.. convert into SQL :)
    I know I will be opposed by many people in this forum for posting such in-efficient solution.
    But trying to learn along with you.. its an interesting problem which must deal with all rows vs all rows to get all combinations.
    But I am still thinking how to write it in SQL, probably will learn from this post after we receive some good SQL solution for the code what I am currently doing now.
    step 1: created a table B similar to table A and added a column reason
    CREATE TABLE B
      ID      NUMBER(10),
      F_NAME  VARCHAR2(100 BYTE),
      L_NAME  VARCHAR2(100 BYTE),
      REASON  VARCHAR2(1000 BYTE)  --- ADDED THIS
    )Definetely inefficient :(
    BEGIN
       FOR rec_outer IN (SELECT * FROM A) LOOP
          FOR rec_inner IN (SELECT * FROM A) LOOP
             IF (rec_outer.f_name = rec_inner.l_name) THEN
                UPDATE B
                   SET reason =
                             rec_outer.id
                          || ' reason: F_NAME ('
                          || rec_outer.f_name
                          || ') equals to L_NAME of record '
                          || rec_inner.id
                 WHERE b.id = rec_outer.id;
             END IF;
          END LOOP;
          FOR rec_inner IN (SELECT * FROM A) LOOP
             IF (rec_outer.l_name = rec_inner.f_name) THEN
                UPDATE B
                   SET reason =
                          reason
                          || CASE
                                WHEN reason IS NULL THEN
                                   rec_outer.id || ' reason: '
                                ELSE
                             END
                          || 'L_NAME ('
                          || rec_inner.f_name
                          || ') equals to F_NAME of record '
                          || rec_inner.id
                 WHERE b.id = rec_outer.id;
             END IF;
          END LOOP;
       END LOOP;
       COMMIT;
    EXCEPTION
       WHEN OTHERS THEN
          rollback;
          RAISE;
    END;OUTPUT:
    ID     F_NAME     L_NAME     REASON
    1     TONY     SUMIT     1 reason: F_NAME (TONY) equals to L_NAME of record 4,L_NAME (SUMIT) equals to F_NAME of record 2
    2     SUMIT     KEITH     2 reason: F_NAME (SUMIT) equals to L_NAME of record 1
    3     NORA     SMITH     
    4     APRIL     TONY     4 reason: L_NAME (TONY) equals to F_NAME of record 1
    5     ROSS     TAM     Cheers,
    Manik.
    Edited : Added rollback

Maybe you are looking for

  • PS Elements versus Lightroom

    Any opinions from those who upgraded from PSE to Lightroom? I use PSE 5 but am able to do most of my adjustments using the Adobe RAW Converter in PSE 5. How does Lightroom compare to the PSE Organizer and PSE ability to make RAW adjustments? I am a s

  • How can I turn off location tracking by Apple?

    How can I turn off location tracking by Apple? Is is possible to roll the software back prior to Apple installing location tracking? I am very unhappy with this change by Apple. I know they probably included a reference to it in one of the user agree

  • Combains 2 facts (witth two separate dimensions)

    Hello, my question is- how two combain two facts, when each of them has it's own dimension? I've got F1-D1 and F2-D2, i need to combain them by D1-D2, which contains same information- five letters code F1, F2, D1 and D2 are in the same subject area.

  • Printer shuts down immediately after I switch it on...

    Please help, I've only had my printer around 4 months and the last couple of days when I've gone to use it it turns on, takes me to the home screen but then immediatley shuts down so I cant do anything on it Tried unplugging, checking cables etc but

  • Help in istallation of ACS 4.0 on windows server

    plz let me know how to istall acs server on windows server ,