Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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,

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

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

Check the Program BCALV_EDIT_02

1 REPLY 1

former_member188685
Active Contributor
0 Kudos

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

Check the Program BCALV_EDIT_02