Skip to Content
avatar image
Former Member

How to know if a program is running in background

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Dec 02, 2008 at 08:37 AM

    Hi ,

    Check for system field Sy-batch.

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

    Regards,

    Sachin M M

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 02, 2008 at 08:37 AM

    Hi,

    try using the FM JOB_OPEN

    JOB_SUBMIT

    JOB_CLOSE

    Also take the KEY word help of SY-BATCH

    Regards

    Ramchander Rao.K

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 02, 2008 at 08:40 AM

    Hi Shabir,

    Use sy-batch parameter.

    Thanks

    Nitesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 02, 2008 at 08:47 AM

    Hi Sabir ,

    If Sy-Batch = 'X'

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

    endif.

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 02, 2008 at 08:39 AM

    SY-BATCH = 'X' in background.

    Regards,

    Mohaiyuddin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 02, 2008 at 08:41 AM

    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

    Add comment
    10|10000 characters needed characters exceeded