OOPS ABAP ALV REPORT USING SPLITTER CONTAINER

******************************************************************************
" SPLITTER CONTAINER IS USED TO EXHIBIT DATA FROM MULTIPLE TABLES/ SINGLE TABLE
" IN AN ALV PATTERN WITH IN A SINGLE CONTAINER.

********************************************************************************

REPORT zoops_alv_splitter.

INCLUDE zoops_alv_splitter_top.      " DECLARATIONS FOR INTERNAL TABLE AND OBJECTS OF CLASS


*&---------------------------------------------------------------------*
*&  Include           ZOOPS_ALV_SPLITTER_TOP
*&---------------------------------------------------------------------*

DATA ORIGINAL_CONTAINER TYPE REF TO  CL_GUI_CUSTOM_CONTAINER.
DATA SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER .

DATA CONTAINER1 TYPE REF TO CL_GUI_CONTAINER.
DATA CONTAINER2 TYPE REF TO CL_GUI_CONTAINER.

DATA DISPLAY1 TYPE REF TO CL_GUI_ALV_GRID.
DATA DISPLAY2  TYPE REF TO CL_GUI_ALV_GRID.

DATA I_VTTK TYPE TABLE OF VTTK .
DATA I_VTTP TYPE TABLE OF VTTP .

 
START-OF-SELECTION .
  CALL SCREEN 100.        " GO TO SCREEN 100 AND CREATE A CONTAINER WITH NAME ORIGINAL_CONTAINER




*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.
  PERFORM create_objects.
  PERFORM split_main_cont.
  PERFORM display1 .
  PERFORM display2.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Form  CREATE_OBJECTS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM create_objects .
  CREATE OBJECT original_container
    EXPORTING
      container_name              'ORIGINAL_CONTAINER'.

ENDFORM.                    " CREATE_OBJECTS
*&---------------------------------------------------------------------*
*&      Form  SPLIT_MAIN_CONT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM split_main_cont .
  CREATE OBJECT splitter
    EXPORTING
      parent            original_container
      rows              2
      columns           .
  CALL METHOD splitter->get_container
    EXPORTING
      row       1
      column    1
    RECEIVING
      container container1.
  CALL METHOD splitter->get_container
    EXPORTING
      row       2
      column    1
    RECEIVING
      container container2.




ENDFORM.                    " SPLIT_MAIN_CONT
*&---------------------------------------------------------------------*
*&      Form  DISPLAY1
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM display1 .

  SELECT *  FROM vttk
     INTO TABLE i_vttk UP TO 500 ROWS .

  CREATE OBJECT display1
    EXPORTING
      i_parent          container1.

  CALL METHOD display1->set_table_for_first_display
    EXPORTING
      i_structure_name 'VTTK'
    CHANGING
      it_outtab        i_vttk.

ENDFORM.                                                    " DISPLAY1
*&---------------------------------------------------------------------*
*&      Form  DISPLAY2
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM display2 .

  SELECT *  FROM vttp
     INTO TABLE i_vttp UP TO 300 ROWS .

  CREATE OBJECT display2
    EXPORTING
      i_parent          container2.

  CALL METHOD display2->set_table_for_first_display
    EXPORTING
      i_structure_name 'VTTP'
    CHANGING
      it_outtab        i_vttp.

ENDFORM.                                                    " DISPLAY2


OUTPUT