02-14-2006 8:27 AM
Hi all,
I wanted to display 2 ALV Grids in a screen.
I have used a custom screen with custom control in the screen and the container object ,the logic ,similar to the progrm 'BCALV_GRID_DEMO'
But now when i pass the Structure name and the internal table name i get a type incompatible error .
i hve declared the internal table as
DATA: BEGIN OF i_v OCCURS 0,
:
:
:
:
END OF i_values.
and given Structure name as 'I_VALUES' and i_ table would be i_values.
Pls help me with this with ideas.
02-14-2006 8:37 AM
Hi,
even you declare the table as occurs 0, that doesn't matter.
but pass this way , it will solve your problem..
**Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
<b>IT_OUTTAB = ITAB[]</b>.
instead of i_values pass I_values[]
it will solve your problem.
regards
vijay
02-14-2006 8:31 AM
02-14-2006 8:34 AM
02-14-2006 8:34 AM
Hi,
You can display two ALV in a screen by implementing TAB-strip ALV:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-co... code sample for tab strip in alv.pdf
Best Regars,
Anjali
02-14-2006 8:34 AM
hi Stock,
check this sample code to for the display of multiple ALVs on the samepage...
START-OF-SELECTION.
**----
Begin of process logic
**----
CALL SCREEN '0100'.
END-OF-SELECTION.
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS01'.
SET TITLEBAR 'SALESTTL'.
*----
A L V G R I D
*----
IF o_grid_container IS INITIAL.
CREATE OBJECT o_grid_container
EXPORTING
container_name = 'CCONTAINER1'.
CREATE OBJECT o_grid
EXPORTING
i_appl_events = 'X'
i_parent = o_grid_container.
*----
<b>* FOR first A L V G R I D</b>
*----
PERFORM set_grid_field_catalog
CHANGING i_grid_fcat.
PERFORM modify_grid_fcat_predisplay
CHANGING i_grid_fcat.
PERFORM set_grid_layout_set
CHANGING struct_grid_lset.
PERFORM sort_outtable CHANGING i_sort_fcat.
PERFORM populate_grid_data TABLES i_grid_outs i_grid_outs_pro.
SORT i_grid_outs BY year month.
CALL METHOD o_grid->set_table_for_first_display
EXPORTING
i_bypassing_buffer = space
is_variant = ws_f_grid_disvar
i_save = ws_c_grid_save
is_layout = struct_grid_lset
CHANGING
it_outtab = i_grid_outs[]
it_fieldcatalog = i_grid_fcat[]
it_sort = i_sort_fcat. " Period
ENDIF.
IF o_grid1_container IS INITIAL.
CREATE OBJECT o_grid1_container
EXPORTING
container_name = 'CCONTAINER2'.
CREATE OBJECT o_grid1
EXPORTING
i_appl_events = 'X'
i_parent = o_grid1_container.
-----------------------------------------------------
*<b> FOR SECOND ALV GRID</b>
-----------------------------------------------------
PERFORM set_grid1_field_catalog
CHANGING i_grid1_fcat.
PERFORM modify_grid1_fcat_predisplay
CHANGING i_grid1_fcat.
PERFORM set_grid1_layout_set
CHANGING struct_grid1_lset.
PERFORM sort_outtable1 CHANGING i_sort_fcat1.
PERFORM populate_grid1_data TABLES i_grid1_outs i_grid1_outs_pro.
SORT i_grid1_outs BY year month.
CALL METHOD o_grid1->set_table_for_first_display
EXPORTING
i_bypassing_buffer = space
is_variant = ws_f_grid_disvar
i_save = ws_c_grid_save
is_layout = struct_grid1_lset
CHANGING
it_outtab = i_grid1_outs[]
it_fieldcatalog = i_grid1_fcat[]
it_sort = i_sort_fcat1. " Period
ENDIF.
IF o_grid2_container IS INITIAL.
CREATE OBJECT o_grid2_container
EXPORTING
container_name = 'CCONTAINER3'.
CREATE OBJECT o_grid2
EXPORTING
i_appl_events = 'X'
i_parent = o_grid2_container.
********************************
FOR THIRD ALV GRID
*----
........
.....
CALL METHOD o_grid2->set_table_for_first_display
EXPORTING
i_bypassing_buffer = space
is_variant = ws_f_grid_disvar
i_save = ws_c_grid_save
is_layout = struct_grid2_lset
CHANGING
it_outtab = i_grid2_outs[]
it_fieldcatalog = i_grid2_fcat[]
it_sort = i_sort_fcat2. " Period
ENDIF.
regards
satesh
02-14-2006 8:37 AM
Hi,
even you declare the table as occurs 0, that doesn't matter.
but pass this way , it will solve your problem..
**Calling the Method for ALV output
CALL METHOD G_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = LT_EXCLUDE
IS_VARIANT = LS_VARI
IS_LAYOUT = GS_LAYOUT
I_SAVE = 'A'
CHANGING
IT_FIELDCATALOG = IT_FIELDCAT
<b>IT_OUTTAB = ITAB[]</b>.
instead of i_values pass I_values[]
it will solve your problem.
regards
vijay
02-15-2006 12:33 PM