ALVGrid:Making protected key fields as editable when adding a new entry
I would like my ALV Grid to work like a maintenance view: only non key fields are available for editing, but when click the ALV toolbar button for adding a new entry, all fields of this entry should be editable!
For now I have the following code:
DATA: ls_fcat TYPE lvc_s_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
i_structure_name = iv_tabname
ct_fieldcat = rt_fcat
OTHERS = 0.
IF iv_edit = lcl_dialog_const=>gc_true.
set special values
ls_fcat-edit = lcl_dialog_const=>gc_true.
modify rt_fcat from ls_fcat transporting edit
where key = lcl_dialog_const=>gc_false.
With this code I get the key fields blocked for editing even with a new record.
I would appreciate a tip for solving this issue!
Thanks and best regards,
that you need to control using the Styles(Enable/Disable).
Check the Program BCALV_EDIT_02