02-07-2008 10:18 AM
In my application a program can executed either in foreground or in background. when the program is executed in
the foreground , I dont want to execute certain portion of the code. Similaly, when the job is executed as a background job,
I dont want to execute certain portion of the code. Is it possible? If yes, please share the details.
Thank you in advance.
02-07-2008 10:24 AM
Hi Raja,
You could do as per your requirement.
There is a system table field known as sy-batch. this field is initial if the program is getting executed in foreground. if sy-batch is not initial then, it means that the program is getting executed in background.
so use a simple if condition.
if sy-batch is initial.
<portion of code to be run in foreground>.
else.
<portion of code to be executed in background>.
endif.
Reward points if this helps,
Kiran
02-07-2008 10:20 AM
hi Raja,
you can check sy-batch during runtime. If it is 'X' it means the program wuns in background.
hope this helps
ec
02-07-2008 10:20 AM
02-07-2008 10:20 AM
Hi,
Check the portion with the system variable "sy-batch" .
This variable is 'X' when executing in background.
Jayant Sahu
02-07-2008 10:21 AM
Hi,
Possible. When a program is run in the background the system variable SY-BATCH is set to 'X'.
Hence by checking this variable you can segregate the code.
Regards,
Aditya
02-07-2008 10:24 AM
Hi Raja,
You could do as per your requirement.
There is a system table field known as sy-batch. this field is initial if the program is getting executed in foreground. if sy-batch is not initial then, it means that the program is getting executed in background.
so use a simple if condition.
if sy-batch is initial.
<portion of code to be run in foreground>.
else.
<portion of code to be executed in background>.
endif.
Reward points if this helps,
Kiran
02-07-2008 10:24 AM
Hi,
Check the below code...
IF sy-batch = 'X'.
Do back ground processing.
ELSE.
Do foreground processing.
ENDIF.
Rgds,
Bujji
02-07-2008 10:28 AM
also Func modules for uploading/downloading to/from appli server dosent work in background...........