‎2006 Jul 15 6:26 AM
‎2006 Jul 15 8:15 AM
Hi,
If you are using functin module method to create alv. then use list display for background.
IF sy-batch = 'X'.
REUSE_ALV_LIST_DISPLAY.
ELSE.
REUSE_ALV_GRID_DISPLAY
ENDIF.if you are using OO concept for alv then use following code.
DATA: grid1 type ref to cl_gui_alv_grid,
G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.
if g_custom_container is initial.
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
create object g_custom_container
exporting container_name = g_container.
create object grid1
exporting i_parent = g_custom_container.
ELSE.
* If it is in backround:
CREATE OBJECT grid1
EXPORTING i_parent = G_DOCK.
ENDIF.
call method grid1->set_table_for_first_display
exporting
is_print = gs_print
is_layout = gs_layout
*** For Layout Variants
is_variant = gs_variant
i_save = 'A'
i_default = 'X'
changing it_fieldcatalog = itab[]
it_outtab = main1[].
endif.Regards,
Wasim Ahmed
‎2006 Jul 15 8:18 AM
Hi Pavan,
see the below code for generating the ALV in background.
check the sy-batch variable while creating the Grid object , if program is running in background pass docking container to Grid object without creating the instance of the docking container, if program is running in foreground place a container on the screen and create
container object and pass container to grid object.
Code :
DATA: o_grid TYPE REF TO cl_gui_alv_grid,
o_container TYPE REF TO cl_gui_custom_container,
o_dockingcontainer TYPE REF TO cl_gui_docking_container .
IF NOT sy-batch = 'X'. -
foreground
CREATE OBJECT o_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT o_grid
EXPORTING
i_parent = o_container.
ELSE. -
background
CREATE OBJECT o_grid
EXPORTING
i_parent = o_dockingcontainer.
IF sy-subrc NE 0.
ENDIF.
ENDIF
Regards
Appana
‎2006 Jul 15 8:54 AM
Hi pavan,
Go through the link,
http://help.sap.com/saphelp_47x200/helpdata/en/8d/e994374c9cd355e10000009b38f8cf/frameset.htm
Regards,
Azaz Ali.
‎2006 Jul 15 6:02 PM
hi pavan,
check the below links may be useful for u
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
Regards,
Naveen