Skip to Content

Input fields in CL_GUI_ALV_GRID


Is it possible to open specific fields for input using the Class CL_GUI_ALV_GRID. It seems that i can open a hole column, but in some of the rows i do not want the fields open!


Jakob Steen-Petersen

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Nov 21, 2003 at 05:27 PM

    The process is very similar to the one for setting a exception light at the row level in an ALV grid. First add an structure of type lvc_t_styl to your data table you will be passing to the it_outttab parameter of the alv grid. Lets call this structure CELL_TYPE for now. You then need to fill in the stylefname variable of your layout structure (type lvc_s_layo) that you pass to the is_layout paramter of the alv grid. You have now told the ALV grid where to go to look for your cell level style information.

    Next we need to set the style per cell. As you loop through your ALV grid data table checking your criteria, you will want to set your values into CELL_TYPE. For each row you can set the CELL_TYPE field name using variable FIELDNAME. You can then set the STYLE variable using either cl_gui_alv_grid=>mc_style_disabled or cl_gui_alv_grid=>mc_style_enabled.

    We have an SAP example program, BCALV_EDIT_02, in our 46C system that I studied before I wrote my first program that did this.

    Add comment
    10|10000 characters needed characters exceeded