2007 Jul 06 7:05 PM
Hi all,
Is it possible to use any Tree Control and make some fields editable?
I was trying with CL_GUI_ALV_TREE, but when i set the field 'editable' of lvc_s_layi to 'X' an ABAP-Shortdump occurs.
Some help?
Thanks.
2007 Jul 06 7:44 PM
Hi,
Check this code :
create object g_alv_tree
exporting
parent = g_custom_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple
item_selection = 'X'
no_html_header = 'X'
no_toolbar = ''
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
if sy-subrc <> 0.
endif.
perform build_fieldcatalog.
call method g_alv_tree->set_table_for_first_display
exporting
is_hierarchy_header = l_hierarchy_header
changing
it_fieldcatalog = gt_fieldcatalog
it_outtab = gt_sflight.
form build_fieldcatalog.
data: ls_fieldcatalog type lvc_s_fcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'SFLIGHT'
changing
ct_fieldcat = gt_fieldcatalog.
loop at gt_fieldcatalog into ls_fieldcatalog.
case ls_fieldcatalog-fieldname.
when 'CARRID' or 'FLDATE'.
ls_fieldcatalog-edit = 'X'. "<< need to edit the field
endcase.
modify gt_fieldcatalog from ls_fieldcatalog.
endloop.
endform. " build_fieldcatalog
aRs
2007 Jul 09 4:34 PM