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

ALV Grid control & Control Containers

prabhu_s2
Active Contributor
0 Likes
881

Hi ALV Xperts

I've a requirement where initially a ALV list/grid is displayed and cliking on a data i need the detail items in the same page next to the displayed ALV grid....something like the display functionality of SE80. I know this is possible via control containers and using ALV classes but i dont have a clue on how to proceed with that nor any documents i have. Kindly let me know on how to achieve it.

thkx

Prabhu

Hi ALV Xperts

I've a requirement where initially a ALV list/grid is displayed and cliking on a data i need the detail items in the same page next to the displayed ALV grid....something like the display functionality of SE80. I know this is possible via control containers and using ALV classes but i dont have a clue on how to proceed with that nor any documents i have. Kindly let me know on how to achieve it.

thkx

Prabhu

6 REPLIES 6
Read only

Former Member
0 Likes
855

use this link u will get all the details..

http://www.abap4.it/download/ALV.pdf

reward if helpful

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
855

What you are referring to is the use of docking containers, this can be done in a view ways, where you have one docking container hanging from one screen, and the screen is updated when the user click on something in the docking container, another is eventing across docking containers, so there are two containers, you click someting in the first and the second container is filled accordingly. This is an example of that below. Click on a material and see the MARC values in the second container



report zrich_0001 .

data: imara type table of mara.
data: xmara like line of imara.
data: imarc type table of marc.

data: dockingbottom type ref to cl_gui_docking_container,
      dockingtop  type ref to cl_gui_docking_container,
      alv_bottom    type ref to cl_gui_alv_grid,
      alv_top     type ref to cl_gui_alv_grid,
      repid type syrepid.

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler DEFINITION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_event_handler definition.

  public section.

    class-methods handle_double_click
               for event double_click of cl_gui_alv_grid
                              importing e_row e_column.

endclass.

*---------------------------------------------------------------------*
*       CLASS lcl_event_handler IMPLEMENTATION
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
class lcl_event_handler implementation.

  method handle_double_click.

    read table imara into xmara index e_row-index.

    select * into table imarc from marc
                  where matnr = xmara-matnr.
    call method alv_bottom->refresh_table_display( ).


  endmethod.

endclass.


parameters: p_check type c.

start-of-selection.

at selection-screen output.

  repid = sy-repid.

  select * into corresponding fields of table imara
              from mara up to 100 rows.

  check dockingbottom is initial.


  create object dockingtop
              exporting repid     = repid
                        dynnr     = sy-dynnr
                        side      = dockingtop->dock_at_top
                        extension = 200.

  create object alv_top
              exporting i_parent = dockingtop.


  call method alv_top->set_table_for_first_display
     exporting
          i_structure_name       = 'MARA'
     changing
          it_outtab       = imara[].


*   handler for ALV grid
  set handler lcl_event_handler=>handle_double_click for alv_top.



  create object dockingbottom
              exporting repid     = repid
                        dynnr     = sy-dynnr
                        side      = dockingbottom->dock_at_bottom
                        extension = 200.

  create object alv_bottom
                exporting i_parent = dockingbottom.


  call method alv_bottom->set_table_for_first_display
      exporting
           i_structure_name       = 'MARC'
      changing
           it_outtab       = imarc[].

Regards,

RIch Heilman

Read only

0 Likes
855

RIch

this looks so kool and i want to build my skill on such concepts. can u point to some pdf docs which helps me in this? if time permits can u mail to [email protected]

thkx

Prabhu

Read only

0 Likes
855

is it possible to do it using control container defined in screen painters? if yes kindly guide on how to get it done?

Read only

0 Likes
855

Yes, absolutly, instead of using docking containers, you would simply swap them out for custom containers and the code in the AT SELECTION-SCREEN OUTPUT would be in a MODULE of the PBO of the dynpro. That's pretty much it.

Regards,

Rich Heilman

Read only

0 Likes
855

can u point to some docs that could help me to build my skills on it?