Hide a Column in ALV Grid Output

Hi,
I want to hide a column in ALV Grid Output through program.
I am using   lwa_fieldcat-NO_OUT = 'X'. to hide the column in output but it is not working, column in not hided in the output.
Kindly suggest.

It should work..
see the code :
d_fieldcat_wa-fieldname = 'MATNR'.
d_fieldcat_wa-seltext_l = 'material number'.
d_fieldcat_wa-no_out = 'X'. * hide particular field
append d_fieldcat_wa to d_fieldcat.
clear d_fieldcat_wa.
if not please paste your code here.
Thanks
Seshu

Similar Messages

  • How to hide selection column from alv grid

    hi
    i want to hide selection columns form alv grid.. how can i do it.. Is there any fm for that?
    regards
    palak

    Hi,
    the ALV Grid Control allows you to directly hide key columns with NO_OUT (field KEY_SEL is not used).
    Field name:NO_OUT
    Comp. type:LVC_NOOUT
    Dtype(length):Char(1)
    SPACE, 'X'
    If you set this field, you hide the relevant column in the list. Nevertheless, the column is available in the field selection and can be interactively selected by the user as a display field. The ALV displays the contents of hidden fields on the detail screen for a row in the grid control.
    Regards,
    Neenu.
    Edited by: Neenu Jose on Oct 21, 2008 10:46 AM

  • Hiding columns in ALV Grid output

    Hi all,
    Please find below my piece of code. I want to hide couple of columns in the grid output. Could you please tell me how to achieve it.
      DATA: gr_alv        TYPE REF TO cl_salv_table,
            lr_display    TYPE REF TO cl_salv_display_settings,
            lr_columns    TYPE REF TO cl_salv_columns_table,
            lr_column     TYPE REF TO cl_salv_column_table,
            lr_functions  TYPE REF TO cl_salv_functions_list,
            lr_sorts      TYPE REF TO cl_salv_sorts,
            lr_print      TYPE REF TO cl_salv_print,
            lr_column_f   TYPE REF TO cl_salv_columns,
            gr_error      TYPE REF TO cx_salv_not_found ,
            lr_event      TYPE REF TO cl_salv_events_table,
            lr_handler    TYPE REF TO znew_gc_event_handler,
            lr_layout     TYPE REF TO cl_salv_layout.
      DATA: key     TYPE salv_s_layout_key,
            gr_msg  TYPE string.
      TRY.
    * Create ALV instance - use CALL METHOD since this is a static method
          CALL METHOD cl_salv_table=>factory
            IMPORTING
              r_salv_table = gr_alv
            CHANGING
              t_table      = lt_to_header.
          lr_display = gr_alv->get_display_settings( ).
          lr_display->set_list_header( text-ttl ).
    * Get functions object and then set all the functions to be allowed
          lr_functions = gr_alv->get_functions( ).
          lr_functions->set_all( ).
          DATA: lv_field TYPE lvc_fname.
    * Get column settings object and then optimize the column widths to the
    * data
          lr_columns = gr_alv->get_columns( ).
          lr_columns->set_optimize( ).
    *--- set column header for custom field Todays Date
          TRY.
              lr_column ?= lr_columns->get_column( 'ZZDATE' ).
              lr_column->set_output_length('12').
              lr_column->set_long_text( 'Todays Date' ).
            CATCH cx_salv_not_found INTO gr_error.
              gr_msg = gr_error->get_text( ).
              MESSAGE gr_msg TYPE 'I'.
          ENDTRY.
    *--- set column header for custom field Age of Open
          TRY.
              lr_column ?= lr_columns->get_column( 'ZZ_AGE_OF_OPEN' ).
              lr_column->set_output_length('12').
              lr_column->set_long_text( 'Age of Open' ).
            CATCH cx_salv_not_found INTO gr_error.
              gr_msg = gr_error->get_text( ).
              MESSAGE gr_msg TYPE 'I'.
          ENDTRY.
    *--- set column header for custom field Age when Confirmed
          TRY.
              lr_column ?= lr_columns->get_column( 'ZZ_AGE_CONFIRMED' ).
              lr_column->set_output_length('18').
              lr_column->set_long_text( 'Age when Confirmed' ).
            CATCH cx_salv_not_found INTO gr_error.
              gr_msg = gr_error->get_text( ).
              MESSAGE gr_msg TYPE 'I'.
          ENDTRY.
          lr_event = gr_alv->get_event( ).
          CREATE OBJECT lr_handler.
          SET HANDLER: lr_handler->on_double_click FOR lr_event.
    *... Set Sort
          lr_sorts = gr_alv->get_sorts( ).
    *        " Optimize the column widths for printing.
          lr_print = gr_alv->get_print( ).
          lr_print->set_print_parameters_enabled( value = 'X' ).
          lr_print->set_column_optimization( value = 'X' ).
    *--- This code is to get the layout,save the layout and display the
    *    layout
          lr_layout = gr_alv->get_layout( ).
          key-report = sy-repid.
          lr_layout->set_key( key ).
          lr_layout->set_save_restriction( cl_salv_layout=>restrict_none )
          DATA: init_layout TYPE slis_vari.
          init_layout = p_layout.
          lr_layout->set_initial_layout( init_layout ).
    *--- display report
          gr_alv->display( ).
        CATCH cx_salv_msg.
          WRITE: 'Error displaying grid! - cx_salv_msg'.
        CATCH cx_salv_not_found.
          WRITE: 'Error displaying grid! - cx_salv_not_found'.
        CATCH cx_salv_data_error.
          WRITE: 'Error displaying grid! - cx_salv_data_error'.
        CATCH cx_salv_existing.
          WRITE: 'Error displaying grid! - cx_salv_existing'.
      ENDTRY.
    Thanks,
    Salil

    HI
    THIS IS THE LOGIC
    SELECTION-SCREEN BEGIN OF BLOCK charly
                     WITH FRAME TITLE text-100.
    PARAMETERS: rb_dis RADIOBUTTON GROUP rb DEFAULT 'X'
                                      USER-COMMAND ucomm ,
                rb_hid RADIOBUTTON GROUP rb .
               P_DEL TYPE VBAK-VKGRP .
    SELECTION-SCREEN END   OF BLOCK charly.
    *SELECTION sCREEN FOR PO TABLE
    SELECTION-SCREEN BEGIN OF BLOCK b2
                     WITH FRAME TITLE v_text.
    SELECT-OPTIONS : s_xblnr  FOR  zmshub-xblnr MODIF ID gr2,
                     s_bstkd   FOR  zmshub-bstkd MODIF ID gr2,
                     s_posex   FOR  zmshub-posex_e MODIF ID gr2,
                     s_kdmat  FOR  zmshub-kdmat MODIF ID gr2.
    PARAMETERS : p_upload LIKE ibipparms-path LENGTH 90  MODIF ID gr3 ,
                 p_down LIKE ibipparms-path  DEFAULT 'C:\output_log.txt'
                                           MODIF ID gr3.
    SELECTION-SCREEN END OF BLOCK b2.
    *SELECTION sCREEN FOR  DOWNLOADING
    SELECTION-SCREEN BEGIN OF BLOCK b4
                     WITH FRAME TITLE text-105.
    PARAMETERS :
              rb_n_d_f  RADIOBUTTON GROUP rb1 DEFAULT 'X' ,
              rb_ftp   RADIOBUTTON GROUP rb1 ,
              p_f_n TYPE c LENGTH 25 DEFAULT 'FILE NAME .TXT',
              rb_ws_d  RADIOBUTTON GROUP rb1 ,
              p_dw_f_n TYPE c LENGTH 25 DEFAULT 'C:
    TEMP\FILE.TXT',
              rb_op_ds RADIOBUTTON GROUP rb1 ,
              p_log_p LIKE filename-pathintern  DEFAULT 'ZHKWEB01',
              p_pa_fn LIKE rlgrap-filename MODIF ID gr1
                     DEFAULT  '//SOME-DIR/FILE.TXT',
              rb_ob_dw    RADIOBUTTON GROUP rb1,
             p_file LIKE filename-pathintern   "logical path
                        DEFAULT 'ZHKWEB01',       "name
             p_fname LIKE rlgrap-filename MODIF ID gr1     "path &
    *filename
                     DEFAULT text-t02,             "/some-dir/file.txt
              p_f_name TYPE c LENGTH 25 DEFAULT
    SOME-SERVERNAME\SOME-DIR\SOME-FILE.TXT'.
    SELECTION-SCREEN END OF BLOCK b4.
    AT SELECTION-SCREEN OUTPUT.
      IF NOT rb_dis IS INITIAL.
        LOOP AT SCREEN.
          IF screen-group1 = 'GR3'.
            screen-invisible = 1.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 = 'GR2'.
            screen-invisible = 0.
            screen-input = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.

  • Hide column in alv grid

    Hi Everyone,
    I would like to know how to hide a column in alv grid. Is there any specific field to set in the field catalog.
    Thanks in advance,
    Prabs.

    Hello friends,
    I am using the following lines of code, but invisible of my column ( message ) is not working, would be nice if some one can give me any tip.
    Field-symbols: <lfs_fieldcat> TYPE lvc_s_fcat.
      LOOP AT pt_fieldcat ASSIGNING <lfs_fieldcat>.
        CASE <lfs_fieldcat>-fieldname.
          WHEN 'DUMMY'.
            <lfs_fieldcat>-coltext = 'Message'.
            <lfs_fieldcat>-no_out = 'X'.
        ENDCASE.
      ENDLOOP.
    I have also set the field catalog to no_out = 'X'.
    PS: Do I need to append the field catalog to internal table ??
    I am using the function
    CALL METHOD lalv->SET_TABLE_FOR_FIRST_DISPLAY
             EXPORTING I_STRUCTURE_NAME =  'abc'
                       IS_LAYOUT        = ps_layout
             CHANGING  IT_OUTTAB        = xyz.
    Do I have to implicit set the field catalog in ps_layout ??

  • How to hide ,unhide columns  in ALV List

    Hi all,
    How to hide ,unhide columns  in ALV List..
    Plz guide me.
    Thanks in advance..
    Albert

    Hi Joseph,
    Check the following thread:
    Hide Unhide columns of ALV grid Report.
    Regards,
    Archana

  • Display one or more rows for a particular column in alv grid display

    Hi,
    My requirement in the report is to display users for a particular workitem id.If a workitem is in the inbox of one or more users(approvers) i have to display all the user names in one field in alv grid output (output-approver id).There are other fields which display details of the workitem also.
    Is there a way to populate multiple rows for a single column or creating one more internal table for users in the alv output table.
    Please suggest.
    regards,
    Sravanthi Chilal

    ALV only can show flat internal table data.
    you should set a sort on the field which you want to show only once.
    Then on the output of the ALV, the field with the same value will show only once.

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • Push Button in Every record in ALV grid output

    Dear Experts,
    I need to print a push button in first column of every record in ALV grid output. How ?
    No OOPS concepts please.
    Thanks,
    Siva.

    For this requirement, you have to copy the standard PF status of the ALV output. Do as below :-
    1) Go to SE41
    2) Enter the program name as SAPLKKBL
    3) In the field status enter STANDARD_FULLSCREEN
    4) Click on STATUS button on the application toolbar.
    5) Enter the name of your Program & a new status name.
    6) Click on COPY.
    This way the standard status will be copied to the custom status & call the same status in your program using SET PF STATUS statement. Then double click on the custom status name & you will be navigated to SE41, there you can add you new button on the application tool bar & assign a function code, which you can program by enabling the export parameter I_CALLBACK_USER_COMMAND of the Function module REUSE_ALV_GRID_DISPLAY.
    Just a sample code snippet for your reference :-
    FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM
    LS_SELFIELD TYPE SLIS_SELFIELD.
    CASE L_UCOMM.
    WHEN 'your function code goes here'.
    Do further processing.
    This way you will have the standard PF status alongwith your button as well.
    Edited by: Kumar Manas Mishra on Jan 29, 2010 1:03 PM

  • Want to display more than 300 charcters in a column using ALV grid display

    Hi Guru's,
    I am trying to display more than 500 charcters in a column using alv grid display but it in the output it is showing only 128 characters. Can you help me to display all the characters in particular column Or is there any limitation in maximum of no of charcters for a column?
    Thanks,
    Radha.

    Hi Paurl,
    Define a work area say
    wa_layout type slis_layout_alv.
    then fill this work area as
    wa_layout-zebra = X
    wa_layout-colwidth_optimize = X.
    wa_layout-max_linesize = 300.
    Then in FM 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    is_layout = wa_layout
    etc.
    you provided this for the field which is displayed in alv grid will have more than 128 characters.
    from this code i want,how it refers to particular field.
    when i mentioned field catalog-OUTPUTLEN = '300'.
    it is not displayed the field morethan 128 characters.
    it only displays 128 characters.
    please provide me clear and breif information with suitable code.
    i am trying what your sending but it is not displayed more than 128 characters.
    if you don't mind please spend for me some time for this and
    give me clear and breif information with suitable code.
    Thanks & Regards,
    Radhakrishna.

  • Facing problem while downloading ALV grid Output into Excel

    Hi Guys,
    I am facing problem while downloading ALV grid Output into Excel.
    It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
    If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
    Can someone help me regarding this
    thanks for your help

    Hi,
    Open up Excel on your desktop. Goto Tools > Macro > Security.
    Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
    Was this your problem? Don't forget those points, either.
    check with this wetther it is solved or not.
    Regards,
    sana.

  • F4 - Help for field in ALV Grid Output

    Hi,
    I generated a report which gives output in ALV Grid output.
    In the output, 1 of the field is editable.Here, for this field I need to have my own F4-Help.
    I think the procedure to be followed is:--
    Create a Search Help in SE11.
    Link the Search Help to the editable field.
    Please let me know if its the correct procedure.
    I f yes, how can I link user defined Search Help to the editable field?
    Thanks,
    Shivaa........

    Hi siva,
    you can also do that way.
    while filling the fieldcatalog use the parameter F4AVAILABL
    for more info check
    F4 help in ALV Grid...
    f4 help for a field in alv grid
    hope it helps you
    Thanks!
    Edited by: Prasanth on Mar 6, 2009 3:59 PM

  • In ME2N  report for PO- How to get or add Vendor name in ALV grid output

    Hl Everyone
    How to get  or add Vendor Name and payment terms in the ALV grid output for the follwing reports like ME2N and ME2V.
    cuurently i am in 4.7 E version.
    Kindly suggest..........
    thanks in advance
    Regards
    Prashanth

    Hi Pankaj
    I knew that vendor name field is avaiable in ECC versions, but how to get the same field(vendor name) in 4.7 E vesion.
    Kindly suggest
    Regards
    Prashanth

  • How to download alv grid output(with field catalog) into excel file format

    Hi all,
    How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
    Please help.
    Regards,
    Satya.

    Hi,
    On list where alv is displayed, select export icon( green color -> ),select spread sheet.
    This will display records in Excel sheet.

  • Need to choose fields from alv grid output and send mail

    Hi,
    I need to choose few orders from alv grid output and send mail as PDF for chosen orders.
    Suggest if possible and how.

    Moderator message - Please do not post your requirements and ask the forum to do your work for you - post locked
    Rob

  • Maximum number of character we can print in a column uing ALV grid display

    Hi frnds,
    My requirment is to print 500 charcter data in a column using ALV grid display.
    Could any body tell me is it possible and the maximum character it can i print in a column using ALV grid dispaly.
    Regards,
    Sandipan

    Hi Sandipan,
    refer notes 857823, 910300 and 959775. All these say there is a limitation of 128 characters.
    857823 - ALV grid: Strings with a maximum of 128 characters
    Symptom
    Entries in cells of the type CHAR or string are truncated after 128
    characters in the SAP GUI.
    also refer,
    ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid
    (Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end
    Cause and Prerequisites
    The data table that is sent to the front end only allows character values
    with the length 128.
    Solution
    This is the standard system behavior and cannot be changed.

Maybe you are looking for

  • How do I get firefox to keep my option of not using a proxy in settings

    Every time I change the proxy from auto-detect to use system proxy it does not stay once firefox is closed

  • Issues opening pdf's

    i am in advertising and we have a website that we get our proofs from in a pdf format. With previous versions of reader, I have had no problems opening, saving, printing etc many times over in a session. But now I can one or two then I start getting

  • Namespace Problem? Namespace prefix used but not declared.

    Hello Guru's, I am new to XSL templates, while genrating XML publisher report with these template, I am getting below "namespace" error: If I remove the "set:"/"str:" expressions from the template, it works fine. Is there anything syntactically wrong

  • Can't see shared music, but can see servers!

    Hiyas I had to reinstall OSX last week. Everything went fine, but now, on iTunes, I can't see my music that is on another Mac anymore. Inside iTunes, I can see the other Mac and I can connect to it without an error. But once connected, iTunes doesn't

  • Error message with servlet

    Hi everyone, I am trying to write a customized portlet that searches for only user objects. I am getting a Servlet.service () for servlet jsp threw exception and the Root Cause is java.lang.NullPointerException. Now, I am pretty sure I need to set up