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: 

On-line or background

Former Member
0 Kudos

Hello, I have a problem when I can throw my program in background or on-line.

If I throw my program on-line I use CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' but if I throw the program in background I have to CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

So I need to declare a data to control when I throw my program on line or in background.

What is the type of 'data' control that??

Sy-batch doesn't work

Thanks a lot in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

If sy-batch = 'X', then the code following this condition, will be executed in background.

Regards,

Ramya

6 REPLIES 6

Former Member
0 Kudos

SY-BATCH should work. Its set to 'X' for background.

Former Member
0 Kudos

Hi,

If sy-batch = 'X', then the code following this condition, will be executed in background.

Regards,

Ramya

ThomasZloch
Active Contributor
0 Kudos

No need for action, if you schedule a program using Grid Display in background, it will create the spool using List Display, just like what the print preview button from the Grid Display does. In other words, the function Grid Display has that sy-batch check built in already.

Cheers

Thomas

Former Member
0 Kudos

OK I agree sy-batch EQ 'X'. I think that the problem would be the ALV.

REUSE_ALV_LIST_DISPLAY is not a good option in background.

Anybody could have any information about this?

Thanks a lot.

Former Member
0 Kudos

Hi,

You need not go for a different display format when the program runs in background. The output of the ALV will be sent to SPOOL automatically in ALV LIST format when executed in background mode.

Remove logic of background/ foreground, execute in background and you can find it in SPOOL.

It is possible to display the output in a GRID format after executing the program in background.

Example: I have 2 programs

Program 1: Which creates a job and submits Program 2

Program 2: Actual report which has the logic of selection and grid display.

In program 2 you can use EXPORT statement and export your result table to some memory ID.

In program 1 : after submitting the job, wait till job is completed. IMPORT the output table from the same memory ID and display this result in a grid format.

Consideration: Session in which you execute program 1 should not be closed until the background job is completed. If closed, there will not be grid display. Remember that the display logic should be written in Program 1 again after checking for the job status. The values will be present in the memory ID only after the completion of the background job.

Reward points if helpful.

Thanks and Regards,

Lakshmi.

Former Member
0 Kudos

THANKS A LOT