Application Development and Automation 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: 
Read only

multiple grid in alv

Former Member
0 Likes
858

Hi Friends,

Is it possible in call 2 alv grid in a same time by using simple alv function module??

Hi Friends,

Is it possible in call 2 alv grid in a same time by using simple alv function module??

5 REPLIES 5
Read only

Former Member
0 Likes
789

please use alv block display for this

important FM

REUSE_ALV_BLOCK_LIST_APPEND

REUSE_ALV_BLOCK_LIST_INIT

regards

shiba dutta

Read only

Former Member
0 Likes
789

Hi,

it's possible to do it using custom containers,

create 2 custom containers & use REUSE_ALV_GRID_DISPLAY .

have a look at DWDM transaction,

& VF44 transaction .

Regards,

Raghavendra

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
789

Hi,

If you want multiple grid in same screen,you need to use splitter container to achieve the same.

CL_GUI_EASY_SPLITTE_CONTAINER is the class which is used to split the screen into parts.In that you need to use cl_GUI_ALV_GRID to display ALV output.

Read only

uwe_schieferstein
Active Contributor
0 Likes
789

Hello Salil

I do not know how much work it is to display several ALV lists using function modules (since I do not use them at all) but using the ABAP-OO approach your task is just a piece of cake (see coding below). The sample report display three ALV lists at the same time.

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_ALV_GRID_SPLITTER
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_alv_grid_splitter.



DATA:
  gt_t001         TYPE STANDARD TABLE OF t001,
  gt_kna1         TYPE STANDARD TABLE OF kna1,
  gt_knb1         TYPE STANDARD TABLE OF knb1.

DATA:
  go_docking      TYPE REF TO cl_gui_docking_container,
  go_splitter     TYPE REF TO cl_gui_splitter_container,
  go_splitter_1   TYPE REF TO cl_gui_splitter_container,
  go_cell_left    TYPE REF TO cl_gui_container,
  go_cell_right   TYPE REF TO cl_gui_container,
  go_cell_top     TYPE REF TO cl_gui_container,
  go_cell_bottom  TYPE REF TO cl_gui_container,
  go_grid_top     TYPE REF TO cl_gui_alv_grid,
  go_grid_bottom  TYPE REF TO cl_gui_alv_grid,
  go_grid_right   TYPE REF TO cl_gui_alv_grid.



START-OF-SELECTION.

  SELECT * FROM  t001 INTO TABLE gt_t001.
  SELECT * FROM  kna1 INTO TABLE gt_kna1.
  SELECT * FROM  knb1 INTO TABLE gt_knb1.



  CREATE OBJECT go_docking
    EXPORTING
      parent                      = cl_gui_container=>screen0
*      REPID                       =
*      DYNNR                       =
       side                        =
             cl_gui_docking_container=>dock_at_left
*      EXTENSION                   = 50
*      STYLE                       =
*      LIFETIME                    = lifetime_default
*      CAPTION                     =
*      METRIC                      = 0
      ratio                       = 90
*      NO_AUTODEF_PROGID_DYNNR     =
*      NAME                        =
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5
      OTHERS                      = 6.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

* Use full dynpro size
  CALL METHOD go_docking->set_extension
    EXPORTING
      extension  = 99999
    EXCEPTIONS
      cntl_error = 1
      OTHERS     = 2.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CREATE OBJECT go_splitter
    EXPORTING
*      LINK_DYNNR        =
*      LINK_REPID        =
*      SHELLSTYLE        =
*      LEFT              =
*      TOP               =
*      WIDTH             =
*      HEIGHT            =
*      METRIC            = cntl_metric_dynpro
*      ALIGN             = 15
      parent            = go_docking
      rows              = 1
      columns           = 2
*      NO_AUTODEF_PROGID_DYNNR =
*      NAME              =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL METHOD go_splitter->set_column_mode
    EXPORTING
      mode              = cl_gui_splitter_container=>mode_relative
*    IMPORTING
*      RESULT            =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Set column width: 1st column = 85%, 2nd column = 15%
  CALL METHOD go_splitter->set_column_width
    EXPORTING
      id                = 1
      width             = 85                                " 85%
*    IMPORTING
*      RESULT            =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.



  CALL METHOD go_splitter->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = go_cell_left.
  CALL METHOD go_splitter->get_container
    EXPORTING
      row       = 1
      column    = 2
    RECEIVING
      container = go_cell_right.


* 2nd splitter for top/bottom
  CREATE OBJECT go_splitter_1
    EXPORTING
*      LINK_DYNNR        =
*      LINK_REPID        =
*      SHELLSTYLE        =
*      LEFT              =
*      TOP               =
*      WIDTH             =
*      HEIGHT            =
*      METRIC            = cntl_metric_dynpro
*      ALIGN             = 15
      parent            = go_cell_left
      rows              = 2
      columns           = 1
*      NO_AUTODEF_PROGID_DYNNR =
*      NAME              =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL METHOD go_splitter_1->set_column_mode
    EXPORTING
      mode              = cl_gui_splitter_container=>mode_relative
*    IMPORTING
*      RESULT            =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Set column width: 1st column = 85%, 2nd column = 15%
  CALL METHOD go_splitter_1->set_row_height
    EXPORTING
      id                = 1
      height            = 75
*    IMPORTING
*      RESULT            =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.

  CALL METHOD go_splitter_1->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = go_cell_top.
  CALL METHOD go_splitter_1->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = go_cell_bottom.





  CREATE OBJECT go_grid_top
    EXPORTING
*      I_SHELLSTYLE      = 0
*      I_LIFETIME        =
      i_parent          = go_cell_top
*      I_APPL_EVENTS     = space
*      I_PARENTDBG       =
*      I_APPLOGPARENT    =
*      I_GRAPHICSPARENT  =
*      I_NAME            =
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      OTHERS            = 5.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CREATE OBJECT go_grid_bottom
    EXPORTING
*      I_SHELLSTYLE      = 0
*      I_LIFETIME        =
      i_parent          = go_cell_bottom
*      I_APPL_EVENTS     = space
*      I_PARENTDBG       =
*      I_APPLOGPARENT    =
*      I_GRAPHICSPARENT  =
*      I_NAME            =
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      OTHERS            = 5.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CREATE OBJECT go_grid_right
    EXPORTING
*      I_SHELLSTYLE      = 0
*      I_LIFETIME        =
      i_parent          = go_cell_right
*      I_APPL_EVENTS     = space
*      I_PARENTDBG       =
*      I_APPLOGPARENT    =
*      I_GRAPHICSPARENT  =
*      I_NAME            =
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      OTHERS            = 5.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL METHOD go_grid_top->set_table_for_first_display
    EXPORTING
*      I_BUFFER_ACTIVE               =
*      I_BYPASSING_BUFFER            =
*      I_CONSISTENCY_CHECK           =
      i_structure_name              = 'T001'
*      IS_VARIANT                    =
      i_save                        = 'A'
*      I_DEFAULT                     = 'X'
*      IS_LAYOUT                     =
*      IS_PRINT                      =
*      IT_SPECIAL_GROUPS             =
*      IT_TOOLBAR_EXCLUDING          =
*      IT_HYPERLINK                  =
*      IT_ALV_GRAPHICS               =
*      IT_EXCEPT_QINFO               =
    CHANGING
      it_outtab                     = gt_t001
*      it_fieldcatalog               =
*      IT_SORT                       =
*      IT_FILTER                     =
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL METHOD go_grid_bottom->set_table_for_first_display
    EXPORTING
*      I_BUFFER_ACTIVE               =
*      I_BYPASSING_BUFFER            =
*      I_CONSISTENCY_CHECK           =
      i_structure_name              = 'KNA1'
*      IS_VARIANT                    =
      i_save                        = 'A'
*      I_DEFAULT                     = 'X'
*      IS_LAYOUT                     =
*      IS_PRINT                      =
*      IT_SPECIAL_GROUPS             =
*      IT_TOOLBAR_EXCLUDING          =
*      IT_HYPERLINK                  =
*      IT_ALV_GRAPHICS               =
*      IT_EXCEPT_QINFO               =
    CHANGING
      it_outtab                     = gt_kna1
*      it_fieldcatalog               =
*      IT_SORT                       =
*      IT_FILTER                     =
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL METHOD go_grid_right->set_table_for_first_display
    EXPORTING
*      I_BUFFER_ACTIVE               =
*      I_BYPASSING_BUFFER            =
*      I_CONSISTENCY_CHECK           =
      i_structure_name              = 'KNB1'
*      IS_VARIANT                    =
      i_save                        = 'A'
*      I_DEFAULT                     = 'X'
*      IS_LAYOUT                     =
*      IS_PRINT                      =
*      IT_SPECIAL_GROUPS             =
*      IT_TOOLBAR_EXCLUDING          =
*      IT_HYPERLINK                  =
*      IT_ALV_GRAPHICS               =
*      IT_EXCEPT_QINFO               =
    CHANGING
      it_outtab                     = gt_knb1
*      it_fieldcatalog               =
*      IT_SORT                       =
*      IT_FILTER                     =
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Link docking container to dynpro
  CALL METHOD go_docking->link
    EXPORTING
      repid                       = syst-repid
      dynnr                       = '0100'
*      CONTAINER                   =
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      lifetime_dynpro_dynpro_link = 3
      OTHERS                      = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL SCREEN '0100'.
* NOTE: Dynpro does not contain any elements and has the following
*       flow logic:

"PROCESS BEFORE OUTPUT.
"  MODULE STATUS_0100.
"
"PROCESS AFTER INPUT.
"  MODULE USER_COMMAND_0100.



END-OF-SELECTION.

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
*  SET PF-STATUS 'xxxxxxxx'.
*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  SET SCREEN 0. LEAVE SCREEN.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

Regards

Uwe

Read only

mantas_andriekus
Participant
0 Likes
789

Hi Uwe,

I have tried your code in 4.7 and it works fine, however does not do in 4.6C, any ideas as to why this is the case?

Thanks

Mantas