2005 Dec 30 6:01 AM
Hi frnds,.
Can we run a ALV report in background?
rgds,
Madan..
2005 Dec 30 6:28 AM
hi
check this
http://www.sap-basis-abap.com/abap/an-alv-program-that-calls-a-me21n-via-bdc.htm
regs
Arun
hi
check this
http://www.sap-basis-abap.com/abap/an-alv-program-that-calls-a-me21n-via-bdc.htm
regs
Arun
2005 Dec 30 6:05 AM
yeah, you can
if you are using alv classes then you need to use
this code..
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING e_offline = off.
IF off IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
ENDIF.
2005 Dec 30 6:05 AM
Yes, are you using the CL_GUI_ALV_GRID? If so, you can do it like this. I have BOLDED the important parts.
REPORT ZRICH_0006 .
* Tables
TABLES: MARA.
* Output internal table
DATA: ITAB TYPE TABLE OF MARA.
* ALV Grid
<b>DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.</b>
* Other Data Declaration
DATA: OKCODE(4) TYPE C.
* Selection screen
SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME.
SELECT-OPTIONS: SO_MATNR FOR MARA-MATNR.
SELECTION-SCREEN END OF BLOCK ONE.
START-OF-SELECTION.
SELECT * FROM MARA INTO TABLE ITAB
WHERE MATNR IN SO_MATNR.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'LISTOUT1'.
SET TITLEBAR 'LIST1'.
IF R_CONTROL IS INITIAL.
<b>* Check whether the program is run in batch or foreground
IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
* Run in foreground
CREATE OBJECT R_CONTROL EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
CREATE OBJECT R_GRID EXPORTING I_PARENT = R_CONTROL.
ELSE.
* Run in background
CREATE OBJECT R_GRID EXPORTING I_PARENT = G_DOCK.
ENDIF.</b>
* Structure ZBA_MARA1 is defined in DDIC as linetype
CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'MARA'
CHANGING
IT_OUTTAB = ITAB.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
CASE OKCODE.
WHEN 'BACK'.
SET SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards,
Rich Heilman
2006 Aug 14 5:51 AM
Hi ,
Could you please tell me after making these changes. How do i need to run the ALV Program. Can you please specify step by step.
With Best Regards
Mamatha.B
2006 Aug 14 6:33 AM
hi Mamatha,
open a new thread because this thread was already answered so no one is going to watch it
Naveen
2005 Dec 30 6:14 AM
frnds,
if im not using any classes.... just the FM 'ALV_REUSE_GRID_DISPLAY'....
regrds,
Madan...
2005 Dec 30 6:16 AM
then in that case , it work well, no need to do any thing...
vijay
2005 Dec 30 6:14 AM
2005 Dec 30 6:17 AM
2005 Dec 30 6:28 AM
hi
check this
http://www.sap-basis-abap.com/abap/an-alv-program-that-calls-a-me21n-via-bdc.htm
regs
Arun
2005 Dec 30 6:38 AM
2005 Dec 30 6:43 AM
2005 Dec 30 6:56 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |