cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Tree in Background

Former Member
0 Kudos

Is it possible to run an ALV Tree report in background? I tried using these codes:

IF cl_gui_alv_grid=>ontrol

EXPORTING container_name = 'CONTAINER_1'.

CREATE OBJECT l_grid

EXPORTING i_parent = l_control.

ELSE.

CREATE OBJECT l_grid

EXPORTING i_parent = l_dock.

ENDIF.

But I'm getting an error. Is there a way on how I can run this report in background?

Thanks in advance!

Beth

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I'm using 4.7 and I've run this program several times in background and I don't get any spool everytime. It just says COMPLETE but no spool.

Former Member
0 Kudos

Could you try running another simple WRITE based report and see if you get a spool file? It would help us figure out if this is a problem specific to the BCALV... program or if this is a problem for all reports.

Former Member
0 Kudos

Check your spool settings via SYSTEM->USER PROFILE->OWN DATA, tab DEFAULTS. I found that if I have Output Immediately and Delete After Output checked then I get no spool file from my batch job. If I uncheck both of them, then the spool file is available via SM37.

Let us know how it goes.

Answers (6)

Answers (6)

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Beth,

normally you plan your jobs with SM36 - here transaction defaults are without immediate deletion.

If you use SE38, F8, F9, then you are not specifying print options separately -> user settings are used.

Regards,

Christian

P.S.: Lucky Charles, who brought up the topic of print options?

Former Member
0 Kudos

Thanks Charles. I unchecked the Output Immediately and Delete After Output boxes and now I'm getting the spools. But i usually gets spools from my batch jobs so why did I have to unchecked those 2 options?

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Beth,

maybe you are printing and deleting your output immediately.

Check, which output parameters are defined in job planning. If there is:

- immediate output

- deletion after output

- a printer somewhere else in the building

you won't find any paper or spool in your system.

Just an idea,

Christian

Former Member
0 Kudos

Hi Charles! I ran the BCALV_TREE_DEMO program in foreground and got data. But if I ran it in background using the path you gave, I don't get any spool. It just tells me that it's complete.

Former Member
0 Kudos

Hi Beth,

Charles is correct. I ran the report in the background and got the spool. When you run it in the background, the job is scheduled and you can see its status in SM37.

Did you go to SM37 and check the job? Check the job log. See if there is a message there that is preventing the spool creation.

Regards,

Srinivas

Former Member
0 Kudos

I tried your suggestion but it still didn't work.

My program is a replica of the program BCALV_TREE_DEMO. I tried running this demo program in background and it completed but I didn't get any spool. Why is that so?

Any help on how to get my program or this demo program running in background would really be appreciated.

Former Member
0 Kudos

Hi Beth, in my 4.7 system, I ran BCALV_TREE_DEMO from SE38 using PROGRAM->EXECUTE->BACKGROUND. It finished successfully and I got a report in the spool. Have you executed it successfully online? In a non-training system, the data tables that this report reads are usually empty so maybe that is why you did not get a report. There is a utility program that will populate the tables. Take a look at table SFLIGHT via transaction SE16 and see if it has any data.

ssimsekler
Active Contributor
0 Kudos

Hi Beth

These controls require frontend to function. However, as I can remember if you pass a dummy container you can still instantiate the control object. Following is an ALV grid example.

<u>e.g.</u>


DATA: g_dock TYPE REF TO cl_gui_docking_container,
      g_grid TYPE REF TO cl_gui_alv_grid.

IF cl_gui_alv_grid=>offline( ) is initial.
    CREATE OBJECT g_dock.
ENDIF.

CREATE OBJECT g_grid
    EXPORTING I_PARENT = g_dock.

You can also check whether it is a background task with the system parameter <b>"sy-batch"</b>.

Hope these may helpyou to construct a similar procedure for ALV Tree.

Kind Regards

*--Serdar

ssimsekler@yahoo.com