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: 

CL_GUI_ALV_GRID making content of cells invisible

Former Member
0 Kudos

Is is possible to make the content of specific cells invisible?

3 REPLIES 3

Former Member
0 Kudos

HI,

ya there is a field in catalog,need to set it

fieldcat-no_out = 'X'

Try this.

0 Kudos

I didn't mean to make an entire column invisible, I want to make certain cells of a specific column invisible.

0 Kudos

Hi Karl

You cannot make a particular column invisible,however you can make it input enabled or input disabled by dynamically adjusting the style.The code is as below :

1. add the following data to your main internal table

TYPES: celltab TYPE lvc_t_styl. "Layout style

2.FORM zf_fill_celltab USING p_mode TYPE any

CHANGING pt_celltab TYPE lvc_t_styl.

DATA: ls_celltab TYPE lvc_s_styl,

ls_mode TYPE raw4.

  • This forms sets the style of columns editable or non-editale

IF p_mode EQ 'RW'.

ls_mode = cl_gui_alv_grid=>mc_style_enabled.

ELSE. "p_mode eq 'RO'

ls_mode = cl_gui_alv_grid=>mc_style_disabled.

ENDIF.

  • Required

ls_celltab-fieldname = 'ANLN1'. "Main Asset Number

ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.

INSERT ls_celltab INTO TABLE pt_celltab.

ls_celltab-fieldname = 'ANLN2'. "Asset Subnumber

ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.

INSERT ls_celltab INTO TABLE pt_celltab.

endform.