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: 

background job

Former Member
0 Kudos

If we want to run any program in foreground and background.. what checks need to be done? or

what code need to be add to the program?

if any sample program plz help...

5 REPLIES 5

Former Member
0 Kudos

Check for the system field SY-BATCH. IF it is set to 'X" then it means program is running in background else foreground.

Regards,

Kiran Bobbala

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

U can put a check like below.

IF-sy-batch EQ space.

"Means for ground.

ELSE.

Means Back ground

ENDIF.

Check below points when u run the program as batch job.

All these cases will cause batch job to fail/cancel.

1. Any thing that makes interaction with front end like using GUI_DOWNLOAD fm, Using OOPS ALV/GRID display with FMS etc.

2. Error/Abort messages will cause failure.

Like this there are many things.

Generally if the program is taking much time we will run in background.

Thanks,

Vinod.

Former Member
0 Kudos

Hi

Good

1-No need to do any special coding in your report.

2-You can use the SM36 tcode to assign the background jobs for the report and in SM37 you can see the result, if you want to run the report in hourly basis or days basis.

3-If you want to run the report immediately than you can directly run the report by selecting the run in background option and select the immediately button in top so that it will run immediately and give you the result.

Thanks

mrutyun^

Former Member
0 Kudos

Hi,

System variable checks whether your program executing in ofre ground or back grund..

SY-BATCH...

Regards,

Kumar.

Former Member
0 Kudos

Hi Sri,

you can directly run the program in backgroung through

Menu path

Program -> Execute -> Background.

Please check this link

http://www.sap-basis-abap.com/sapab005.htm

http://help.sap.com/saphelp_bw30b/helpdata/en/73/69ef3d55bb11d189680000e829fbbd/content.htm

Best regards,

raam