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: 

ALV - Hiding Field

Former Member
0 Kudos

Hi All,

I have a simple report in which several fields are in internal table from which the first field i dont want to display. I am setting the value for NO_OUT = 'X'. Still it is displaying the field.

Code I used:

DATA : int_fcat TYPE slis_t_fieldcat_alv,

wa_fcat type slis_fieldcat_alv.

loop at int_fcat into wa_fcat.

CASE wa_fcat-col_pos.

when 1.

wa_fcat-no_out = 'X'.

endcase.

modify int_fcat from wa_fcat.

endloop.

Can anyone suggest me?? It would be very much helpful.

Thanks,

Jignesh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Do you fill the <b>col_pos</b> field in your code ? At what point do you want to hide the colunm - before the first display or you want to refresh the list ?

Svetlin

5 REPLIES 5

Former Member
0 Kudos

Hi,

Do you fill the <b>col_pos</b> field in your code ? At what point do you want to hide the colunm - before the first display or you want to refresh the list ?

Svetlin

0 Kudos

See if the KEY is on for that field. KEY fields cannot be hidden.

Regards,

Ravi

Note : Please reward, if the answer is helpful.

Former Member
0 Kudos

Hi,

try this

DATA : int_fcat TYPE slis_t_fieldcat_alv,

wa_fcat type slis_fieldcat_alv.

loop at int_fcat into wa_fcat.

<b>*instead of col_pos put fieldname</b>

CASE wa_fcat-fieldname.

<b>" here give the fieldname which you dont want to show</b>

when 'fieldname'.

wa_fcat-no_out = 'X'.

endcase.

modify int_fcat from wa_fcat.

endloop.

what ever fields you dont want to display do this way

when 'fieldname1'.

wa_fcat-no_out = 'X'.

when 'fieldname2'.

wa_fcat-no_out = 'X'.

when 'fieldname3'.

wa_fcat-no_out = 'X'.

col_pos is used to show the position of the field in grid

to change the position........

when 'fieldname3'.

wa_fcat-col_pos = 2.

here fieldname3 displays second position in the grid.

hope this helps you

reward with points and close the thread if your question is solved

regards,

venu.

Former Member
0 Kudos

try 'tech' attribute of fieldcatalog.

wa_fcat-tech = 'X'.

Regards,

suresh

Former Member
0 Kudos

Thank All,

Your answers were helpful.

Thanks Again !!!!!!!!!!!

- Jignesh