10-18-2006 7:10 PM
Hello Everybody,
ALV report when run in foreground is working fine.But when scheduled in background sm36 it is going to the shortdump,showing an error msg "control framework gui status not set".
Can anyone help me with this problem.
If the GUI controls in ALV are to b disabled in background and enabled in foreground what condition has to b used??
How can the GUI status be set according to the mode in which the program is being executed??
How to know as to when a program is being scheduled in background or foreground?
Thanking you in anticipation.
Regards,
Sirisha .
10-18-2006 7:15 PM
Hi, implement this coding in the PBO of your screen and it should work fine.
* ALV Grid
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.
* 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.
Regards,
Rich Heilman
10-18-2006 7:15 PM
Hi
can you provide us the required short dump(Not everything)?
Thanks,
Ramakrishna
10-18-2006 7:15 PM
Hi, implement this coding in the PBO of your screen and it should work fine.
* ALV Grid
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.
* 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.
Regards,
Rich Heilman
10-18-2006 8:01 PM
Thanks Rich. I have the same problem. I solved the problem with your code and i am using events double click in foreground. we have to remove this events when we are executing in background since these events are not supported by class CL_GUI_DOCKING_CONTAINER.
thanks and regards,
vamshi tallada
10-18-2006 7:16 PM
Hi,
You can use SY-BATCH to check if the program is running in foreground or in background..SY-BATCH = 'X' means it is background..
Thanks,
Naren
10-19-2006 12:13 PM