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: 

Get job status

alejandro_romero2
Participant
0 Kudos

Hi gurus does any one knows if there is a way to know the status of a job? or is there is a funtion module to know if a job is still runnnig?

1 ACCEPTED SOLUTION

former_member218674
Contributor
0 Kudos

Hello,

You can use BP_JOB_STATUS_GET to get the status of particular job.



CALL FUNCTION 'BP_JOB_STATUS_GET'
  EXPORTING
    jobcount                         =  ---> provide job number here
    jobname                          = ---> provide job name here
* IMPORTING
*   STATUS                           =
*   HAS_CHILD                        =
* EXCEPTIONS
*   JOB_DOESNT_EXIST                 = 1
*   UNKNOWN_ERROR                    = 2
*   PARENT_CHILD_INCONSISTENCY       = 3
*   OTHERS                           = 4
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hope this helps!

Thanks,

Augustin.

Edited by: Augustarian on Aug 26, 2009 8:46 PM

2 REPLIES 2

former_member194669
Active Contributor
0 Kudos

Check this


    call function 'SHOW_JOBSTATE'
      exporting
        jobcount         = p_jobc
        jobname          = p_jobn
      importing
        aborted          = v_aborted
        finished         = v_finished
        ready            = v_ready
        running          = v_running
        scheduled        = v_scheduled
      exceptions
        jobcount_missing = 1
        jobname_missing  = 2
        job_notex        = 3
        others           = 4.

former_member218674
Contributor
0 Kudos

Hello,

You can use BP_JOB_STATUS_GET to get the status of particular job.



CALL FUNCTION 'BP_JOB_STATUS_GET'
  EXPORTING
    jobcount                         =  ---> provide job number here
    jobname                          = ---> provide job name here
* IMPORTING
*   STATUS                           =
*   HAS_CHILD                        =
* EXCEPTIONS
*   JOB_DOESNT_EXIST                 = 1
*   UNKNOWN_ERROR                    = 2
*   PARENT_CHILD_INCONSISTENCY       = 3
*   OTHERS                           = 4
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hope this helps!

Thanks,

Augustin.

Edited by: Augustarian on Aug 26, 2009 8:46 PM