Skip to Content
avatar image
Former Member

Control Framework: Fatal error - GUI cannot be reached

Hi Everyone

I have written a program that uses the cl_gui_alv_grid class to display data. The program works fine when run in the foreground but if a user tries to run it in the background they get the above error.

I understand that this is because the program is unable to access gui components when running in the background. I therefore need to test for background processing and either:

1. terminate the program

2. have some fallback procedure within the program to deal with background processing.

My question is therefore in two parts:

1. How do I find out if the program has been set to run in the background?

2. What do I need to do to allow my program to work in the background? i.e. is there a function/class that I can pass the data to that will do this or do I have to re-write the report in full as if I wasn't using the grid viewer at all?

Kind regards

Andrew

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 21, 2006 at 02:08 PM

    Hi,

    Do this,

    CREATE the container only upon the following condition.

    IF CL_GUI_ALV_GRID=>OFFLINE IS INITIAL

    CREATE THE CONTAINER

    ENDIF.

    Continue with creating the grid, field catalog etc etc.

    Regards,

    Ravi

    Note :Please close the post, if the issue is answered.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 21, 2006 at 02:05 PM

    Hello Andrew,

    to 1.) If SY-Batch is initial.

    " it's dialog.

    ELSE.

    " it's batch

    ENDIF.

    to 2.) Display data in batch in an old fashioned way, e.g.

    using FM 'REUSE_ALV_LIST DISPLAY' .

    Regards Wolfgang

    Add comment
    10|10000 characters needed characters exceeded