Application Development and Automation 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: 
Read only

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

Former Member
0 Likes
490

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
Read only

Former Member
0 Likes
413

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

Check the Program BCALV_EDIT_02

1 REPLY 1
Read only

Former Member
0 Likes
414

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

Check the Program BCALV_EDIT_02