‎2008 Nov 24 5:07 PM
Hi all,
I have created a background job for a ABAP report . It is giving the following error.
Control Framework: Fatal error - GUI cannot be reached
I have used a custom screen for the output in ALV grid .And in the output when I click on any line
It should take me to the transaction VA02 .
my output is as follows:
Sales Doc Item Material Order Qty Conf Qty
Can anyone plz help....
Thanks,
Sudha.........
‎2008 Nov 24 9:49 PM
Your basic premise is incorrect. If you run the job in background, you won't be able to double click on a line and go to a transaction. That only works for reports run in the foreground where the GUI is available. That is what your error message is trying to tell you.
Rob
‎2008 Nov 24 5:10 PM
Hi Sudha
In background alv you can not use ALV grid display,you have to use REUSE_ALV_LIST_DISPLAY.
That will solve the error.
Regards
Neha
‎2008 Nov 24 5:13 PM
You mean for the background jobs we should not use ALV Grid display.
‎2008 Nov 24 5:16 PM
>
> Hi Sudha
>
> In background alv you can not use ALV grid display,you have to use REUSE_ALV_LIST_DISPLAY.
> That will solve the error.
>
> Regards
> Neha
We can use.
But Grid cannot be display in background it will by default Generate List in Background.
But by using REUSE_ALV_GRID_DISPLAY won't create any problem.
@Sudha:
You mean for the background jobs we should not use ALV Grid display.We can use np.
Might be your problem causing from GUI** fm.
I have used a custom screen for the output in ALV grid .And in the output when I click on any line
Any GUI* Fm you are using in Custom screen?
‎2008 Nov 24 5:23 PM
amit,
am using the FM's LVC_FIELDCATALOG_MERGE and
SET_TABLE_FOR_FIRST_DISPLAY in the PBO event of the custom screen.
CALL METHOD CR_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = GS_LAYOUT
CHANGING
IT_OUTTAB = LT_DOCUMENTS
IT_FIELDCATALOG = GT_FIELDCATALOG
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4.
‎2008 Nov 24 5:29 PM
Fatal error - GUI cannot be reachedThis error Could be from many reasons.
One more thing you can check which is your Field cat, is your field cat is defined correct (All fields are in CAPS,no field repetition of same name)?
‎2008 Nov 24 6:27 PM
Every thing is fine with the fieldcatalog .
Is there anything else can I look in to?
regards,
sudha........
‎2008 Nov 24 7:16 PM
Hi Sudha
The OO classes you are currently using require custom controls that are instantiated in a SAPGui session. In a background job there is no such thing as SAP GUI session, so you are getting a short dump.
That1s why u should use reuse_alv_list or grid_display when you are running it in background.
In your code you ca nput a chec kif sy-batch eq 'X'.
Use FM
else
OO ALV.
endif.
Regards
Neha
‎2008 Nov 24 9:32 PM
Neha,
I used reuse_alv_grid _display FM
But I am unable to execute a backgroung job.
any help plz...........
‎2008 Nov 24 9:49 PM
Your basic premise is incorrect. If you run the job in background, you won't be able to double click on a line and go to a transaction. That only works for reports run in the foreground where the GUI is available. That is what your error message is trying to tell you.
Rob
‎2008 Nov 24 10:07 PM
Thanks Rob......
can you explain any other scenario where this error can occur.
Why this error occurs.....?
thanks,
sudha..........
‎2008 Nov 24 10:09 PM
Basically any time you run something in the background that needs the gui...
Rob
‎2008 Nov 24 10:14 PM
‎2008 Nov 24 10:18 PM
‎2008 Nov 25 4:47 PM
Yeah I double clicked the error msg But I didn't u nderstand it completely.
The following is the error description .............
Control Framework: Fatal error - GUI cannot be reached
Message no. DC006
Diagnosis
When the Control Framework is started, the system checks whether the installed GUI supports frontend components such as controls. This check failed; the causes may be as follows:
1.) The program is running in the background
2.) A transaction was called using CALL TRANSACTION ... STARTING IN BACKGROUND TASK.
Procedure
Programs that run in the background cannot address controls on the frontend. In this case, the application must either include a fallback that does not depend on the user interface, or the program or transaction must detect for itself that is running in the background and terminate itself.
‎2008 Nov 25 5:06 PM
>
> 1.) The program is running in the background
What I've been trying to say is that you cannot do this in the background.
Rob