ALV  Column

Hi
i need to display columns in ALV like this format.
               Jan     feb    mar
pernr   ename  pf      pf     pf.
910043  rk     1500    1500   1500
I want headings like jan, feb and mar too.
Please suggest me how to display that.
Thanks in advance.

Hi r_k.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_program_name         = gs_variant-report
            i_internal_tabname     = 'T_FILE'
            i_inclname             = gs_variant-report
       CHANGING
            ct_fieldcat            = field[]
       EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
  LOOP AT field INTO wa_field.
    CASE wa_field-fieldname.
1 .- Ejercicio.
      WHEN 'column1'.
        wa_field-seltext_s = 'Jan'.
        wa_field-seltext_m = 'Jan'.
        wa_field-seltext_l = 'Jan'.
        wa_field-REPTEXT_DDIC = 'Jan'.
        MODIFY field FROM wa_field.
2 .- Trimestre.
      WHEN 'column2'.
        wa_field-seltext_s = 'feb'.
        wa_field-seltext_m = 'feb'.
        wa_field-seltext_l = 'feb'.
        wa_field-REPTEXT_DDIC =  'feb'.
        MODIFY field FROM wa_field.
    ENDCASE.
  ENDLOOP.
ENDFORM.                    " DEFINE_HEAD

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

  • 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.

  • Split ALV Column heading into two

    Hello All,
    I have a ALV Column Header - ALV LIST - SAP 46C.
    Material   |  Info Type |  Quantity |  Price etc..
    Due to space contraints and other reason client needs to split the Info type column into two.
    Material   |  Info  |  Quantity |  Price etc..
               | Type   |
    The data records should not have any additional blank lines.
    How to achieve this?
    Thanks,

    You have to assign X to layout property no_colhead.
    Then write your heading using write statements.
    Here is the exact example you are looking for [Create Multiple Lines Header In ALV List Report|http://www.freesaptutorial.com/create-multiple-lines-header-in-alv-list-report/]

  • List box in alv column

    Hi Experts,
       I have an requirement as follows. i ma getting the text from summary of notification.it is dispalyed in summary as four lines and it need to be displayed as same in the webdympro column i.e if summary is as follows:
    USERNAME DATE
    MATERIAL NO
    REASON FOR REPLCEMANT
    it shud be displayed as same in the  int webdynpro alv column?
    i wanted to use list box , but i couldnot find any class pertaining to list box which can be used in the ALV column.
    Can anyone plz advice me h can i cheive this...........
    Cheers,
    Madhu

    Hi,
    See the sample report in sap technical web site.
    follow this link  saptechnical com/Tutorials/ALV/Dropdown/list.htm
    YOu can also refer this sap standard report RSDEMO_TABLE_CONTROL
    Regards,
    Pravin
    Edited by: pravin s. on Sep 21, 2010 9:05 AM

Maybe you are looking for

  • Looking for a specific widget

    I was wondering if there is a widget that will do basically what The Activity Monitor does, namely display running processes. I would love to be able to hit F12 and have a list of my running apps showing me how much % of CPU is being used, rather tha

  • What are the mandatory fields of BAPI for creating a new purchase order?

    Hi friends, I am very new to XI.My Boss has given me task to create a purchase order using BAPI. I want step by step guide to create it.How will i know which fields are mandatory for BAPI_PO_CREATE?

  • Keyboard connection question

    I just got a yamaha MO8 keyboard, and i was wondering how i could play the sounds from the keyboard on to logic, i know how to use it MIDI, but thats what i am not looking for. If anyone can help me out i would appreciate that very much.....

  • ScrollableCursor.size() throwing an exception

    I get the following exception when I call size(): EXCEPTION DESCRIPTION: java.sql.SQLException: Invalid operation for forward only resultset : last INTERNAL EXCEPTION: java.sql.SQLException: Invalid operation for forward only resultset : last ERROR C

  • Hide Cost Distribution button in SRM SC screen

    Hi Experts, We have a requirement where in we need to hide the cost distribution,copy to clipboard,etc..buttons in the cost assignment section of shopping cart screen . we are using SRM 5.0 Is there a way where we can make this invisible without maki