11-29-2011 7:32 AM
Hello folks,
I am displaying the ALV using the method - set_table_for_first_display.
The scenario is that I have multiple ALV's to be displayed for different conditions with the same sy-repid and hence the layout that i save for one ALV is being shown when I try to save the layout for another ALV.
I tried by passing i_default = space as well as 'X'. Still that didnt help.
I am passing the sy-repid value to the is_variant-report as of now.
Please suggest a solution for this!
Thanks,
Safeer.
11-29-2011 9:46 AM
Hello Safeer,
Did you try passing the param I_BYPASSING_BUFFER = 'X' ?
Also there is in the structure for the ALV variant i.e., DISVARIANT, there is a field HANDLE which might be of use as well.
BR,
Suhas
11-29-2011 9:46 AM
Hello Safeer,
Did you try passing the param I_BYPASSING_BUFFER = 'X' ?
Also there is in the structure for the ALV variant i.e., DISVARIANT, there is a field HANDLE which might be of use as well.
BR,
Suhas
11-29-2011 11:02 AM
Hello,
The is_variant is of type DISVARIANT.
Just pass a unique dummy value to the field HANDLE in the structure DISVARIANT for each ALV and pass that is_variant to the method SET_TABLE_FOR_FIRST_DISPLAY.
@Suhas : Thanks for your input although I found the solution before your reply
Thanks,
Safeer.
12-13-2011 4:56 AM
Hello Safeer,
I am Sending Code To display ALV In Multiple Tables.
&----
*& Report ZALVMLTP PAVAN
*&
&----
*&
*&
&----
REPORT ZALVMLTP.
DATA: Splitter_1 TYPE REF TO cl_gui_splitter_container,
Splitter_2 TYPE REF TO cl_gui_splitter_container,
Container TYPE REF TO cl_gui_custom_container,
Container_1 TYPE REF TO cl_gui_container,
Container_2 TYPE REF TO cl_gui_container,
Container_3 TYPE REF TO cl_gui_container,
Grid1 TYPE REF TO cl_gui_alv_grid,
Grid2 TYPE REF TO cl_gui_alv_grid,
Grid3 TYPE REF TO cl_gui_alv_grid.
DATA: Gt_sflight_1 TYPE TABLE OF sflight,
Gt_sflight_2 TYPE TABLE OF sflight,
Gt_sflight_3 TYPE TABLE OF sflight,
G_container TYPE scrfname VALUE 'CCONTAINER'.
DATA: ok_code TYPE sy-ucomm.
fetching data from table for different internal tables
SELECT * FROM sflight INTO TABLE gt_sflight_1.
SELECT * FROM sflight INTO TABLE gt_sflight_2 UP TO 18 ROWS.
SELECT * FROM sflight INTO TABLE gt_sflight_3 UP TO 9 ROWS.
CALL SCREEN 9010.
&----
*& Module STATUS_9010 OUTPUT *
&----
MODULE status_9010 OUTPUT.
SET PF-STATUS 'TEST'.
*creating object reference for container
CREATE OBJECT container
EXPORTING
container_name = 'CCONTAINER'.
*splitting the main container into 1 row & 2 coloum
CREATE OBJECT splitter_1
EXPORTING
Parent = container
Rows = 1
Columns = 2.
*getting the reference for the splited container (row 1 & col 1 container)
CALL METHOD splitter_1->get_container
EXPORTING
Row = 1
Column = 1
RECEIVING
Container = container_1.
*getting the reference for the splited container (row 1 & col 2 container)
CALL METHOD splitter_1->get_container
EXPORTING
Row = 1
Column = 2
RECEIVING
Container = container_2.
*splitting the 2nd coloum container in to 2 rows & 1 coloum
CREATE OBJECT splitter_2
EXPORTING
Parent = container_2
Rows = 2
Columns = 1.
*getting the reference for the splited container2 (row 1 & col 2 container)
CALL METHOD splitter_2->get_container
EXPORTING
Row = 1
Column = 1
RECEIVING
Container = container_2.
*getting the reference for the splited container2 (row 2 & col 1 container)
CALL METHOD splitter_2->get_container
EXPORTING
Row = 2
Column = 1
RECEIVING
Container = container_3.
*populating first internal table to the container
CREATE OBJECT container
EXPORTING
container_name = g_container.
CREATE OBJECT grid1
EXPORTING
i_parent = container_1.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = gt_sflight_1.
*populating second internal table
CREATE OBJECT container
EXPORTING
container_name = g_container.
CREATE OBJECT grid2
EXPORTING
i_parent = container_2.
CALL METHOD grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = gt_sflight_2.
*populating third internal table
CREATE OBJECT container
EXPORTING
container_name = g_container.
CREATE OBJECT grid3
EXPORTING
i_parent = container_3.
CALL METHOD grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
it_outtab = gt_sflight_3.
ENDMODULE.
&----
*& Module EXIT INPUT *
&----
MODULE exit INPUT.
*free the container memory when exit
CALL METHOD container->free.
LEAVE PROGRAM.
ENDMODULE.
&----
*& Module USER_COMMAND_9010 INPUT *
&----
MODULE user_command_9010 INPUT.
CALL METHOD cl_gui_cfw=>dispatch.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE SCREEN.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE SCREEN.
ENDCASE.
ENDMODULE.
WarmRegards,
PavanKumar.G