Code: Alles auswählen.
CASE sy-ucomm.
WHEN 'EDIT'.
PERFORM hole_selektion CHANGING zeile.
LOOP AT gt_outtab INTO wa_outtab.
akt_index = sy-tabix.
CLEAR lt_celltab.
IF akt_index EQ zeile.
PERFORM fill_celltab USING 'RW' CHANGING lt_celltab.
ELSE.
PERFORM fill_celltab USING 'RO' CHANGING lt_celltab.
ENDIF.
CLEAR wa_outtab-celltab.
INSERT lines of lt_celltab INTO TABLE wa_outtab-celltab.
MODIFY gt_outtab FROM wa_outtab index akt_index.
ENDLOOP.
...
Code: Alles auswählen.
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.
ELSE. "p_mode eq 'RO'
l_mode = cl_gui_alv_grid=>mc_style_disabled.
ENDIF.
ls_celltab-fieldname = 'MANDT'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'PERNR'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'HANSP'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'ENDDA'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'BEGDA'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'LGART'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'ANWRT'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'DKKAP'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'WAERS'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'EDDAT'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'GREKA'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'RELRE'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'RUECK'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'BTZNR'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'REKLA'.
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ENDFORM. " fill_celltab