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: 

Hiding an ALV column

Former Member
0 Kudos
2,233

Hi,

I want to hide a column from an ALV grid. I have tried setting the NO_OUT attribute of the ALV structure LVC_S_FCAT to 'X' but still the column is displayed.

Can you please help.

Thank you.

\[removed by moderator\]

Edited by: Jan Stallkamp on Jul 17, 2008 12:33 PM

1 ACCEPTED SOLUTION

former_member787646
Contributor
0 Kudos
448

Hi

Set the following attributes for the field you want to hide in Field Catalog.

1. FIELDNAME = <field in the internal table>

2. NO_OUT = 'X'

3. TECH = 'X'.

Hope this would help you.

Murthy

13 REPLIES 13

former_member125931
Active Participant
0 Kudos
448

Remove that field from fill_fieldcatalog.

0 Kudos
448

Hi,

Probably you mean that I remove the column from the field catalog internal table. In my system, I found that this internal table is being built using function LVC_FIELDCATALOG_MERGE. I tried deleting the entry for the column I want to hide from this internal table but still the column is appearing on the screen.

Thank you.

Former Member
0 Kudos
448

Hi,

Comment the particular field from fieldcat which u din't want otherwise

Right click the label of particular field hide it

create a variable for the ALV layouy assign it.

Edited by: prabhu p on Jul 17, 2008 11:23 AM

0 Kudos
448

Hi Prabhu,

1. By commenting the field from the field catalog, do you mean commenting the code which is used to set the attributes for the column? If yes, then I have already done so and still the column gets displayed.

2. You talk about right-clicking the label of the field and then creating variable for the ALV layout. Where or in which transaction do I have to do this?

If you can elaborate on the points mentioned by you, it will be of much help.

Thank you.

0 Kudos
448

Hi,

After execute in that output u need to right click select hide

that field will disappear then u have to create a variant for this layout.

all this process u need to do only on output..

0 Kudos
448

Hi Prabhu,

Thank for your answer. It was helpful but I am looking for something that hides the field automatically. The solution you are proposing would involve manual processing. Moreover, if I am correct, this solution would not let me hide the fild based on some condition.

former_member787646
Contributor
0 Kudos
449

Hi

Set the following attributes for the field you want to hide in Field Catalog.

1. FIELDNAME = <field in the internal table>

2. NO_OUT = 'X'

3. TECH = 'X'.

Hope this would help you.

Murthy

0 Kudos
448

Hi Murthy,

After setting TECH = 'X', the column was not displayed. Thanks a lot for your answer.

Can you also tell me what is the signifiance of this attribute? Why doesn't simply setting NO_OUT to 'X' hide the column?

Former Member
0 Kudos
448

Hi Murthy,

After setting TECH = 'X', the column was not displayed. Thanks a lot for your answer.

Can you also tell me what is the signifiance of this attribute? Why doesn't simply setting NO_OUT to 'X' hide the column?

0 Kudos
448

Hi

If we set the attribute NO_OUT then the field will not be displayed in the ALV Grid. But the Field will be

available for the End User to select the Column in Selection dialogs (Where the user can choose Columns

from the the GRID toolbar) .

If we set the both the attribute NO_OUT and TECH then the field will not be displayed in the ALV Grid and

also in Selection dialogs.

Hope this would help you.

Murthy

0 Kudos
448

Hi Murthy,

Thanks. It really helped.

Can I ask you one more question. If I have to add a new field to the ALV grid, how can I do that?

I have added the new field to the standard grid structure. Do I have to do perform some more actions before the field starts appearing on the screen?

0 Kudos
448

Hi

First Define a structure with the new field and other fields.

Eg.

Data: BEGIN OF ITAB OCCURS 0.

Data: My_Field(30) type c.

Include Structure Scarr.

Data: END OF ITAB.

You have to manually append this new field in the Field Catalog Internal Table as Follows

IT_FCAT-FIELDNAME = 'My_Field'

IT_FCAT-COLTEXT = 'MY COLUMN'.

IT_FCAT-COLPOS = 1.

APPEND IT_FCAT.

This Field Catalog Internal table should be set to the respective parameter in "SET_TABLE_FOR_FIRST_DISPLAY".

Hope this would help you.

Murthy

0 Kudos
448

Hi Murthy,

After adding the field to the standard grid structure, it is already coming in the field catalog internal table and this internal table is being passed to SET_TABLE_FOR_FIRST_DISPLAY also. So, I think that there's no need to add anything to the field catalog but the problem lies somewhere else.