Application Development and Automation 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: 
Read only

how do i force a program to only in background

Former Member
0 Likes
1,825

a zreport which is gives stock report and mrp and some data. It is IS retail so the materials are huge. i need to run this program on in background even if it is intended to run ionf oreground. pls suggest

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,281

Hi navid,

1. simple

2. sy-batch

3. Use this variable

it will contain 'X'

only if the program is run in background

4. START-OF-SELECTION.

IF SY-BATCH IS INITIAL.

MESSAGE 'CANNOT RUN IN FOREGROUND' TYPE 'I'.

LEAVE LIST-PROCESSING.

ENDIF.

regards,

amit m.

6 REPLIES 6
Read only

Former Member
0 Likes
1,281

Hi Navid

Create a background job in SM35, schedule it in SM36.

You can view the status in SM37.

Reward points if found useful

Regards

Inder

Read only

0 Likes
1,281

hi indrajeet. in the company there are many users who will be running this report and are not that patient or co operative to do waht you say. i am sking for a some function module which will by default run it in background come waht may. please suggest on those grounds

Read only

Former Member
0 Likes
1,282

Hi navid,

1. simple

2. sy-batch

3. Use this variable

it will contain 'X'

only if the program is run in background

4. START-OF-SELECTION.

IF SY-BATCH IS INITIAL.

MESSAGE 'CANNOT RUN IN FOREGROUND' TYPE 'I'.

LEAVE LIST-PROCESSING.

ENDIF.

regards,

amit m.

Read only

0 Likes
1,281

thank you amit,

i hide tired it but my mistake was i used ' if sy-batch

= ' '. and not in start of selection and so it used to stop any processing. silly mistake

Read only

Former Member
0 Likes
1,281

Write a statement like


REPORT ZTEST MESSAGE-ID ZZ..

PARAMETERS: MATNR LIKE MARA-MATNR.

INITIALIZATION.

IF SY-BATCH = SPACE.

MESSAGE E001 WITH 'NOT IN BACKGROUND'.
ENDIF.

START-OF-SELECTION.

WRITE : MATNR.

If you want to see the screen you could write the condition in at- selection screen.

cheers,

TM

Read only

0 Likes
1,281

navid bahi sahib kidhar ho aap aaj kal?