2008 Jul 17 10:14 AM
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
2008 Jul 17 10:41 AM
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
2008 Jul 17 10:20 AM
2008 Jul 17 10:27 AM
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.
2008 Jul 17 10:22 AM
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
2008 Jul 17 10:32 AM
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.
2008 Jul 17 10:37 AM
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..
2008 Jul 17 10:43 AM
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.
2008 Jul 17 10:41 AM
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
2008 Jul 17 10:44 AM
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?
2008 Jul 17 10:46 AM
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?
2008 Jul 17 10:51 AM
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
2008 Jul 17 10:58 AM
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?
2008 Jul 17 11:06 AM
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
2008 Jul 17 11:15 AM
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.