‎2008 Feb 18 4:46 PM
Hello experts,
some time ago I posted the thread: in order to disable an ALV grid column for user input.
How can I disable the column even if the user adds a new row to the editable ALV Grid control?
and
How can I show in the disabled column information that is read from the database during user input? For instance, if the user presses ENTER?
Thanks for your help! Obviously, points will be rewarded.
Manuel
‎2008 Apr 23 7:40 AM
Hi
U need to go for styles in alv grid. U can define a style for each cell in which u can manage editable or disable in that.
This u can handle in PBO each time conditionally. See the below code.
Add one field in your output internal table as below for populating the style.
CELLTAB TYPE LVC_T_STYL, " for input enabling the cell.
This is a table type. U need to populate this field in each row with its type to enabled or disabled as below and style for which field in your internal table. Here it is WERKS.
CELLTAB-FIELDNAME = 'WERKS'.
CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
or
CELLTAB-FIELDNAME = 'WERKS'.
CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED
insert this table in the field CELLTAB of your internal table.
in each row.
And populate the layout with style field name. Here our field is CELLTAB.
GS_LAYOUT-STYLEFNAME = 'CELLTAB'.
GS_LAYOUT-EDIT = GC_X.
This can solve ur problem
Venkat.
‎2008 Apr 23 7:40 AM
Hi
U need to go for styles in alv grid. U can define a style for each cell in which u can manage editable or disable in that.
This u can handle in PBO each time conditionally. See the below code.
Add one field in your output internal table as below for populating the style.
CELLTAB TYPE LVC_T_STYL, " for input enabling the cell.
This is a table type. U need to populate this field in each row with its type to enabled or disabled as below and style for which field in your internal table. Here it is WERKS.
CELLTAB-FIELDNAME = 'WERKS'.
CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
or
CELLTAB-FIELDNAME = 'WERKS'.
CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED
insert this table in the field CELLTAB of your internal table.
in each row.
And populate the layout with style field name. Here our field is CELLTAB.
GS_LAYOUT-STYLEFNAME = 'CELLTAB'.
GS_LAYOUT-EDIT = GC_X.
This can solve ur problem
Venkat.
‎2008 Apr 24 1:29 PM
hi,
will you please elaborate your query .
so that at what scenario you need to disable the column.
Regards,
Madhavi