cancel
Showing results for 
Search instead for 
Did you mean: 

Input fields in CL_GUI_ALV_GRID

jakob_steen-petersen
Active Participant
0 Kudos

Hi

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!

Regards

Jakob Steen-Petersen

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate

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.  

jakob_steen-petersen
Active Participant
0 Kudos

Hi

Thank you very much!! it was just what i needed!

Regards

Jakob Steen-Petersen