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: 

ALV Tree editable

Former Member
0 Kudos
117

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.

2 REPLIES 2

former_member194669
Active Contributor
0 Kudos
49

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

0 Kudos
49

Hi,

I tried your code, but it didn't work.

Any other ideas???