Code: Alles auswählen.
DATA: w_node_text TYPE lvc_value,
wa_mast TYPE edidc,
w_icon TYPE string,
t_item_layout TYPE lvc_t_layi,
t_item_lay TYPE lvc_s_layi.
t_item_lay-fieldname = tree->c_hierarchy_column_name.
t_item_lay-style = cl_gui_column_tree=>style_intensified.
APPEND t_item_lay TO t_item_layout.
w_node_text = 'Knotentext'.
w_icon = '@3P@'.
DATA: relat TYPE int4.
relat = cl_gui_column_tree=>relat_last_child.
DATA: w_node TYPE lvc_s_layn.
w_node-n_image = w_icon.
w_node-exp_image = w_icon.
"Knoten hinzufügen
CALL METHOD tree->add_node
EXPORTING
i_relat_node_key = ''
i_relationship = relat
i_node_text = w_node_text
is_outtab_line = wa_mast
is_node_layout = w_node
it_item_layout = t_item_layout
IMPORTING
e_new_node_key = w_head_key.
MOVE w_head_key TO wa_head_keys-node_key.
APPEND wa_head_keys TO t_head_keys.
CLEAR wa_head_keys.