Application Development 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: 

ALV Report in background

Former Member
0 Kudos

Hi All,

I have developed a zreport using reuse_alv_list_display. But due to performance reasons as it is fetching data from BSEG table, is very slow.

So it is decided that this report will be executed in back ground. But after executing in background it is not displaying all the columns. Only first few columns are get displayed. How to overcome this problem?

Regards,

Dilip

3 REPLIES 3

former_member182371
Active Contributor
0 Kudos

Hi Diliip,

this was "

Suresh Kumar Parvathaneni´s

" answer to the problem. (i´ve tried to find the post in the forum but i haven´t been able to)
So here goes the answer litterally:

Execution of ALV grid control in background

Whenever an ALV grid control program is executed in background, a short dump occurs stating:
Fatal error: GUI cannot be reached
And whenever an ALV grid control program is executed, it tries to create some front-end related objects. But when the same program is executed in background, the above error occurs as it fails to create front-end objects (GUI objects). So in order to rectify this problem, we need to use the docking container instead of our custom container.
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.
Here is a sample code we use in our programs:
data: or_doc type ref to cl_gui_docking_container .
if cl_gui_alv_grid=>offline( ) is initial.
create object or_custom_container
exporting container_name = c_container.
create object or_grid
exporting i_parent = or_custom_container.
else .
create object or_grid
exporting i_parent = or_doc .
endif .
We can use either cl_gui_alv_grid=>offline() or SY-BATCH is 'X' to check if the program is being executed in background or not.

Best regards.

Former Member
0 Kudos

Hi,

Could you please increase the line size and see if that makes a difference? I am assuming that you are able to see only the first few columns of the report.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

hi, I think the place you check the ALV output result in background is spool. Am I right?

In the background case, the ALV will be treated as print output type, and export into SPOOL.

As we known, SPOOL has a limitation on line length.

that's the reason why you can't obtain all the column as expected. This limitation can't be broken.

In my opinion, you can output a file which has excel or comma separated format, replace ALV output in background.

Hope it will be helpful