2010 Feb 22 4:28 PM
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
2010 Feb 24 11:12 AM
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
2010 Feb 24 11:12 AM
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.