How to hide headers for specified columns in ALV?

Hallo guyes,
is it possible to hide headers just for a few columns in ALV?
Something like no_headers but just for defined columns...
Is it also possible to define column description in two lines?
Thanks.

Hi,
Check the below code
codeFORM prep_fieldcat_xls USING lt_fieldcat_xls TYPE slis_t_fieldcat_alv.
RANGES: lra_fieldname FOR field_ran.
DATA: lwa_fieldcat_xls TYPE slis_fieldcat_alv.
Build range for all unwanted columns:
lra_fieldname-option = 'EQ'.
lra_fieldname-sign = 'I'.
lra_fieldname-low = 'EEP'.
APPEND lra_fieldname.
Remove the unwanted columns from the fieldcatalog:
lt_fieldcat_xls] = lt_fieldcat[.
LOOP AT lt_fieldcat_xls INTO lwa_fieldcat_xls
if lwa_fieldcat_xls-fieldname = lra_fieldname-low. "Change here as it is
lwa_fieldcat_xls-no_out = 'X'.
endf.
MODIFY lt_fieldcat_xls FROM lwa_fieldcat_xls INDEX sy-tabix.
ENDLOOP.[/code]
Regards,
Raj.

Similar Messages

  • Mulitple Line column headers for a column in ALV using Web Dynpro for ABAP

    Hi WD4A Gurus,
           I have requirement to display the header name in multiple lines for a single column using ALV. How to achieve this, do I need to do some custom code? Please help me with sample code.
    Example:
    existing column name :
                Name   |  Date (mm/dd/yyyy) | Amount
    required column name:
                Name   |    Date               | Amount
    (mm/dd/yyyy)
    Thanks
    Ketan

    Displaying header in multiple lines is not possible in alv
    Regards
    Tamil

  • How to put colours for a column in ALV

    Dear All,
    I need to put green colour for 1 column in an ALV report.
    Can anybody tell me how we can do that ...
    Thanking you in advance,
    Shankar

    Here's a little sample program.....  this illistrates coloring at the column, row, and cell level.
    report zrich_0002 .
    * Use of colours in ALV grid (cell, line and column)            *
    * Table
    tables : mara.
    * Type
    types : begin of ty_mara,
              matnr         like mara-matnr,
              matkl         like mara-matkl,
              counter(4)    type n,
              free_text(15) type c,
              color_line(4) type c,           " Line color
              color_cell    type lvc_t_scol,  " Cell color
    end of ty_mara.
    * Structures
    data  : wa_mara     type ty_mara,
            wa_fieldcat type lvc_s_fcat,
            is_layout   type lvc_s_layo,
            wa_color    type lvc_s_scol.
    * Internal table
    data : it_mara     type standard table of ty_mara,
           it_fieldcat type standard table of lvc_s_fcat,
           it_color    type table          of lvc_s_scol.
    * Variables
    data : okcode like sy-ucomm,
           w_alv_grid          type ref to cl_gui_alv_grid,
           w_docking_container type ref to cl_gui_docking_container.
    parameters : p_column as checkbox,
                 p_line   as checkbox,
                 p_cell   as checkbox.
    at selection-screen output.
      perform get_data.
      perform fill_catalog.
      if w_docking_container is initial.
        perform create_objects.
      endif.
    *&      Form  create_objects
    form create_objects.
      create object w_docking_container
        exporting
          ratio                       = 60
        exceptions
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          others                      = 6.
      create object w_alv_grid
        exporting
          i_parent          = w_docking_container.
    * Field that identify color line in internal table
      move 'COLOR_LINE' to is_layout-info_fname.
    * Field that identify cell color in inetrnal table
      move 'COLOR_CELL' to is_layout-ctab_fname.
      call method w_alv_grid->set_table_for_first_display
        exporting
          is_layout                     = is_layout
        changing
          it_outtab                     = it_mara
          it_fieldcatalog               = it_fieldcat
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4.
    endform.
    *&      Form  get_data
    form get_data.
      select * from mara up to 5 rows.
        clear : wa_mara-color_line, wa_mara-color_cell.
        move-corresponding mara to wa_mara.
        add 1                   to wa_mara-counter.
        move 'Blabla'           to wa_mara-free_text.
        if wa_mara-counter = '0002'
        and p_line = 'X'.
    * Color line
          move 'C410' to wa_mara-color_line.
        elseif wa_mara-counter = '0004'
        and p_cell = 'X'.
    * Color cell
          move 'FREE_TEXT' to wa_color-fname.
          move '6'         to wa_color-color-col.
          move '1'         to wa_color-color-int.
          move '1'         to wa_color-color-inv.
          append wa_color to it_color.
          wa_mara-color_cell[] = it_color[].
        endif.
        append wa_mara to it_mara.
      endselect.
    endform.
    *&      Form  fill_catalog
    form fill_catalog.
    * Colour code :                                                 *
    * Colour is a 4-char field where :                              *
    *              - 1st char = C (color property)                  *
    *              - 2nd char = color code (from 0 to 7)            *
    *                                  0 = background color         *
    *                                  1 = blue                     *
    *                                  2 = gray                     *
    *                                  3 = yellow                   *
    *                                  4 = blue/gray                *
    *                                  5 = green                    *
    *                                  6 = red                      *
    *                                  7 = orange                   *
    *              - 3rd char = intensified (0=off, 1=on)           *
    *              - 4th char = inverse display (0=off, 1=on)       *
    * Colour overwriting priority :                                 *
    *   1. Line                                                     *
    *   2. Cell                                                     *
    *   3. Column                                                   *
      data : w_position type i value '1'.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATNR'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATNR'    to wa_fieldcat-ref_field.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATKL'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATKL'    to wa_fieldcat-ref_field.
    * Color column
      if p_column = 'X'.
        move 'C610'     to wa_fieldcat-emphasize.
      endif.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'COUNTER'  to wa_fieldcat-fieldname.
      move 'N'        to wa_fieldcat-inttype.
      move '4'        to wa_fieldcat-intlen.
      move 'Counter'  to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position  to wa_fieldcat-col_pos.
      move 'FREE_TEXT' to wa_fieldcat-fieldname.
      move 'C'         to wa_fieldcat-inttype.
      move '20'        to wa_fieldcat-intlen.
      move 'Text'      to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
    endform.
    Regards,
    Rich HEilman

  • How to hide data of any column in ALV Display

    Hi ,
    I  am displaying  an  ALV in which i have to display subtotal  of each column but want to hide the data of  that column(only data is to hide ) column should be visiable,.
    Please let me know i any one have worked with this situation.
    Thanks in advance.

    Hi,
    In field Catlog set field no_out eq 'X'.
    No_out (field in field list): This parameter is used to remove certain fields from the output during initial display.  The user can however interactively choose the field for output from the field list in the display variant.
                       'X' = field is not displayed in the current list.
            Value set: SPACE, 'X'.
    Thanks & regards,
    ShreeMohan

  • How to display subtotals in separate column in alv report?

    hi,
    I am displayed the subtotals  for QUantity field BDMNG in Reuse_alv_grid_display  in the same column.
    but I want to display subtotal in separate column.
    How to display subtotals in separate column in alv report?
    thanks&regards.
    samba.k

    Hi
    As far as i know you can't do this,the option you have is to create one more column (subtotal) and populate it by manual calculation at every subtotal (not alv subtotal but yours) .
    Best Regards
    Yossi

  • DropDown By Index for a Column in ALV

    Hi,
    I am trying to create a dropdown for a column in ALV. I have used the following code for the same.
    data:
              lr_drdn_by_index type ref to cl_salv_wd_uie_dropdown_by_idx.
            create object lr_drdn_by_index
              exporting
                selected_key_fieldname = ls_column-id.
            lr_drdn_by_index->set_valueset_fieldname( 'VALUESET' ).
            lr_drdn_by_index->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
            ls_column-r_column->set_cell_editor( lr_drdn_by_index ).
    "VALUESET" Contains the Dropdown Data.
    Is there any settings that I have to do which is missing?
    Regards,
    Shruthi

    Hi,
    follow these steps :
    1) create a node for example (NODE_LIST)
    2) crrate an attribute (LIST: type WDY_UIE_LIBRARY_ENUM_TYPE)
    3) in your WDDOINIT method, populate your list :
    lr_node = wd_context->get_child_node('NODE_LIST').
    lr_node_info = lr_node->get_node_info( ).
    ls_value_set-key = 10.
    ls_value_set-value = 'tes'.
    INSERT ls_value_set INTO TABLE lt_value_set.
    ls_value_set-key = 20.
    ls_value_set-value = 'tes'.
    INSERT ls_value_set INTO TABLE lt_value_set.
    lr_node_info->set_attribute_value_set(
    name = 'LIST'
    value_set = lt_value_set ).
    4) in your table settings :
    data :
    list_field    TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
    CREATE OBJECT list_field
          EXPORTING selected_key_fieldname  = ls_columns-id.
    ls_columns-r_column->set_cell_editor( list_field ).
    I hoep this helps, if not please clarify your question.
    Regards

  • How does Toggle Visible for a Column in a Table work ?

    Hi All,
    I have a question for you.
    Using version 11.1.1.7:
    I was playing with a use case where I need to show and hide columns in an af:table component.
    I want to do this clientside using javascript.
    Guess what: It works, however, it only works for hiding columns ?!
    Initially I have client component = true and visible is true.
    See javascript below.
    When I call hideColumn, the component is found and hidden after calling.
    When I call showColumns (after it is hidden) the component cannot be found anymore.
      function showColumn(evt){
          var col = AdfPage.PAGE.findComponentByAbsoluteId("pt1:pc1:t1:c9")  ;
          col.setVisible(true);    
       function hideColumn(evt){
          var col = AdfPage.PAGE.findComponentByAbsoluteId("pt1:pc1:t1:c9")  ;
          col.setVisible(false);    
        }I checked and when the columns visible property is initially false, the column is not found by AdfPage.PAGE.findComponentByAbsoluteId("pt1:pc1:t1:c9"), which means it is not available ?!
    It looks like the visible property for an af:column works slightly different then for other components such as buttons.
    Also makes me wonder how the panelCollection component shows and hides columns. Doesn't that component do exactly the same ?
    Thanks.

    Luc,
    couldn't find a hint in the sources (maybe didn't spend enough time). However, one reason for this behavior would be if the hidden column had no client component created (in which case it only exists as hidden HTML). The work around I think would be to use a serverListener on the table and to pass the columns to show/hide as the payload for server side show/hide
    Frank

  • How to hide the table control column in module pool

    Dear Experts,
    Please help me on this
    I have 2 screens 9000 and 9001 . In screen 9000 I have 2 radio buttons if I select the 2nd radiobutton then the screen  9001 should display inthat some column has to be hide inthe table control. I have used this code but still it is not hiding please help me on that
    I used this code in PBO of 9001 screen
    LOOP AT SCREEN.
        IF wopr = 'X'.
          IF screen-group2 = 'ABC'.
            IF screen-name = 'ZMMT_EKKO-MATNR' or screen-name = 'ZMMT_EKKO-BANFN'.
            screen-active = ''.
              screen-invisible = '1'.
              screen-input = ''.
              MODIFY SCREEN.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    Even I tried this code also in the same screen 9001
    loop at tbl_rfq-cols into cols.
    IF wopr = 'X'.
    IF screen-group2 = 'ABC'.
    IF cols-screen-name = 'ZMMT_EKKO-MATNR' or cols-screen-name = 'ZMMT_EKKO-BANFN'.
    cols-screen-input = '0'.
    cols-invisible = '1'.
    endif.
    MODIFY tbl_rfq-cols FROM cols INDEX sy-tabix.
    endif.
    endif.
    endloop.

    Hi Balaji,
    To hide a column in a table control on screen.
    In the PBO of the screen, inside
    loop with control <tab_ctrl_name>.
    module modify_tab.
    endloop.
    Say for a column, you take group1 as 'ABC'.
    In this module you can use the group for the input/output fields and the display/hide them as per your requirements.
    if <condition>.
    loop at screen.
      if screen-group1 = 'ABC'. "say textbox (column for a table) has group1 as ABC
       screen-invisible = 'X'. "hide a column
       screen-active = ' '.
      endif.
      modify screen.
    elseif <condition>.
    loop at screen.
      if screen-group1 = 'ABC'. "say textbox (column for a table) has group1 as ABC
       screen-invisible = ' '. "display a column
       screen-active = 'X'.
      endif.
      modify screen.
    endif.
    Similarly, you can use this code for other columns also.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • How to create  index for a column of a view

    Hi,
    I have created view for a table and then i am trying to create index for a column of that view. i am using the query "CREATE INDEX index_name ON view_name (col)". but Mysql is showing error like "view_name is not a base table".
    How can i do that......

    As mentioned this is a java forum not a mysql forum, but as I know the answer - you can't create an index directly on a view in mysql.

  • How to disable sorting for some columns in a ALV GRID?

    Hi i have requirement where I have to disable sorting for some columns in a ALV GRID. i am using REUSE_ALV_GRID_DISPLAY function module.
    Can anybody help me. how to acieve this? Any code snippets will really be appreciated.

    Hi,
    I have tried this but not completely successful. I think this can be done using the OOPS method.
      DATA: it_event_exit TYPE  slis_t_event_exit.
      DATA: w_exit TYPE slis_event_exit.
      w_exit-ucomm = '&ODN'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      w_exit-ucomm = '&OUP'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_top_of_page      = 'ALV_TOP_OF_PAGE'
          i_callback_html_top_of_page = 'ALV_HTML_TOP_OF_PAGE'
          i_callback_user_command     = 'USER_COMMAND'  <- User command form
          is_layout                   = wm_layout
          it_fieldcat                 = wt_fieldcat
          it_events                   = i_events
          it_event_exit               = it_event_exit    <- Need to fill
          it_sort                     = wt_sort
          i_default                   = 'X'
    Now you can capture this events in the user command
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      IF r_ucomm = '&OUP' and rs_selfield-SEL_TAB_FIELD = 'Your field name'.
      ENDIF.
    ENDFORM.                    "user_command
    In this form you will get the function code in 'r_ucomm' and the field selected for sorting in 'rs_selfield-SEL_TAB_FIELD'. But reseting 'r_ucomm' will not work.
    May be somebody else can give some help on this.
    But this will work if you follow the oop method.
    Please see this document for more info.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an easy reference for alv grid control.pdf
    Thanks
    Vinod

  • How to print Headers for Delimited Report?

    Hello,
    I am able to generate a Delimited report. Report is running and saving to a specified folder as a ASCII file(.txt). I can open that file using Excel and every thing looks good. But the problem is with the headers, to the columns. I would like to print the Header to each column. Other wise we do not know which column is which. Any kind of feed back is greatly appreciated.
    Thanks,
    EV

    If you're using 6i Patchset 11, you might like to take a look at the "delimiteddata" command line option rather than using "delimited" output.
    "delimiteddata" is driven from the data model and you can specify which columns you want to include and also define the column header values in the same fashion as the XML tags.
    You should be able to get more details from Metalink.

  • How to provide formulae for the columns in report based on date column

    Hi,
    How can we provide formulae for the columns in report, where each column is based on another Date Column.
    Can anyone suggest on this.
    Thanks

    Hi Manu,
    I think you a logical column X on which you created another Logical Column Y.
    Now you want 'Y' to be filtered based on Date Column.
    1. If, my assumption is right - You can do your requirement i.e. Filtering the logical col. 'Y' on Reports.
    Else,
    2. See - Your Logical column 'Y' While creating log. column 'Y' make sure you use any expression builder to filter across Date column. (i.e. using any case statements or where clause).
    Else,
    3. Make sure your First Logical column comes from Table by default (i.e. Create the same col. in d/b so it would be your Physic col. )
    Thank you.
    Edited by: GRK on Jan 28, 2013 7:48 AM

  • How to hide list for particular users in SharePoint 2010

    Hello Experts,
    How to hide/Show Custom list to a particular user or group in SharePoint 2010
    Thanks in advance.
    Thanks & Regards, Abasaheb Dubal.

    All the lists in SharePoint inherits permission from its site. To hide a list from a user or a group what you can do is break permission inheritance at the particular list level.
    1) Go to List and then click List Settings from the Ribbon.
    2) Under permissions and management click Permissions for this list
    3) Click Stop Inheriting Permission from the Ribbon
    4) Remove User or Group that you do not want to share that list with.
    Amit

  • Sap.m.Table: How to disable includeItemInSelection for one column?

    Dear UI5 Experts,
    I have used includeItemInSelection method for whole table as it is required for me on selectionChange event in sap.m.Table control.
    Now, I have a requirement where I need to disable that method for one column. Is there a way to disable includeItemInSelection method for only one column in sap.m.Table control. Please Advice.
    Thank you!
    Regards,
    Sai Vellanki

    Hi,
    you can use method oTable.bindAggregation
    Refer example sap.m.Table and see the source code.
    Regards,
    Chandra

  • Average sum for a column in ALV tree layout

    Hi,
    I've trying to set an average sum for a column in an ALV tree report.  In the field catalog i set the DO_SUM field to 'X' and this will do a total sum, but I can't find out how in the code to do the average sum.
    Also to get round this I was going to just set a default display variant with the "average" sum option saved after i had manually selected the columns and set it to this.  Problem with this is that when i re-run it, the sum comes back as a total rather than an average.  I have tried setting display variants on the SAP example ALV tree programs and the same thing happens.
    Does anyone know how i can get round this?
    Cheers
    Matt.

    Hi,
    In addition to setting DO_SUM = 'X' you need to specify function in H_FTYPE field. It should be set to 'AVG' in your case.
    ls_fielcat-do_sum = 'X'.
    ls_fieldcat-h_ftype = 'AVG.

Maybe you are looking for

  • No data in 0FI_GL_1 and 0FI_GL_6

    Dear All, Any pre setting is requir, i am not getting data in rsa3 for datasource 0FI_GL_1 and 0FI_GL_6 in r/3. please provide me your inputs. we are in BI 7.

  • Using Airparrot with an ethernet cable: suddenly, it quit

    I live in a large apartment using a collective server and router.  When I moved in a month ago, the only way I could access my Apple TV 3 from my MacBookPro (late 2009), running Snow Leopard and using the third party Airparrot to transmit, was to con

  • Organization level initialization through backend

    Hi, In the Oracle EBS, whenever I open a form I have a popup asking for organization. Now I want to run a program from backend to replicate the front end. But before running the program, I want to initialize in the same way it happens in the front en

  • Long queue for unidentified mails/ domains

    friends i was checking my queue for ex 2013 and i found loads of emails blocking my queue. we dont use these domains neither anyone from us connects to them.. they look some face domains.. can you guys please provide some info. please check below scr

  • Db access during export

    Hi, 9iR2 /AIX5 I'm wondering what is the status of db access during full export? How any user query will be influenced? We do export off business time, but it might be a case to export during the day. Should I put db in 'restrict' mode or not? What a