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

How to make ALV input enabled - defined from structure

Former Member
0 Likes
486

Hello experts,

I know how to define column input enabled from field catalog, but how to do it if I use structure for definition.

I tried something like this, but it will add a new column, not change the old one:

CLEAR wa_fcat.

MOVE 'Name1' TO wa_fcat-fieldname.

MOVE 'ZTABLE01' TO wa_fcat-REF_TABLE.

MOVE 'Column1' TO wa_fcat-REF_FIELD.

MOVE 'X' TO wa_fcat-edit.

APPEND wa_fcat TO it_fcat.

call function 'LVC_FIELDCATALOG_MERGE'

exporting

i_structure_name = 'ZTABLE01'

changing

ct_fieldcat = it_fcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3.

How to change my source code?

Thanks a lot.

Regards,

Radek

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
446

Hi, plese try this one:

field-symbols: <ls_fcat> type lvc_s_fcat. " if the Fieldcatalog is from Type lvc_t_fcat.

read table it_fcat assigning <ls_fcat> with key fieldname = <your field>.

if sy-subrc is initial.

<ls_fcat>-edit = 'X'.

endif.

...

I hopre, it helps you excelent.

Sincerely, yours, Lubomir.

Hello experts,

I know how to define column input enabled from field catalog, but how to do it if I use structure for definition.

I tried something like this, but it will add a new column, not change the old one:

CLEAR wa_fcat.

MOVE 'Name1' TO wa_fcat-fieldname.

MOVE 'ZTABLE01' TO wa_fcat-REF_TABLE.

MOVE 'Column1' TO wa_fcat-REF_FIELD.

MOVE 'X' TO wa_fcat-edit.

APPEND wa_fcat TO it_fcat.

call function 'LVC_FIELDCATALOG_MERGE'

exporting

i_structure_name = 'ZTABLE01'

changing

ct_fieldcat = it_fcat

exceptions

inconsistent_interface = 1

program_error = 2

others = 3.

How to change my source code?

Thanks a lot.

Regards,

Radek

1 REPLY 1
Read only

Former Member
0 Likes
447

Hi, plese try this one:

field-symbols: <ls_fcat> type lvc_s_fcat. " if the Fieldcatalog is from Type lvc_t_fcat.

read table it_fcat assigning <ls_fcat> with key fieldname = <your field>.

if sy-subrc is initial.

<ls_fcat>-edit = 'X'.

endif.

...

I hopre, it helps you excelent.

Sincerely, yours, Lubomir.