04-20-2006 6:07 PM
Hi
What function do I use to allow me to put 2 ALV Grids in 1 window? I have 2 tables I have to display in ALV and they need to be in 1 window
Thanks
04-20-2006 6:10 PM
There isn´t FM. You must to use ABAP objects.
See report BCALV_GRID_DEMO.
Message was edited by: Peluka
04-20-2006 6:10 PM
04-20-2006 6:12 PM
Hi,
There is no function module specific for your purpose.
But you can achieve this calling two different controls in the same page. Check this program BCALV_GRID_01 to know how to create a ALV Grid control in a Page.
Follow the same procedure to create another control in the same page.
Regards,
Vara
04-20-2006 6:21 PM
George,
It pretty simple. Take a look at my weblog for creating a report with one GRID. All you have to do is split the container use a EASY SPLITTER, by which you have two containers now. Now, create two grids and assign each of these to the containers. The process of field catalog is same, except that you will creating a different type of field catalog using LVC_FIELDCATALOG_MERGE.
/people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls--part-i
/people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls-control-layouts--part-ii
Also, take a look at this program.
http://www.geocities.com/mpioud/Z_DEMO_2_ALV_LIST.html
http://www.geocities.com/mpioud/Z_DEMO_3_ALV_LIST.html
Regards,
Ravi
Note : Please mark the helpful answers
04-20-2006 8:17 PM
Hi,
u can use following code to display alvs using abapobjects.
<b> DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
*----
G L O B A L D A T A
*----
DATA: ok_code LIKE sy-ucomm,
g_wa_sflight LIKE sflight.
Declare reference variables to the ALV grid and the container
DATA:
go_grid TYPE REF TO cl_gui_alv_grid,
go_custom_container TYPE REF TO cl_gui_custom_container.
*----
S T A R T - O F - S E L E C T I O N.
*----
START-OF-SELECTION.
SET SCREEN '100'.
&----
*& Module USER_COMMAND_0100 INPUT
&----
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
MODULE status_0100 OUTPUT.
Create objects
IF go_custom_container IS INITIAL.
CREATE OBJECT go_custom_container
EXPORTING container_name = 'ALV_CONTAINER'.
CREATE OBJECT go_grid
EXPORTING
i_parent = go_custom_container.
PERFORM load_data_into_grid.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Form load_data_into_grid
&----
FORM load_data_into_grid.
Read data from table SFLIGHT
SELECT *
FROM zsflight
INTO TABLE gi_sflight.
Load data into the grid and display them
CALL METHOD go_grid->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
CHANGING it_outtab = gi_sflight.
ENDFORM. " load_data_into_grid</b>
regards,
Sunil