Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALVGrid:Making protected key fields as editable when adding a new entry

Hi colleagues,

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'

EXPORTING

i_structure_name = iv_tabname

CHANGING

ct_fieldcat = rt_fcat

EXCEPTIONS

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.

ENDIF.

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,

Former Member
Former Member replied

that you need to control using the Styles(Enable/Disable).

Check the Program BCALV_EDIT_02

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question