Skip to Content

cl_salv_tree - left docking window to be hide

Hi,

I am using cl_salv_tree in a docking container. ie left and right docking. I have button on the toolbar of the report . if user clicks on the button the left docking to be hide and right docking stays as it is.

Here is my code

  g_repid = sy-repid.

  create object g_docking_container_1
    exporting
      repid     = g_repid
      dynnr     = '300'
      extension = 220
      side      = cl_gui_docking_container=>dock_at_left.

  create object g_docking_container_2
    exporting
      repid     = g_repid
      dynnr     = '300'
      extension = 960
      side      = cl_gui_docking_container=>dock_at_right.

* Tree Calls
  try.
      call method cl_salv_tree=>factory
        exporting
          r_container = g_docking_container_1
        importing
          r_salv_tree = grt_tree
        changing
          t_table     = i_ysccalv3.
    catch cx_salv_no_new_data_allowed cx_salv_error.
      exit.
  endtry.

  grt_functions = grt_tree->get_functions( ).
  grt_functions->set_all( abap_true ).

  grt_functions->set_aggregation_average( abap_false ).
  grt_functions->set_aggregation_maximum( abap_false ).
  grt_functions->set_aggregation_minimum( abap_false ).
  grt_functions->set_aggregation_total( abap_false ).
  grt_functions->set_group_aggregation( abap_false ).
  grt_functions->set_group_layout( abap_false ).
  grt_functions->set_group_print( abap_false ).
  grt_functions->set_layout_change( abap_false ).
  grt_functions->set_layout_load( abap_false ).
  grt_functions->set_layout_maintain( abap_false ).
  grt_functions->set_layout_save( abap_false ).
  grt_functions->set_print_all( abap_false ).
  grt_functions->set_print_view( abap_false ).
  grt_functions->set_print_all_preview( abap_false ).
  grt_functions->set_print_view_preview( abap_false ).
  grt_functions->set_help( abap_false ).

  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( text-102 ).
  grt_column->set_visible( abap_false ).
  grt_column ?= grt_columns->get_column( text-103 ).
  grt_column->set_visible( abap_false ).
  grt_column ?= grt_columns->get_column( text-105 ).
  grt_column->set_visible( abap_false ).
  grt_column ?= grt_columns->get_column( text-106 ).
  grt_column->set_visible( abap_false ).
  grt_column ?= grt_columns->get_column( text-107 ).
  grt_column->set_visible( abap_false ).

  try.
      v_text1 = text-b01.
      v_text2 = text-b02.

      grt_functions->add_function(
        name     = 'MYFUNCTION'
        icon     = '@42@'
        tooltip  = v_text2
        position = if_salv_c_function_position=>right_of_salv_functions
).
    catch cx_salv_wrong_call cx_salv_existing.
  endtry.

  perform f_build_tree_header.
  perform f_build_tree_info.
  perform f_build_tree_events.

  grt_tree->display( ).

* Column Calls
  gs_layout-grid_title = text-101.

  try.
      call method cl_salv_table=>factory
        exporting
          r_container  = g_docking_container_2
        importing
          r_salv_table = gr_table
        changing
          t_table      = i_ysccalv4.
    catch cx_salv_msg.
  endtry.

  gr_functions = gr_table->get_functions( ).
  gr_functions->set_all( abap_true ).

  gr_display = gr_table->get_display_settings( ).
  gr_display->set_striped_pattern( cl_salv_display_settings=>true ).

  gr_columns = gr_table->get_columns( ).
  gr_column ?= gr_columns->get_column( text-102 ).
  gr_column->set_visible( abap_false ).
  gr_columns->set_optimize( abap_true ).

  try.
      gr_column ?= gr_columns->get_column( text-103 ).
      gr_column->set_cell_type( if_salv_c_cell_type=>hotspot ).
    catch cx_salv_not_found.
  endtry.

  gr_sorts = gr_table->get_sorts( ).
  gr_sorts->add_sort( columnname = text-103 subtotal = abap_false ).

  gr_layout = gr_table->get_layout( ).
  key-report = sy-repid.
  gr_layout->set_key( key ).
  gr_layout->set_save_restriction( cl_salv_layout=>restrict_none ).
  perform f_build_column_events.

  gr_table->display( ).

Any info?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jan 31, 2008 at 04:52 PM

    I got it.

    Here is solution. we need to call this method

      call method g_docking_container_1->set_visible
           exporting
                visible           = ' '
           exceptions
                cntl_error        = 1
                cntl_system_error = 2
                others            = 3.
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.