2014 Jul 29 2:15 PM
Hi Gurus,
My problem the follow:
I create an alv grid(with REUSE_ALV_GRID_DISPLAY FM) which not all cell is filled. I'd like that the user will be modify ONLY the empty cells.
Do you have any idea?
Header 1 | Header 2 | Header 3 |
---|---|---|
110 | The user like to modify this | 220 |
The user like to modify this | 32 | The user like to modify this |
10 | 54 |
So I able to the user modify the all or any cell. But I need that the user should be the red one.
Really thanks,
Mark
2014 Jul 29 3:24 PM
Hi Mark
Maybe you need modify your report a little:
1,To add this field 'field_style TYPE lvc_t_styl' to your output internal table, this field can control the cell editable or not.
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
2, Looping the output itab, modify this field if the cell is empty,
IF wa_itab-x IS NOT INITIAL.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
ELSE.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
ENDIF.
APPEND ls_stylerow TO wa_itab-field_style.
MODIFY itab.
3, To set the layout 'gd_layout-stylefname = 'FIELD_STYLE'.'
4, Using this FM 'REUSE_ALV_GRID_DISPLAY_LVC' to call ALV, set the fieldcat and layout.
regards,
Archer
2014 Jul 29 3:24 PM
Hi Mark
Maybe you need modify your report a little:
1,To add this field 'field_style TYPE lvc_t_styl' to your output internal table, this field can control the cell editable or not.
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
2, Looping the output itab, modify this field if the cell is empty,
IF wa_itab-x IS NOT INITIAL.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
ELSE.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
ENDIF.
APPEND ls_stylerow TO wa_itab-field_style.
MODIFY itab.
3, To set the layout 'gd_layout-stylefname = 'FIELD_STYLE'.'
4, Using this FM 'REUSE_ALV_GRID_DISPLAY_LVC' to call ALV, set the fieldcat and layout.
regards,
Archer
2014 Jul 29 6:28 PM
Hi Mark,
Dengyong answer is correct, maybe its just missing one little thing as shown below in bold...
1. Add field 'field_style TYPE lvc_t_styl' to your output internal table. This field will set the cell to editable or not.
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
2, Looping at the output itab, modify this field if the cell is empty.
ls_stylerow-fieldname = '[itab fieldname]'.
IF wa_itab-x IS NOT INITIAL.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
ELSE.
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled.
ENDIF.
APPEND ls_stylerow TO wa_itab-field_style.
MODIFY itab.
3, To set the layout 'gd_layout-stylefname = 'FIELD_STYLE'.'
4, Using this FM 'REUSE_ALV_GRID_DISPLAY_LVC' to call ALV, set the fieldcat and layout.
2014 Jul 30 3:56 AM