Hi,
check thse examples..
BCALV_TREE_01
BCALV_TREE_02
BCALV_TREE_03
BCALV_TREE_04
BCALV_TREE_05
BCALV_TREE_06
BCALV_TREE_DEMO
Regards
Vijay
Hi,
Check this link , here you have some tree alv examples.
http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm
Regards
Vijay
This method does not need a seperate screen but a selection screen is must. Data: dock_container type ref to cl_gui_docking_container, tree1 type ref to cl_gui_alv_tree_simple. *A docking container does not explicitly need a screen for it.It can be *placed on the selection screen itself.Here we are using the screen *which is used for the alvgrid. *First create a docking container with dock at left if dock_container is initial. create object dock_container exporting * PARENT = repid = g_repid dynnr = g_dynnr side = dock_container->dock_at_left extension = 300 * STYLE = * LIFETIME = lifetime_default * CAPTION = 'jkhbnjkhk' * METRIC = 4 * RATIO = 80 * NO_AUTODEF_PROGID_DYNNR = name = 'dockkkkkk' * EXCEPTIONS * CNTL_ERROR = 1 * CNTL_SYSTEM_ERROR = 2 * CREATE_ERROR = 3 * LIFETIME_ERROR = 4 * LIFETIME_DYNPRO_DYNPRO_LINK = 5 * others = 6 . endif. *Secondly create the field cat for the alv to be disp in dock container call function 'LVC_FIELDCATALOG_MERGE' exporting * I_BUFFER_ACTIVE = i_structure_name = 'ZC9_STRUCT' * I_CLIENT_NEVER_DISPLAY = 'X' * I_BYPASSING_BUFFER = changing ct_fieldcat = i_fcat[] * EXCEPTIONS * INCONSISTENT_INTERFACE = 1 * PROGRAM_ERROR = 2 * OTHERS = 3 . if tree1 is initial. *Thirdly create the tree1 object for the ALV with parent as docking *container create object tree1 exporting * I_LIFETIME = i_parent = dock_container * I_SHELLSTYLE = * I_NODE_SELECTION_MODE = *cl_gui_column_Tree=>NODE_SEL_MODE_SINGLE * I_HIDE_SELECTION = * I_ITEM_SELECTION = 'X' * I_NO_TOOLBAR = i_no_html_header = '' * I_PRINT = * 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 * others = 8 . *Finally create a tree with the below method. (Sort table need to be *passed) call method tree1->set_table_for_first_display exporting * I_BYPASSING_BUFFER = * I_BUFFER_ACTIVE = * I_CONSISTENCY_CHECK = i_structure_name = 'ZC9_STRUCT' it_list_commentary = pt_list_commentary i_logo = l_logo * IS_VARIANT = * I_SAVE = * I_DEFAULT = 'X' is_layout = gs_layout_tree * IS_PRINT = * IT_SPECIAL_GROUPS = * IT_TOOLBAR_EXCLUDING = * IT_HYPERLINK = * IT_ALV_GRAPHICS = * IT_EXCEPT_QINFO = changing it_outtab = itab[] * it_fieldcatalog = i_fcat1[] it_sort = gt_sort_grid[]
Add a comment