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: 

How to know if a program is running in background

Former Member
0 Kudos

Hi experts,

I need your expertise on a particular situation. I have a program which can either be scheduled in background job or can be executed online.

If the program is executed in background there is a specific statement block which needs to be executed only when the program is schedule in a background job. My concern is how can I know if the program is being run in background so that I can trigger this specific code statements.

Any help will be greatly useful.

Thanks

Shabir

1 ACCEPTED SOLUTION

sachin_mathapati
Contributor
0 Kudos

Hi ,

Check for system field Sy-batch.

If program is run in backgroung Sy-batch will be X.

Regards,

Sachin M M

6 REPLIES 6

former_member1245113
Active Contributor
0 Kudos

Hi,

try using the FM JOB_OPEN

JOB_SUBMIT

JOB_CLOSE

Also take the KEY word help of SY-BATCH

Regards

Ramchander Rao.K

sachin_mathapati
Contributor
0 Kudos

Hi ,

Check for system field Sy-batch.

If program is run in backgroung Sy-batch will be X.

Regards,

Sachin M M

Former Member
0 Kudos

SY-BATCH = 'X' in background.

Regards,

Mohaiyuddin

Former Member
0 Kudos

Hi Shabir,

Use sy-batch parameter.

Thanks

Nitesh

Former Member
0 Kudos

Hi,

You can check for system variables SY-BATCH, for programs that run in background and SY-BINPT , for BDC sessions running in Background. Execute the code block if either of them is set to 'X'

regards,

Advait

Edited by: Advait Gode on Dec 2, 2008 9:42 AM

Former Member
0 Kudos

Hi Sabir ,

If Sy-Batch = 'X'

Write the Specific code that you want to run in background.

endif.

Thanks.