07-07-2010 12:54 PM
Hi,
I have a requirement to add the push buttons in the list items (In cells/ Rows) of ALV TREE.
I am using the class cl_gui_alv_tree for creating the tree.
It is possible to add a pushbutton in the ALV Grid (cl_gui_alv_grid) using the layout parameter in SET_TABLE_FOR_FIRST_DISPLAY method.
But in the class method cl_gui_alv_tree-SET_TABLE_FOR_FIRST_DISPLAY, we dont have the import parameter LAYOUT for enabling the push button.
Any isseas/ comments are most welcome.
07-07-2010 2:16 PM
Solved by myself after some research work... Pl find the code snippet below,
DATA: ls_item_layout TYPE lvc_s_layi.
ls_item_layout-style = cl_gui_column_tree=>style_intensified.
ls_item_layout-class = cl_gui_column_tree=>item_class_button.
ls_item_layout-fieldname = tree->c_hierarchy_column_name.
APPEND ls_item_layout TO lt_item_layout.
l_node_text = 'Sample'.
relat = cl_gui_column_tree=>relat_last_child.
CALL METHOD tree->add_node
EXPORTING
i_relat_node_key = key1
i_relationship = relat
i_node_text = l_node_text
is_outtab_line = lw_outtab
is_node_layout = ls_node_layout
it_item_layout = lt_item_layout
IMPORTING
e_new_node_key = p_ab_key.
Simple!!!!
07-07-2010 2:16 PM