Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

hide column in alv grid

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In the field catalog set

no_out = 'X'

In PBO, modify field catalog

Eg:

FIELD-SYMBOLS : <lfs_fieldcat> TYPE lvc_s_fcat.

  LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.

    CASE <lfs_fieldcat>-fieldname.
      WHEN 'BUKRS'.
        <lfs_fieldcat>-coltext = text-003.
  <b>      <lfs_fieldcat>-no_out  = 'X'.</b>
     WHEN OTHERS.
    ENDCASE.
  ENDLOOP.

Hope this helps u.

9 REPLIES 9

Former Member
0 Kudos

Hi,

In the field catalog set

no_out = 'X'

In PBO, modify field catalog

Eg:

FIELD-SYMBOLS : <lfs_fieldcat> TYPE lvc_s_fcat.

  LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.

    CASE <lfs_fieldcat>-fieldname.
      WHEN 'BUKRS'.
        <lfs_fieldcat>-coltext = text-003.
  <b>      <lfs_fieldcat>-no_out  = 'X'.</b>
     WHEN OTHERS.
    ENDCASE.
  ENDLOOP.

Hope this helps u.

Former Member
0 Kudos

Hi,

The field is NO_OUT.

Svetlin

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Here is the sample code.

Field-symbols: <lfs_fieldcat> TYPE lvc_s_fcat.

LOOP AT p_fieldcat ASSIGNING <lfs_fieldcat>.

CASE <lfs_fieldcat>-fieldname.

WHEN 'AUSCH'.

<lfs_fieldcat>-coltext = text-011.

<lfs_fieldcat>-no_out = 'X'.

WHEN 'AUSCH_MEINS'.

<lfs_fieldcat>-coltext = text-012.

<lfs_fieldcat>-no_out = 'X'.

ENDCASE.

ENDLOOP.

0 Kudos

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 ??

Former Member
0 Kudos

Hi

Ensure that the Field catalog of that field has no_out = 'X'. This should work.

Murli

0 Kudos

Hi,

Thanks for your reply,

As I said, this I already set ,

do i need to explicitly set the field catalog to layout ??

Former Member
0 Kudos

I dont think it is required to be explicitly done. Just assign the Field catalog to the FM.

0 Kudos

Hi,

Okey this I am not doing at this time, to assign the field catalog to FM ??

Which FM u mean, would be nice if you pleae provide me with the signature and field of the FM to whom I can assign my Field catalog

Thanks

When I use tra se37 to see the signature of FM SET_TABLE_FOR_FIRST_DISPLAY, I cant see ??? how I come to know to which parameter of this method, I have to assign my field catalog ?

Message was edited by: Haider Syed

Okey I have found the signature,

CHANGING IT_FIELDCATALOG = pt_fieldcat.

BUT still it did not work :(-

, am I giving the column name correct ??

How to find the column name actually ??

Message was edited by: Haider Syed

0 Kudos

Do u guys think, that I have to define the column names in my field catalog, at this time I am using the structure, and FM SET_TABLE_FOR_FIRST_DISPLAY ??

Thanks

Okey Problem solved, thanks

Message was edited by: Haider Syed