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

Control Framework: Fatal error - GUI cannot be reached

Former Member
0 Likes
1,260

Hi, all.

Scenario: I have created a report which shows results using an ALV tree (cl_gui_alv_tree). Due to it is a heavy process, it must to be run in the background.

Problem: when running this process in the background I get get the error message: Control Framework: Fatal error - GUI cannot be reached.

What can I do? I need to show the resulting tree to the user when the process finishes.

Can somebody help me, please?

Thanks a lot in advance

Christian.

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
817

Christian, please remember that the gui controls depend heavily on the frontend, in your situation the tree control needs the frontend(sapgui) to render the tree. So running this in the background will not work and there is no way to get it to work. You need to come up with a different way to show the data to the user. One way is to build a custom table with the data with a separate program. Then develop another program which would read this data and present to the user in your tree control in a online transaction.

Welcome to SDN!

Regards,

RIch Heilman

Read only

0 Likes
817

Building a custom table with the data with a separate online transaction seems to be the solution. But I need a way to know when the background process finishes in order to show the tree to the user.

So, I'm trying the next solution:

A main program that runs a process in the background, then background process computes data, mean while main process sleeps. After that, background process triggers an event before it fineshes, then (due to the event) main program wakes up and receives data from background process to finally show the desired tree.

I know I can trigger an event using BP_EVENT_RAISE FM, but I don't how to wake up the main process and how to transfer data between processes (I know I can do it by using a custom table, but maybe there is another way).

some help?

Read only

0 Likes
817

I don't think that it is a good idea to hang up a dialog process for that long, especially in sleep mode. I would advise that you have one main driver program, on the selection screen the user can elect to kick off the back ground program to do the processing. Then the use can check in SM37 to see if the job is finished yet, then he can run the same driver program which he can elect to run the report from the db table. I'm think the use of radiobuttons on the selection screen. We have done a couple programs like this at my company. User seems to be ok with it.

Regards,

Rich Heilman

Read only

0 Likes
817

Well, I think that's the option.

Thanks for the info.

Read only

Former Member
0 Likes
817

Use the function <b>GUI_IS_AVAILABLE</b> to find out whether GUI is available or not.

<b>if return_flag = 'X'.</b>

*Then show your report using CL_GUI_ALV_TREE.

<b>else.</b>

Show Report tree using RS Functions.

*Please see the report <b>ERGP2600</b> for your reference.This can be executed in the background.

<b>endif.</b>