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: 

Two ALV Grids in a Report

Former Member
0 Kudos

I am using FM REUSE_ALV_GRID_DISPLAY

my requirement is that i want to show two ALV Grids in a Report. is that possible if so then guide me.

abhishek suppal

12 REPLIES 12

athavanraja
Active Contributor
0 Kudos

check out the following demo program

BCALV_TEST_BLOCK_LIST

Regards

Raja

Former Member
0 Kudos

Hi Abhishek,

You can also look at the program BALVBT01.

If you want more flexibility then better you use Classes and you can achieve the same.

Thanks& Regards,

Siri.

Former Member
0 Kudos

Please use :

First use the following function.

CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

EXPORTING

IT_FIELDCAT = ZFIELD

IS_LAYOUT = Z_LAYOUT

I_TABNAME = 'ZDATA'

IT_EVENTS = GT_ZEVENTS

I_TEXT = TEXT-0B3

TABLES

T_OUTTAB = ZDATA.

*

You can update your internal table replace "Zdata" with another internal table and call this function again.

This will give you 2 ALV GRID blocks

.

Former Member
0 Kudos

If you want to display two alv grid separtely in the output then you have create two custom controls in the screen and by using class CL_GUI_ALV_GRID.

If you want to display two different internal tables in a single alv list then use 'REUSE_ALV_BLOCK_LIST_APPEND'.

Cheers,

Satya

0 Kudos

i want to do it with FM REUSE_ALV_GRID_DISPLAY with FM 'REUSE_ALV_BLOCK_LIST_APPEND' i am able to do but user doesn't want scroll in the page....

abhishek suppal

0 Kudos

Hi,

I think you need to go for TABSTRIP so that it will meet you req....

Go for a container take TABSTRIP option.

Thanks.

0 Kudos

with

'REUSE_ALV_BLOCK_LIST_APPEND' you get multiple grid one after other. so to see the second, thrid, etc grids , the user has to scroll. even if you use cl_gui_alv_grid with splitter contrainer to show the grids side by side the user has to use horizontal scroll bar .

Regards

Raja

please reward the helpful answers.

0 Kudos

Hi,

Alternative option:

-


IF CONTAINER_R IS INITIAL. " has the container been filled?...

  • Create object that communicates with the container control...

CREATE OBJECT CONTAINER_R

EXPORTING CONTAINER_NAME = C_GCONT.

  • Create object that communicates with the ALV Grid control...

CREATE OBJECT GRID_R

EXPORTING I_PARENT = CONTAINER_R.

  • Create object that communicates with the event double click in

  • ALV Grid control...

CREATE OBJECT EVENT_RECIVER.

SET HANDLER EVENT_RECIVER->HANDLE_DOUBLE_CLICK FOR GRID_R.

  • Call the method that receives the content and structure of itab..

CALL METHOD GRID_R->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = V_LAYOUT

I_BUFFER_ACTIVE = SPACE

I_BYPASSING_BUFFER = C_X

CHANGING

IT_OUTTAB = I_REPHDR

IT_FIELDCATALOG = I_FIELDCAT_L.

CALL METHOD GRID_R->SET_GRIDTITLE

EXPORTING

I_GRIDTITLE = TEXT-009.

CALL METHOD GRID_R->SET_VISIBLE

EXPORTING

VISIBLE = C_X.

CALL METHOD GRID_R->SET_TOOLBAR_INTERACTIVE.

ENDIF.

*

IF CONTAINER_R1 IS INITIAL. " has the container been filled?...

  • Create object that communicates with the container control...

CREATE OBJECT CONTAINER_R1

EXPORTING CONTAINER_NAME = C_GCONT1.

  • Create object that communicates with the ALV Grid control...

CREATE OBJECT GRID_R1

EXPORTING I_PARENT = CONTAINER_R1.

  • Create object that communicates with the event double click in

  • ALV Grid control...

CREATE OBJECT EVENT_RECIVER1.

SET HANDLER EVENT_RECIVER1->HANDLE_DOUBLE_CLICK FOR GRID_R1.

*Build up layoutinfo for the fields to be displayed

PERFORM LAYOUT_BUILD USING I_COPY_LTAP

CHANGING I_REPDTL

V_LAYOUT2.

  • Call the method that receives the content and structure of itab..

CALL METHOD GRID_R1->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = V_LAYOUT2

I_BUFFER_ACTIVE = SPACE

I_BYPASSING_BUFFER = C_X

I_SAVE = 'U'

IS_VARIANT = GS_variant

I_DEFAULT = 'X'

CHANGING

IT_OUTTAB = I_REPDTL

IT_FIELDCATALOG = I_FIELDCAT_L2.

CALL METHOD GRID_R1->SET_GRIDTITLE

EXPORTING

I_GRIDTITLE = TEXT-010.

CALL METHOD GRID_R1->SET_VISIBLE

EXPORTING

VISIBLE = C_X.

CALL METHOD GRID_R1->SET_TOOLBAR_INTERACTIVE.

ENDIF.

regards

Aveek

P.S: Please reward with points if you find the answer useful.

0 Kudos

Hi Abhishek

How u acheived it with using FM REUSE_ALV_GRID_DISPLAY with FM 'REUSE_ALV_BLOCK_LIST_APPEND' . Send some code of it.

Former Member
0 Kudos

Hi Abhishek,

Tabstrip ALV is the best option to use in this case.

Please checkout the various forums on this:

Best Regards,

Anjali

Former Member
0 Kudos

Hi ,

Use the Tab strip control to accomplish your requirement .

http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/content.htm

Regards

Beena

0 Kudos

TabStrip will not solve my requirement