Skip to Content
0
Sep 17, 2007 at 03:18 PM

CL_SALV column position ?

6030 Views

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( ).