Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

fatal error: GUI cannot be reached

Former Member
0 Likes
21,120

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.........

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
10,892

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

15 REPLIES 15
Read only

Former Member
0 Likes
10,892

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

Read only

0 Likes
10,892

You mean for the background jobs we should not use ALV Grid display.

Read only

0 Likes
10,892

>

> 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?

Read only

0 Likes
10,892

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.

Read only

0 Likes
10,892
Fatal error - GUI cannot be reached

This 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)?

Read only

0 Likes
10,892

Every thing is fine with the fieldcatalog .

Is there anything else can I look in to?

regards,

sudha........

Read only

Former Member
0 Likes
10,892

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

Read only

0 Likes
10,892

Neha,

I used reuse_alv_grid _display FM

But I am unable to execute a backgroung job.

any help plz...........

Read only

Former Member
0 Likes
10,893

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

Read only

0 Likes
10,891

Thanks Rob......

can you explain any other scenario where this error can occur.

Why this error occurs.....?

thanks,

sudha..........

Read only

0 Likes
10,891

Basically any time you run something in the background that needs the gui...

Rob

Read only

0 Likes
10,891

could you plz eloborate your answer.

thanks.............

Read only

0 Likes
10,891

Have you double clicked on your original error message?

Rob

Read only

0 Likes
10,891

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.

Read only

0 Likes
10,891

>

> 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