Skip to Content
author's profile photo Former Member
Former Member

Check if job is running

Is there a function module or something similar that can check if another job is currently running in batch mode?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on May 19, 2006 at 06:33 PM

    Also TRy

    /BDL/_READ_JOB_STATUS

    You can also see in SM51/50

    Hope this’ll give you idea!!

    <b>P.S award the points.</b>

    Good luck

    Thanks

    Saquib Khan

    "Some are wise and some are otherwise"

    Add a comment
    10|10000 characters needed characters exceeded

    • This will probably work.

      
      report zrich_0001 .
      
      
      data: xtbtco type   tbtco .
      
      parameters: p_job type tbtco-jobname.
      
      
      start-of-selection.
      
        clear xtbtco.
        select single  * from tbtco
                into xtbtco
                           where jobname = p_job
                             and status = 'R'.  " running
      
      
        if sy-subrc = 0.
          write:/ 'Job', p_job, ' is currently running'.
        endif.
      
      

      Statuses....

      
      Status of background job
      The following statuses are possible:
      
      <b>Scheduled:</b> Job defined, but not yet eligible to run even if the start condition has been fulfilled.
      
      <b>Released:</b> Job eligible to be started as soon as the start condition with which it was scheduled is fulfilled.
      
      <b>Ready:</b> Job waiting to start. The job has been released and the job's start condition has been fulfilled.
      
      <b>Active:</b> Job is currently running and can no longer be deleted or reset to scheduled.
      
      <b>Finished:</b> Job has been successfully completed. All job steps completed successfully.
      
      Note: the background processing system cannot always determine whether an external job step was successfully completed. In this case, the system assumes successful completion.
      
      <b>Terminated:</b> Job was ended abnormally either through user action or through an error in running a job step.
      
      
      
      

      Internal codes for these are as follows.

        btc_running       LIKE tbtco-status VALUE 'R',
        btc_ready         LIKE tbtco-status VALUE 'Y',
        btc_scheduled     LIKE tbtco-status VALUE 'P',
        btc_released      LIKE tbtco-status VALUE 'S',
        btc_aborted       LIKE tbtco-status VALUE 'A',
        btc_finished      LIKE tbtco-status VALUE 'F',
        btc_put_active    LIKE tbtco-status VALUE 'Z',
        btc_unknown_state LIKE tbtco-status VALUE 'X'.

      Regards,

      Rich Heilman

  • Posted on Nov 08, 2019 at 11:30 AM

    Please check the SHOW_JOBSTATE function.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 19, 2006 at 06:32 PM
    -1

    Tcode SM37 will give you the Job Overview.

    Regards,

    Suresh Datti

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.