Skip to Content
Former Member
Dec 18, 2009 at 07:20 PM

Issue with Editable Cell in AVL Output


Hello Experts,

I have created an ALV report with Editable and Non-editable cells.

The report output looks like this:

Material Type Plan Qty GR Qty

10000    ZAB  100.50  200.65
10001    ZBC  200.07  500.98
10002    ZAB  456.02  589.23
10003    ZDR  798.30  423.90

When the Type is ZAB, I have to make the Plan Qty and GR Qty cells as editable.

So I wrote the code like this:

types: begin of ty_plan,
        matnr type matnr,
        mtype type zloc,
        pl_qt type zqty,
        gr_qt type zqty,
        cell_tab type lvc_t_styl,
       end of ty_plan.

data:   t_plan  type standard table of ty_plan,
           wa_plan  like line of t_plan.

For making the cells editable and non editable,

data: lt_celltab type lvc_t_styl.
  loop at t_plan into wa_plan.
    refresh lt_celltab.
    if wa_plan-mtype= 'ZAB'.
      perform fill_celltab using 'RW'
                        changing lt_celltab.

    wa_plan-cell_tab = lt_celltab.
    modify t_plan from wa_plan.


form fill_celltab using value(p_mode)
                  changing pt_celltab type lvc_t_styl.

  data: ls_celltab type lvc_s_styl,
        l_mode type raw4.

  if p_mode eq 'RW'.
    l_mode = cl_gui_alv_grid=>mc_style_enabled.
    l_mode = cl_gui_alv_grid=>mc_style_disabled.

  ls_celltab-fieldname = 'PL_QT'.
  ls_celltab-style = cl_gui_alv_grid=>l_mode.
  insert ls_celltab into table pt_celltab.

endform.                    " FILL_CELLTAB

Could you please let me know what went wrong?


Edited by: dev a on Dec 18, 2009 12:37 PM