2007 May 01 7:45 PM
Hi,
Can u pls guide me to display more than two alv grids on a single screen by using <b>Object Model</b>.
Thanks
Raja
2007 May 01 8:11 PM
Sure, You can simply have two container in your screen. Check this program.
Create screen 100, and put two custom containers in the screen, call the first one ALV1_CONT and the second ALV2_CONT, them implement this code.
REPORT zrich_0001.
data: ispfli type table of spfli.
data: isflight type table of sflight.
data: alv1_cont type ref to cl_gui_custom_container.
data: alv2_cont type ref to cl_gui_custom_container.
data: gr_alv1 type ref to cl_salv_table.
data: gr_alv2 type ref to cl_salv_table.
start-of-selection.
select * into table ispfli from spfli.
select * into table isflight from sflight.
call screen 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module STATUS_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
create object alv1_cont
exporting
container_name = 'ALV1_CONT'.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = if_salv_c_bool_sap=>false
r_container = alv1_cont
* container_name =
IMPORTING
r_salv_table = gr_alv1
CHANGING
t_table = ispfli.
gr_alv1->display( ).
create object alv2_cont
exporting
container_name = 'ALV2_CONT'.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = if_salv_c_bool_sap=>false
r_container = alv2_cont
* container_name =
IMPORTING
r_salv_table = gr_alv2
CHANGING
t_table = isflight.
gr_alv2->display( ).
endmodule. " STATUS_0100 OUTPUT
Regards,
Rich Heilman
Sure, You can simply have two container in your screen. Check this program.
Create screen 100, and put two custom containers in the screen, call the first one ALV1_CONT and the second ALV2_CONT, them implement this code.
REPORT zrich_0001.
data: ispfli type table of spfli.
data: isflight type table of sflight.
data: alv1_cont type ref to cl_gui_custom_container.
data: alv2_cont type ref to cl_gui_custom_container.
data: gr_alv1 type ref to cl_salv_table.
data: gr_alv2 type ref to cl_salv_table.
start-of-selection.
select * into table ispfli from spfli.
select * into table isflight from sflight.
call screen 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module STATUS_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
create object alv1_cont
exporting
container_name = 'ALV1_CONT'.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = if_salv_c_bool_sap=>false
r_container = alv1_cont
* container_name =
IMPORTING
r_salv_table = gr_alv1
CHANGING
t_table = ispfli.
gr_alv1->display( ).
create object alv2_cont
exporting
container_name = 'ALV2_CONT'.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = if_salv_c_bool_sap=>false
r_container = alv2_cont
* container_name =
IMPORTING
r_salv_table = gr_alv2
CHANGING
t_table = isflight.
gr_alv2->display( ).
endmodule. " STATUS_0100 OUTPUT
Regards,
Rich Heilman
2007 May 01 8:11 PM
Sure, You can simply have two container in your screen. Check this program.
Create screen 100, and put two custom containers in the screen, call the first one ALV1_CONT and the second ALV2_CONT, them implement this code.
REPORT zrich_0001.
data: ispfli type table of spfli.
data: isflight type table of sflight.
data: alv1_cont type ref to cl_gui_custom_container.
data: alv2_cont type ref to cl_gui_custom_container.
data: gr_alv1 type ref to cl_salv_table.
data: gr_alv2 type ref to cl_salv_table.
start-of-selection.
select * into table ispfli from spfli.
select * into table isflight from sflight.
call screen 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module STATUS_0100 output.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
create object alv1_cont
exporting
container_name = 'ALV1_CONT'.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = if_salv_c_bool_sap=>false
r_container = alv1_cont
* container_name =
IMPORTING
r_salv_table = gr_alv1
CHANGING
t_table = ispfli.
gr_alv1->display( ).
create object alv2_cont
exporting
container_name = 'ALV2_CONT'.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = if_salv_c_bool_sap=>false
r_container = alv2_cont
* container_name =
IMPORTING
r_salv_table = gr_alv2
CHANGING
t_table = isflight.
gr_alv2->display( ).
endmodule. " STATUS_0100 OUTPUT
Regards,
Rich Heilman
2007 May 01 9:05 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |