How to hide one column in Alv if it doesnt contain any value

Hi,
  In alv Grid if one coulmn doesnt conatin any value.I doesnt want to display in ALV grid.Is dat possible. Plz help.

Hello Anu
When you prepare your fieldcatalog check the column of the output itab for its contents, e.g.:
" Itab GT_FCAT contains fieldcatalog.
" Itab GT_OUTTAB contains ALV list data.
" Condition: column "MY_COLUMN" should contain at least single value > 0
  LOOP AT gt_outtab TRANSPORTING NO FIELDS
                 WHERE ( my_column > 0 ).
    EXIT.
  ENDLOOP.
  IF ( syst-subrc NE 0 ).  " Column "MY_COLUMN" contains no value > 0, then hide column
    READ TABLE gt_fcat INTO ls_fcat
              WITH KEY fieldname = 'MY_COLUMN'.
    IF ( syst-subrc = 0 ).
      ls_fcat-no_out = 'X'.  " not displayed, but visible in layout
      ls_fcat-tech = 'X'.     " not displayed, not available in layout
      MODIFY GT_FCAT FROM ls_fcat INDEX syst-tabix.
    ENDIF.
  ENDIF.
Regards
  Uwe

Similar Messages

  • 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

  • How to get one column of ALV table as dropdown by key.

    Hi experts,
                  How can I get one column of ALV table as dropdown and editable. If  user wants to change that column value he can just select from that dropdown and click on update button. Can I provide tool tip to that column as " Select from drop down to change the status "?
      Please Help.
    Thanks,
      Pratibha

    You just need to change the cell editor of that column in ALV.
    So first get access to the alv model object (adjusting the code below for your ALV Component Usage name - mine was ALV_ADV):
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv_adv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv_adv( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
    Then access the column object you want to change:
    DATA l_column TYPE REF TO cl_salv_wd_column.
      l_column = l_table->if_salv_wd_column_settings~get_column( 'REGION' ).
    Then create the cell editor for DDLB and set it as the new cell editor for this column:
    DATA ddlb TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
      create object ddlb
        exporting
          selected_key_fieldname = 'REGION'.
      ddlb->set_tooltip( `Select from drop down to change the status` ).
      l_column->set_cell_editor( ddlb ).

  • 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

  • How to hide one column in PIVOT(in Union )

    Hi experts
    I have one problem regarding my Pivot report.
    I have to calculate MTD an YTD in my single report so i have calculated MTD in one criteria (UNION) YTD in second criteria.
    In my MTD i have to show 4 column: A B C D
    and in YTD I have to show only 3 column : A B C
    So how to hide column D in YTD.
    Thanks in advance
    Regards
    Frnds

    Hi John
    I have done :
    1. when i do cast as null to my D column in second report. I am getting error
    (Union for non compatible)
    2. so i done the cast in first report also..
    3. Done the union all
    4.and done the HIDE for column D in Result Column..
    But still i am seeing it in my report in YTD...
    So please help me its very urgent for me..

  • How to hide multiple columns in multicolumn listbox like as an excel sheet?

    Hello All,
    I have large amount of data that is to be displayed on multicolumn listbox. After displaying that, I want to hide or delete some columns from listbox in runtime.
    I know how to hide one column using active cell property node. But I want to hide multiple columns. I am using LabVIEW 2011. 
    Thanks in advance.
    Thanks & Regards,
    Manisha

    Thank you so much. 
    But I have total 12 columns and I don't want to delete columns serially. I want to delete inbetween columns, like in attached VI I want to delete column A & D only. 
    And in this user have to select it from frontpanel. I want this is to be done as in excel, like we select the entire column and either we hide it or delete it. One more thing I want to clear the data in multicolumn when I next time open my VI. How to do that?
    I hope am clear in explaining my problem.
    Thanks & Regards,
    Manisha
    Attachments:
    Delete Column.vi ‏10 KB

  • How can i suppress columns in ALV ?? Will reward points.

    Hello Gurus, how can i suppress column in ALV when i`m using the transparent table:
    CALL METHOD grid->set_table_for_first_display
          EXPORTING
            i_structure_name = 'ZIANEXE'
            is_layout        = wa_layout
            is_variant       = wa_variant
            i_save           = 'U'
            IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
          CHANGING
            it_outtab        = itab[]
            it_fieldcatalog  = fieldcat.
    Please help.

    in the fieldcatalog you are providing there is a field NO_OUT use this.
    Loop over internal table and check fieldname. If fieldname = column you want to hide, NO_OUT = 'X'.
    Edited by: Micky Oestreich on May 8, 2008 12:06 PM

  • Display concatenad fields under one column in alv.

    How can I concatenate three or four fields(Taken from different tables) and can display under one column in ALV report?
    I want to display:
    final_column = production orderStatusmaterial type+maintenance status (concatenation of four fields).
    production order: caufvd-aufnr
    status: tj02t-txt04
    material type: mara-mtart
    maintenance status:mara-pstat
    I want to display only final_column in my alv output screen.
    Kindly guide.
    Thanks and regards.
    Thanks and regards.
    Message was edited by:
            cinthia nazneen

    Please  go through the below   code and  do the same   for appearing  the   four fields  of different table into  One Field catalog at   Display  by Concatenating .
    DATA  :v_tmp  type  string .
    Loop at  itab1.
    Read table  itab2  key field1 = itab1-field1 .
    Read table  itab3  key field1 = itab1-field1 .
    Read table  itab4  key field1 = itab1-field1 .
    Concatenate  itab1-field1 itab2-field1 itab3-field1 itab4-field1 into v_tmp.
      fieldcatalog-fieldname   = 'V_TMP'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endloop.
    Reward points if it is usefull .....
    Girish

  • Icon and text together in one column in alv list

    Hello Everyone,
    I want to display icon and text together in one column in ALV list.
    I am using reuse_alv_grid_display function module.
    Currently, i am able to see icon only in the column but i want to see both icon and text in one column in ALV.
    Please let me know if this scenario is possible in ALV and how.
    Thanks in advance.
    Regards, Tarun

    Hi,
    Check this code....
    REPORT  ZTEST_ALV_CHECK     MESSAGE-ID ZZ           .
    TYPE-POOLS: SLIS,icon.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT TYPE SLIS_LAYOUT_ALV/
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
          ICON(1),
         END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 20 ROWS
           INTO TABLE ITAB.
    loop at itab.
    if sy-tabix = 1 or sy-tabix = 2.
    itab-icon = '1'.
    elseif sy-tabix = 10 or sy-tabix = 20.
    itab-icon = '2'.
    else.
    itab-icon = '3'.
    endif.
    modify itab index sy-tabix.
    endloop.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-HOTSPOT = 'X'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_LAYOUT-lights_fieldname = 'ICON'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IS_LAYOUT                = L_LAYOUT
        IT_FIELDCAT              = IT_FIELDCAT
      TABLES
        T_OUTTAB                 = ITAB
      EXCEPTIONS
        PROGRAM_ERROR            = 1
        OTHERS                   = 2.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards
    vijay

  • How to place one column under another column in obiee report?

    Hi all,
    I am new to obiee, so need some help from obiee experts. Can anyone tell me how to place one column data under another column in obiee report?
    i need the report to be as below
    category total_students Course_enrollment Test_attended pass_test
    total N % N % N %
    all students ##### ## ## ## ## ## ##
    Ethnicity
    Asian ###### ## ## ## ## ## ##
    African American ###### ## ## ## ## ## ##
    white ######
    Filipino ######
    Gender
    Male ##### ## ## ## ## ## ##
    Female ##### ## ## ## ## ## ##
    and similarly for other columns
    where ethnicity, gender are columns in the table and Course_enrollment, Test_attended, pass_test are calculated columns.
    Please help me to create a report as above if anyone knows how to do it.
    Edited by: Shailaja on Jul 19, 2010 12:23 AM

    Two ideas I can think of:
    1) Create multiple pivot tables and then display them one under the other
    2) Create multiple measure columns such as "male_amt", "female_amt", "white_amt", "asian_amt", "black_amt", etc. for all the columns you need. Then you could simple stack them in a single pivot table.
    Option #2 might give you the prettiest results - but also requires a lot more maintenance (for instance, if you reclassify ethnic groups, you'd have to go through the reports to add additional metric columns).
    Hope this helps,
    Scott

  • 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

  • How to add one column in existing search help.

    Hi Folks,
    My quesion is
    How to add one column in existing search help and also Now search help on that field is not an explicit search help. It should be implement using check table.
    Shivam

    Hi,
    If you want to add a field in Elementary search help, get the search help name for the and go to change mode and add the field in it.
    If you want to add a field in collective search help, go to included search helps tab and a new search help name and add the fields to it.
    I think this should help you to certain extent.
    Regards,
    Kranthi
    Edited by: Kranthi on Jan 14, 2010 11:15 AM

  • How to add one column to the standard t.code : CAT2.

    Hi,
    How to add one column to the standard t.code : CAT2.
    thanks

    Hi Chinna
    see the  enhancements by using SMOD <b>CATS0007</b> , or <b>CATS0012</b> and create a project using CMOD and you can implement your requirement.
    Hope This Info Helps YOU.
    <i>Reward Points If It Helps YOU.</i>
    Regards,
    Raghav

  • How to copy one column BLOB value into another column of another database.

    How to copy one column BLOB value into another column of another database.
    BLOB value contains word document.
    I thought of copy the BLOB value into a text file and then update the new column value by the same text in textfile. Will this work?
    Is there any other better way to do this?

    You're welcome
    BLOB fields contains binary data. I don't think you can do this
    Also if I view the BLOB as text. Can I copy it and insert into the new database.
    I think your options are as I said. Datapump or CTAS
    Best Regards

  • How to hide a column (clnt) in tableview using MVC?

    Hy,
    I would like, please if you cand help me: how to hide a column (clnt) in tableview using MVC for example on sflight table.
    Thanks

    Hi,
    You can use the below logic
    <htmlb:tableView id = "t1"
               visibleRowCount = "10"
               table = "<%= flights %>">
         <htmlb:tableViewColumns>
              <htmlb:tableViewColumn columnNamd = "carrid" />
              <htmlb:tableViewColumn columnNamd = "connid" />
              <htmlb:tableViewColumn columnNamd = "fldate" />
         </htmlb:tableViewColumns>
    </htmlb:tableView>
    define all the required columns using tableViewColumn tag.
    Regards,
    Ravi

Maybe you are looking for

  • IPod will not sync, and will not burn cds...

    1.) When I connect my iPod to the comp the syncing process starts. The little wheel my my ipod's name starts spinning, then slows down, then freezes and itunes stops responding. I have to hit crtaltdel to manually shut down itunes. Then, I have to cl

  • What's this status icon mean next to the battery???

    ok, so a new icom right next to the battery just showed up on my phone, and i have no idea what it is. that's pretty much what it looks like, kinda like a phone hung up on it's base, and 2 rows of dots underneith. It's alot smaller obviously and dire

  • Image source on network

    Hi, I can't use images which are not in the ressource folder ... And i need to access images from network, with a link like: \\Axpc2\doc\xx.jpg How can i do this ? Regards, Julien

  • Beginners tip: create new schema without SQL command

    Hey, i know this sounds so beginner's, but can i create a new Schema in which I can create tabels and tables.. without using SQL commands, I mean from the GUI of Oracle 9i?

  • Restore command fails

    hi I am trying to restore from files stored in the recovery_area but I have the wrong default channel configured, how can I tell it to use files on my disk for restoring. RMAN> restore database check read only; RMAN-00571: ===========================