Professional Documents
Culture Documents
This Tutorial gives us a procedure to track most common occurring error in ALV and in
an easy way.
Purpose: This document details about the common problem faced by many consultants:
“Fatal Error – GUI cannot be reached” in ALV Grid Control.
Pre-requisites: The reader of this Tutorial is assumed to have some basic knowledge
regarding ALV and ALV grid controls.
The problem:
SAP® has provided us with some demo programs on ALV. We would use one of them in
our scenario. BCALV_GRID_DEMO is the demo program provided by SAP® for ALV
Grid Control. When you execute the program in foreground, you get the similar
following output:
When you schedule the same program in background, your job is cancelled due to an
error. Screenshot of the same is shown below:
Reason:
ALV Grid control is based on the custom controls on the screen. When the program is
scheduled in background, it tries to create GUI related front-end objects and hence the
error “Fatal Error – GUI cannot be reached”. This type of problem is common with all the
programs that use the ALV grid control to display the output.
Solution:
The docking container doesn’t need any of the custom controls on the screen; instead it
attaches an area to any or all of the four edges of the screen (top, left, right or bottom).
The behavior of the areas in the container is determined by the sequence in which they
are initialized. Docking Containers are attached to the screen from the inside out. This
means that when you create a second container, it is attached to the edge of the screen,
and the container that was already there is pushed outwards.
Let us modify the standard program (by taking a copy of it) to enable it to execute it in
background.
if cl_gui_alv_grid=>offline( ) is initial.
else .
endif .
Now test executing the program in background. The report would be generated.