WD4A ALV column aggregation

Hi
I would like to specify specific columns of my WD4A ALV to be aggregated and to display sub-totals per sort-level.
Can someone tell me which steps I need to make to get this done.
Or is there an example application from which I can copy this functionality?
Regards
Wouter Heuvelmans
Pyramid Applied Solutions

Hi,
You can refer the following link:
Sub Totals in ALV
Best regards,
Suresh

Similar Messages

  • Web dynpro for abap how to create a customize search help in alv column

       hi:
          Web dynpro for abap how to create a customize search help in alv column and put search help value into alv column?
          Are there specific examples ?
          thanks!!

    HI:
       I want to created a freely programed help which include date&time,and put help value to alv column.
      I have created a freely programed help in web dynpro for abpa application,I refer:
      **************** - WebDynpro for ABAP
      but have a problem!
       If you focus on the the input field in the first row, you get the value help
    However if  I go to the second row and focus on the same input field in this column, I don't get the value help:
    What is a good way to solve similar problems?
    thanks

  • Problem while exporting ALV column header to excel sheet.

    Hi,
    I am able to export an ALV grid details to an excel sheet. But the ALV column headers when exported to excel sheet are getting truncated.
    For eg: if my column header in ALV grid is displayed as 'Material' then the column header in excel sheet is 'Mater' only. Remaining portion is getting truncated.
    How can I view the entire column header text?
    Kindly assist.
    Thanks.

    I have the same problem with you, when user export to excel. I fixed it by using
    w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This
    perform generate_fcat_reftab
        using 'PRUEFLOS' 'T_INPUT' '' '' 'Inspection Lot' 0.
    form generate_fcat_reftab  using    p_fieldname
                                        p_tabname
                                        p_ref_tabname
                                        p_ref_fieldname
                                        p_output_text
                                        p_output_lenght.
      clear w_fcat.
      w_fcat-fieldname = p_fieldname.
      w_fcat-tabname   = p_tabname.
      w_fcat-ref_fieldname = p_ref_fieldname.
      w_fcat-ref_tabname = p_ref_tabname.
      w_fcat-seltext_s = p_output_text.
      w_fcat-seltext_m = p_output_text.
      w_fcat-seltext_l = p_output_text.
      w_fcat-outputlen = p_output_lenght.
      w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This
      append w_fcat to t_fcat.
    endform.

  • Show image in Web Dynpro ALV column

    Hello everybody,
    I have a WD component with an ALV table bound to a context node. Works very fine so far.
    Now in the first column of the node I have put an image source (MIME object in my WD component).
    I configured the first ALV column as Link To Action and now would like to link it to the image source. My problem is that the image is not loaded in the ALV.
    This is my coding (INIT method of my view):
    METHOD wddoinit .
      DATA: lo_alv_cmp         TYPE REF TO if_wd_component_usage,
                  lo_alv_if          TYPE REF TO iwci_salv_wd_table,
                  lo_alv_config      TYPE REF TO cl_salv_wd_config_table,
                  lo_column_settings TYPE REF TO if_salv_wd_column_settings,
                  lo_column          TYPE REF TO cl_salv_wd_column,
                  lo_link_to_action  TYPE REF TO cl_salv_wd_uie_link_to_action.
    get instance of ALV component
      lo_alv_cmp = wd_this->wd_cpuse_alv( ).
      IF lo_alv_cmp->has_active_component( ) IS INITIAL.
        lo_alv_cmp->create_component( ).
      ENDIF.
    get instance of ALV Interface Controller
      lo_alv_if = wd_this->wd_cpifc_alv( ).
    configure ALV
      lo_alv_config = lo_alv_if->get_model( ).
      lo_column_settings ?= lo_alv_config.
      lo_column = lo_column_settings->get_column( 'IMAGE' ).
      CREATE OBJECT lo_link_to_action.
    fix settings for test purpose (how must I change it to get the information from the context node??)
      lo_link_to_action->set_image_height( '50px' ).
      lo_link_to_action->set_image_width( '50px' ).
      lo_link_to_action->set_image_source( 'ICE Flottenportal.jpg' ).
      lo_column->set_cell_editor( lo_link_to_action ).
    ENDMETHOD.
    Thanx a lot in advance for any help!!

    Thanks a lot for your helpful advice.
    I now found that method cl_wdr_utilities=>get_mime_path is the best way to get the path.
    But one question is still open:
    How can I retrieve my image source from the context? Do I have to read the context and then write it to the image_source attribute? Or ist there a more elegant solution?
    Thank you for any help!

  • How to Display  Formatted Text  IN ALV Column?

    HI experts ,
    I am displaying  ALV with Multiple Column's , One of the Column is TEXT(Fomatted text).
    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 text edit . This Text edit will display correct Formatted Text . but when i save it and Come back to ALV again i do see continues text .
    Is there  any way where in i can display  the Formatted text in ALV Column ?
    Any body have any clue with this ...
    Thanks in Advance
    Patil
    Edited by: Badarinarayan Patil on Feb 22, 2008 3:45 PM

    Hi Juergen,
    I found Your blog and found it  really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
    I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
    Some suggestion will be greatly appreciated.
    Thankyou
    Simone

  • Drag And Drop in ALV Column Tree

    Hello All,
    Can anyone tell me the method used for  a drag and drop in a column tree....
    i found it for a simple tree but not for a column tree.....
    thanks in advance....
    Regards,
    Praveen

    Check the links -
    drag drop required for alv column!
    drag and drop in a tree
    Drag&Drop within the Tree
    Drag&Drop within a tree
    Drag and drop in ALV tree
    Regards,
    Amit
    Reward all helpful replies.

  • How to hide ALV column in webdynpro

    Hi frnds,
                   I want to hide one columns in ALV output on webdynpro , give the procedure ...
    Thanks & Regards,
    Rajesh.j

    Procedure is :
    a) Get ALV Model reference
    b) Get list of ALV Columns
    c) Loop at each column and set visibility
    Code would be something like this
    I'm storing ALV model reference in view attributes wd_this->alv_config_table of type ref to CL_SALV_WD_CONFIG_TABLE.
    Data: lo_cmp_usage type ref to if_wd_component_usage.
      DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_column          TYPE REF TO cl_salv_wd_column,
            lt_column type salv_wd_t_column_ref,
            ls_column type salv_wd_s_column_ref.
    *create an instance of ALV component
      lo_cmp_usage =   wd_this->wd_cpuse_OVERVIEW_EARNED_ALV( ).
    * if not initialized, then initialize
      if lo_cmp_usage->has_active_component( ) is initial.
        lo_cmp_usage->create_component( ).
      endif.
    * get ALV component
      lr_salv_wd_table = wd_this->wd_cpifc_OVERVIEW_EARNED_ALV( ).
       wd_this->alv_config_table = lr_salv_wd_table->get_model( ).
      lr_column_settings ?= wd_this->alv_config_table.
      lt_column = lr_column_settings->get_columns( ).
      loop at lt_column into ls_column.
        CASE ls_column-id.
          when 'POST_YEAR'.
            ls_column-r_column->set_visible( if_wdl_core=>visibility_none ).
       ENDCASE.
    endloop.

  • Study Material on Alv Column Tree required.

    Hello friends,
    Pls let me know the links where I can get information regarding alv column tree creation. If u have any study material regarding the same then do forward me that too.
    Waiting for ur reply,
    Sweta.

    Hello Sweta,
    http://www1.sapdesignguild.org/resources/MiniSG/3_Managing/3_Overview_Tree_Variants.htm
    http://www1.sapdesignguild.org/resources/MiniSG/3_Managing/3_Design_Layout.htm
    <b>Check this demo program:</b>
    SAPCOLUMN_TREE_CONTROL_DEMO
    <b>
    Sample code:</b>
    http://www.geocities.com/victorav15/sapr3/utilities/zvvooa3.txt
    Regards,
    Beejal
    **Reward if this helps

  • Toolbar buttons in ALV column tree

    Dear Experts,
    Currently a report is being displayed using 2 custom container and class CL_GUI_ALV_COLUMN_TREE in a single screen Screen 100.
    Funtions like Select all, Deselect All, Expand All, Colapse all are in the GUI status of this Screen 100.
    <b>Q1</b>. Is it possible to have buttons on the container itself (instead of having it in the GUI status of Scr. 100) and have the above funtions work for ALV column tree .
    <b>Q2.</b> There exists a check box in each row of the node in both the containers which is meant for comparing data between two containers.
    e.g the user Checks one row of the first container (ALV tree output) and another in 2nd container and press Compare button which is present in Scr 100 GUI status.
    When the ckeck box is selected the rows are being selected, this is done in CheckBoX Change event of CL_GUI_ALV_COLUMN_TREE. Now when the Deselect ALL button is clicked rows are getting deselected but check marks are not getting cleared from the check box.
    How can the check box be cleared when we press Deselect All button which is in GUI Status of Scr 100.?
    Thanks n Regards

    Hello Mahesh
    Assuming that you are dealing with class
    CL_GUI_ALV_TREE (because I cannot find class CL_GUI_ALV_COLUMN_TREE) sample report BCALV_TREE_04 shows how to add a button to the toolbar.
    The crucial points can be found in routine CHANGE_TOOLBAR: 
    form change_toolbar.
    * §1.Get toolbar instance of your ALV Tree.
    * When you instantiate an instance of CL_GUI_ALV_TREE the constructor
    * of the base class (CL_ALV_TREE_BASE) creates a toolbar.
    * Fetch its reference with the following method if you want to
    * modify it:
      call method g_alv_tree->get_toolbar_object
              importing
                  er_toolbar = g_toolbar.
      check not g_toolbar is initial. "could happen if you do not use the
                                      "standard toolbar
    * §2.Modify toolbar with methods of CL_GUI_TOOLBAR:
    * add seperator to toolbar
      call method g_toolbar->add_button
              exporting
                  fcode     = ''
                  icon      = ''
                  butn_type = cntb_btype_sep.
    * add Standard Button to toolbar (for Delete Subtree)
      call method g_toolbar->add_button
              exporting
                  fcode     = 'DELETE'
                  icon      = '@11@'
                  butn_type = cntb_btype_button
                  text      = ''
                  quickinfo = text-901.   "Delete subtree
    endform.
    Regards
      Uwe

  • Set Measure column "Aggregation Rule" to "sum" or other,return error

    when set a Measure column "Aggregation Rule" to "sum" or other,return error,as following:
    View Display Error
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 46008] Internal error: File server\Query\Optimizer\Request\Src\SQORRqList.cpp, line 285. (HY000)
    SQL Issued: SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, s_10, s_11, s_12, s_13 FROM ( SELECT 0 s_0, "SPW_PRO"."Product"."FamilyGroupName" s_1, "SPW_PRO"."Product"."Gen4,Product" s_2, "SPW_PRO"."Product"."MajorGroupName" s_3, "SPW_PRO"."Product"."ProductName" s_4, SORTKEY("SPW_PRO"."Product"."Gen4,Product") s_5, "SPW_PRO"."SPWPRODB"."Sales" s_6, "SPW_PRO"."SPWPRODB"."Sales%" s_7, "SPW_PRO"."SPWPRODB"."产品运营天数" s_8, "SPW_PRO"."SPWPRODB"."售卖数量" s_9, REPORT_AGGREGATE("SPW_PRO"."SPWPRODB"."Sales" BY "SPW_PRO"."Product"."FamilyGroupName","SPW_PRO"."Product"."MajorGroupName") s_10, REPORT_AGGREGATE("SPW_PRO"."SPWPRODB"."Sales%" BY "SPW_PRO"."Product"."FamilyGroupName","SPW_PRO"."Product"."MajorGroupName") s_11, REPORT_AGGREGATE("SPW_PRO"."SPWPRODB"."产品运营天数" BY "SPW_PRO"."Product"."FamilyGroupName","SPW_PRO"."Product"."MajorGroupName") s_12, REPORT_MAX("SPW_PRO"."SPWPRODB"."售卖数量" BY "SPW_PRO"."Product"."FamilyGroupName","SPW_PRO"."Product"."MajorGroupName") s_13 FROM "SPW_PRO" WHERE (("Period"."Gen5,Period" IN (SELECT saw_1 FROM (SELECT "Period"."OperatingDaily" saw_0, "Period"."Gen5,Period" saw_1, "Year"."Gen2,Year" saw_2 FROM "SPW_PRO") nqw_1 )) AND ("Year"."Gen2,Year" IN (SELECT saw_2 FROM (SELECT "Period"."OperatingDaily" saw_0, "Period"."Gen5,Period" saw_1, "Year"."Gen2,Year" saw_2 FROM "SPW_PRO") nqw_1 ))) ) djm
    please help me . Thanks a lot.

    Thanks dnikiforov
    still get the
    select a.rmdept||a.rmstyl||a.rmcolr||a.rmsize||','||a.rmvatc||','||a.rmshgp||','||rmdesc||','||rmac
    ERROR at line 1:
    ORA-00904: invalid column name
    I think its a problem with trying to select on the unique, anyway I accidentally posted a couple of threads for this and it has now been resolved by
    select a.rmdept||a.rmstyl||a.rmcolr||a.rmsize||','||a.rmvatc||','||a.rmshgp||','||
    a.rmdesc||',||a.rmacod||','||a.rmcdes||','||a.rmzdes||','||a.rmsupp||','||a.rmsspr||','||a.rmlcos||','||
    c.rsbarc||','||a.rmpord||','||a.rmmrch||','||a.rmcomq||','||sum(b.rdcstk)
    from stkmas a, stkwar b, stkbar c
    where a.rmdept = c.rsdept(+)
    and a.rmstyl = c.rsstyl(+)
    and a.rmcolr = c.rscolr(+)
    and a.rmsize = c.rssize(+)
    and a.rmdept = b.rddept(+)
    and a.rmstyl = b.rdstyl(+)
    and a.rmcolr = b.rdcolr(+)
    and a.rmsize = b.rdsize(+)
    group by a.rmdept,a.rmstyl,a.rmcolr,a.rmsize,a.rmvatc,a.rmshgp,
    a.rmdesc,a.rmacod,a.rmcdes,a.rmzdes,a.rmsupp,a.rmsspr, a.rmlcos,
    c.rsbarc,a.rmpord,a.rmmrch,a.rmcomq
    as I dont need to use the unique because the sum does it for me
    Thanks again for speedy help

  • Subdivide a ALV column header

    Hi experts ,
    I have an requirment to divide a ALV column header.
    I want to add a header row grouping the column headers.
            Departure                                               Arrival        <-- This row is what I want to add
    Airport    Gate    Date                         Airport    Gate    Date
    Thanks,
    Regards ,
    Swashrayee
    Edited by: SWASHRAYEE77928 on Feb 1, 2012 7:30 AM
    Moderator Message: UserID sent for deletion, for ignoring multiple Moderator warnings.
    Edited by: kishan P on Feb 1, 2012 12:05 PM

    Hello,
    Take a look on this code:
      DATA:
        lv_title              TYPE        string,
        lt_columns            TYPE        salv_wd_t_column_ref,
        lr_column_settings    TYPE REF TO if_salv_wd_column_settings,
        lr_salv_wd_table      TYPE REF TO iwci_salv_wd_table,
        lr_table              TYPE REF TO cl_salv_wd_config_table,
      FIELD-SYMBOLS:
        <fs_column> LIKE LINE OF lt_columns,
      lr_salv_wd_table = wd_this->wd_cpifc_cmp_alv( ).
      lr_table         = lr_salv_wd_table->get_model( ).
      lr_column_settings ?= lr_table.
      lt_columns = lr_column_settings->get_columns( ).
      LOOP AT lt_columns ASSIGNING <fs_column>.
        lr_col_header = <fs_column>-r_column->get_header( ).
        lr_col_header->set_ddic_binding_element( space ).
        lr_col_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none ).
          lv_title = cl_wd_utilities=>get_otr_text_by_alias( alias = 'HISTORIC' ).
          lr_col_header->set_text( lv_title ).
          CLEAR lv_title.
    I suggest you to put this code in some method called over the method WDDOMODIFYVIEW.
    Regards.

  • Editing ALV Column

    Hi,
    I am using these methods;
    lr_config      TYPE REF TO cl_salv_wd_config_table,
    lr_config->IF_SALV_WD_TABLE_SETTINGS~SET_EDIT_MODE ()
    What is supposed to be written in the parenthesis in order to edit the ALV column
    Thanks

    Hi,
    Try go through this [excellent blog|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1] by Claudia Dangers to understand how you can change 1 particular column of your ALV to editable mode.
    Regards,
    Uday
    First it is necessary to use an input field as cell editor for the column u201Cprice,u201D which should be editable. Therefore we need to enhance method WDDOINIT of view ResultView:
    WDDOINIT()
    [u2026] " Do all your basic stuff first
    " set cell editor for input fields (~make colum PRICE editable)
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
          lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
    lr_column_settings ?= l_value.
    lr_column = lr_column_settings->get_column( 'PRICE' ).
    CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'PRICE'.
    lr_column->set_cell_editor( lr_input_field ).
    " The u201Cread only modeu201D has to be set to abap_false to make the table editable.
    " set read only mode to false (and display edit toolbar)
    data: lr_table_settings type ref to if_salv_wd_table_settings.
    lr_table_settings ?= l_value.
    lr_table_settings->set_read_only( abap_false ).
    ENDMETHOD.
    Without this setting the input field will not be editable!

  • Dynamic tooltips on alv column

    I am displaying one alv column as the traffic lights icon.
    Depending on whether it is red, yellow or green, i want to have a different tooltip for this column.
    is this possible? if yes then can someone please tell me how to do it?
    regards,
    Priyank

    Well Sascha,
    Thanks for the response but i have a slight change in requirement now. The tooltip content will have to be fetched from the backend (database level) now through the function module which is returning the data to be displayed in the ALV. Thus, the option that seems available now is to get the tooltip content in another column in the alv, keep this column hidden and use the content of this column as the tooltip for the traffic lights column.
    Any direct way of doing this?
    By the way i tried using the following code in the domodifyview method to see if it works....did not work for me....let me know what wrong i might have been doing.
      DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
            l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table,
            l_value TYPE REF TO cl_salv_wd_config_table.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      l_ref_interfacecontroller =   wd_this->wd_cpifc_alv( ).
      l_value = l_ref_interfacecontroller->get_model( ).
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
             lr_column TYPE REF TO cl_salv_wd_column.
      lr_column_settings ?= l_value.
      DATA:
        lt_columns TYPE salv_wd_t_column_ref.
      lt_columns = lr_column_settings->get_columns( ).
      DATA:
          ls_column TYPE salv_wd_s_column_ref.
      LOOP AT lt_columns INTO ls_column.
        DATA: lr_cv TYPE REF TO cl_salv_wd_cv_standard.
        CREATE OBJECT lr_cv.
        lr_cv->set_key( 'ICON_GREEN_LIGHT' ).
        DATA: lr_textview TYPE REF TO cl_salv_wd_uie_text_view.
        CREATE OBJECT lr_textview.
        lr_textview->set_text_fieldname( ls_column-id ).
    lr_textview->set_tooltip( 'TOOLTIP FOR GREENLIGHT' ).
        lr_cv->set_editor( lr_textview ).
        ls_column-r_column->add_cell_variant( r_cell_variant = lr_cv ).
        ls_column-r_column->set_sel_cell_variant_fieldname( 'EXPIRYSTATUS' ).
        CASE ls_column-id.
          WHEN 'EXPIRYSTATUS'.
        ENDCASE.
      ENDLOOP.

  • Controlling visibility of ALV columns at runtime

    Hi
    I have an ALV column which is of type DropdownByKey. I can control the visibility of the dropdown by setting it based on another context node attribute (for e.g., 'CAT_VALUE_I_VISIBLE') which I modify at runtime. But then I want to hide the column itself based on the other context node attribute which I am not able to. Is it possible ?
    I have something like this to hide the dropdown
    lo_drdn_by_key->set_visible_fieldname( 'CAT_VALUE_I_VISIBLE' ).
    But on the column level there is only a method like :
    DATA lo_column type ref to cl_salv_wd_column.
    lo_column-r_column->set_visible( cl_wd_uielement=>e_visible-none ).
    Is there a possibility to control the visibility of an ALV column at runtime ?
    Thanks and regards
    Sukanya

    Hi,
    Depending upon another context attribute condition get th ecolumn ref of the alv field which you want to hide and set the visibility property to none.
    data : lt_columns type SALV_WD_T_COLUMN_REF.
    Get the column ref
      CALL METHOD lo_value->if_salv_wd_column_settings~get_columns
        RECEIVING
          value = lt_columns.
    CALL METHOD lr_column->set_visible
            EXPORTING
              value = cl_wd_uielement=>e_visible-none.
    Thanks,
    Shailaja Ainala.

  • ALV column displays either button or text ?

    Dear collegues,
    I want to display one column in an ALV table that either displays a button (with a text on it) or displays a text (without button). The decision what of these 2 possibilites is shown should be controlled by the runtime data (eg. the WD context).
    PS: I know how to display one ALV column with only buttons or one ALV column with only text.

    Hi Christian,
    a) Is the command l_cv->set_key( 'TEXT_VIEW' ) still correct to display the icon ?
    yes there is a no show stopper to display icon.since TEXT_VIEW is a string value to populate  text/check box conditionally.
    b) What I fill into the new context field 'CELL_VARIANT' while runtime ? Should it filled with u201CTEXT_VIEWu201D to display the iconand with u201C u201C to display the button ?
    you can give either button or icon to cell_variant.Follow my code as it is .you will get the output.

Maybe you are looking for

  • Please read this iTunes Devs.

    For the love of God, it's impossible to find a direct feedback link on the site for iTunes, so I'm posting it here in prayer of a dev actually reading it. /end mini-rant I would like to have iTunes show me a column that simply displays a "Yes" or a "

  • Report for Support Message,  Change Request and Change in one overview?

    Is there a report that shows the relation between the support message, change request and the change in one overview? I am already aware of the Change Management Reporting via SOLAR_EVAL, but this does not show the whole document flow in one overview

  • OracleXMLQuery

    I am using a set of PL/SQL packages to maintain business logic. The PL/SQL packages return nested tables to Java Beans which interact with JSP's. I am having problems in Java when I get the oracle.sql.ARRAY and get the ResultSet to create an OracleXM

  • Current time in module pool programming in text field

    Hello Friends, In module pool programming ther is a input output field for time i want the current system time should be displayed in that field and when user press saves tht time should get saved in the database tables. regards, Sunny

  • Notification successful but email not sent untill PM shuts down

    Hello, I was trying to email from a BPEL process and edited the ns_emails.xml file; corrected the SMTP host and port. The BPEL processes (with the email notification) succeed but the emails are not delivered until the BPEL PM shuts down. My network a