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

Double ALV using OO

Former Member
0 Likes
614

Dear Gurus ,

I made an report that has 2 ALV in screen . I have in my screen 2 containers cc_alv and cc_alv1 .

My report is working fine . Now i want when i have a checkbox in the screen to display both the grids all one of them.

When i choose to display the one grid how can i tell to Custom control cc_alv to be maximized and take all the screen ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
561

Use SPLITTER CONTROL....


  DATA: gr_splitter TYPE REF TO cl_gui_splitter_container
        cont TYPE REF TO cl_gui_container,
        grid TYPE REF TO cl_gui_alv_grid,
        grid1 TYPE REF TO cl_gui_alv_grid.


  CREATE OBJECT gr_splitter
    EXPORTING
      link_repid        = sy-repid
      parent            = cl_gui_container=>screen0
      rows              = 2
      columns           = 1
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3
      .

  CALL METHOD gr_splitter->set_row_height
    EXPORTING
      id                = 1
      height            = 30
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3
          .

  CALL METHOD gr_splitter->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = cont.


  CREATE OBJECT grid
    EXPORTING
      i_parent          = cont                "gr_splitter->top_left_container
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      OTHERS            = 5.

  CALL METHOD gr_splitter->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = cont.


  CREATE OBJECT grid1
    EXPORTING
      i_parent          = cont                "gr_splitter->bottom_right_container
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      OTHERS            = 5.


Edited by: Sukriti Saha on Oct 24, 2008 1:55 PM

2 REPLIES 2
Read only

Former Member
0 Likes
562

Use SPLITTER CONTROL....


  DATA: gr_splitter TYPE REF TO cl_gui_splitter_container
        cont TYPE REF TO cl_gui_container,
        grid TYPE REF TO cl_gui_alv_grid,
        grid1 TYPE REF TO cl_gui_alv_grid.


  CREATE OBJECT gr_splitter
    EXPORTING
      link_repid        = sy-repid
      parent            = cl_gui_container=>screen0
      rows              = 2
      columns           = 1
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3
      .

  CALL METHOD gr_splitter->set_row_height
    EXPORTING
      id                = 1
      height            = 30
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3
          .

  CALL METHOD gr_splitter->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = cont.


  CREATE OBJECT grid
    EXPORTING
      i_parent          = cont                "gr_splitter->top_left_container
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      OTHERS            = 5.

  CALL METHOD gr_splitter->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = cont.


  CREATE OBJECT grid1
    EXPORTING
      i_parent          = cont                "gr_splitter->bottom_right_container
    EXCEPTIONS
      error_cntl_create = 1
      error_cntl_init   = 2
      error_cntl_link   = 3
      error_dp_create   = 4
      OTHERS            = 5.


Edited by: Sukriti Saha on Oct 24, 2008 1:55 PM

Read only

Former Member
0 Likes
561

Hi ,

If you want to display more than one alv in a screen the the better option is to use a Splitter .

The concept is same as the one you are using , but here , you split the container in rows and columns and each one acts are a different container , which can be used for a grid.

Please see the help of splitters for more info.

Regards

Arun