2007 Sep 17 4:18 PM
Hi,
I am using a Object Model )SALV) inside a docking container . My problem is how align the columns in the tree
I have internal table i_ynatic that contains the following fields in this order
1. mandt
2. dcode
3. tcode
4. ctcno
5. tversn.
My requirement is in the tree i am removing the MANDT, DCODE, TCODE , and i need
fields to be displayed in the following order ie TVERSN then CTCNO
I checked the class "cl_salv_column_tree" for column position,(just like COL_POS) in the field catalog. but i could not ,
Anybody have info on how to position the field columns in the tree?
create object g_docking_container_2
exporting
repid = g_repid
dynnr = '300'
extension = 160
side = cl_gui_docking_container=>dock_at_top.
call method cl_salv_tree=>factory
exporting
r_container = g_docking_container_1
importing
r_salv_tree = grt_tree
changing
t_table = i_ynatic.
grt_functions = grt_tree->get_functions( ).
grt_functions->set_all( abap_true ).
grt_display = grt_tree->get_tree_settings( ).
grt_nodes = grt_tree->get_nodes( ).
grt_columns = grt_tree->get_columns( ).
grt_column ?= grt_columns->get_column( 'MANDT' ).
grt_column->set_visible( abap_false ).
grt_column ?= grt_columns->get_column( 'DCODE' ).
grt_column->set_visible( abap_false ).
grt_column ?= grt_columns->get_column( 'TCODE' ).
grt_column->set_visible( abap_false ).
perform f_build_tree_header.
perform f_build_tree_info.
perform f_build_tree_events.
grt_tree->display( ).
a®
2007 Sep 17 4:27 PM
Hi,
Check REPORT 'SALV_DEMO_TREE_FUNCTIONS' , it will solve your problem.
Reward points if useful....
-Umesh
2007 Sep 17 4:27 PM
Hi,
Check REPORT 'SALV_DEMO_TREE_FUNCTIONS' , it will solve your problem.
Reward points if useful....
-Umesh
2007 Sep 17 4:32 PM
Hi,
Problem solved
I am looking at wrong class. Here is the correction code
data: grt_columns type ref to cl_salv_columns,
grt_column type ref to cl_salv_column.
grt_columns = gr_tree->get_columns( ).
grt_columns->set_optimize( abap_true ).
grt_columns->set_column_position( columnname = 'TVERSN'
position = 1 ).
grt_columns->set_column_position( columnname = 'CTCNO'
position = 2 ).
a®