Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

oo alv tree in background

Former Member
0 Kudos

can we schedule a oo alvtree report in background.


if cl_gui_alv_grid=>offline( ) is initial.
CREATE OBJECT g_container_object "cl_gui_docking_container
EXPORTING repid = gv_repid
dynnr = '100'
extension = '1500'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6 .
ENDIF.

CREATE OBJECT grid "cl_gui_alv_grid
EXPORTING
i_parent = g_container_object
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
.


* create Event Receiver
  CREATE OBJECT tree_event_receiver.
* create tree control
  CREATE OBJECT tree1
    EXPORTING
        i_parent              = g_container_object
        i_node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
        i_item_selection      = ''
        i_no_html_header      = ''
        i_no_toolbar          = ''
    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.
  IF sy-subrc <> 0.
*
  ENDIF.
* fields for tree
  PERFORM create_fieldcatlg.
  gs_layout_tree-s_dragdrop-row_ddid = g_handle_tree.
  SORT it_ftable BY progm.
  DELETE ADJACENT DUPLICATES FROM it_ftable COMPARING progm line.

  LOOP AT it_ftable INTO wa_ftable.
    INSERT INTO zrlschg1 VALUES wa_ftable.
    IF sy-subrc <> 0.
      WRITE 'not inserted'.
    ENDIF.
  ENDLOOP.

  CALL METHOD tree1->set_table_for_first_display
    EXPORTING
      it_list_commentary = gt_header[]
*      i_background_id    = 'ALV_BACKGROUND'
      is_layout          = gs_layout_tree
    CHANGING
      it_sort            = gt_sort[]
      it_outtab          = it_ftable[]
      it_fieldcatalog    = gt_fieldcat_lvc[].
  PERFORM add_toolbar.
  PERFORM register_event_tree.
  SET HANDLER tree_event_receiver->handle_double_click FOR tree1.
  SET HANDLER tree_event_receiver->handle_on_drag FOR tree1.

is it right

1 REPLY 1

franois_henrotte
Active Contributor
0 Kudos

no way

if you want to display a tree in a report (in the spool generated by the report, actually) you have to use RS_TREE_CONSTRUCT