SAP SHOW_JOBSTATE Function Module for Determine Job Status
SHOW_JOBSTATE is a standard show jobstate SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine Job Status processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for show jobstate FM, simply by entering the name SHOW_JOBSTATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: BTCH
Program Name: SAPLBTCH
Main Program: SAPLBTCH
Appliation area: S
Release date: 07-Mar-1995
Mode(Normal, Remote etc): Normal Function Module
Update:
Function SHOW_JOBSTATE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'SHOW_JOBSTATE'"Determine Job Status.
EXPORTING
JOBCOUNT = "ID Number of Job
JOBNAME = "Job Name
IMPORTING
ABORTED = "Status 'Canceled'
FINISHED = "Status 'Finished'
PRELIMINARY = "Status 'Scheduled Temporarily'
READY = "Status 'Ready for Execution'
RUNNING = "Status 'Active'
SCHEDULED = "Status 'Scheduling Released'
SUSPENDED = "Status 'Descheduled Due to Upgrade'
OTHER = "Other (Invalid) Status
EXCEPTIONS
JOBCOUNT_MISSING = 1 JOBNAME_MISSING = 2 JOB_NOTEX = 3
IMPORTING Parameters details for SHOW_JOBSTATE
JOBCOUNT - ID Number of Job
Data type: TBTCO-JOBCOUNTOptional: No
Call by Reference: No ( called with pass by value option)
JOBNAME - Job Name
Data type: TBTCO-JOBNAMEOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SHOW_JOBSTATE
ABORTED - Status 'Canceled'
Data type: TBTCV-ABORTOptional: No
Call by Reference: No ( called with pass by value option)
FINISHED - Status 'Finished'
Data type: TBTCV-FINOptional: No
Call by Reference: No ( called with pass by value option)
PRELIMINARY - Status 'Scheduled Temporarily'
Data type: TBTCV-PRELIMOptional: No
Call by Reference: No ( called with pass by value option)
READY - Status 'Ready for Execution'
Data type: TBTCV-READYOptional: No
Call by Reference: No ( called with pass by value option)
RUNNING - Status 'Active'
Data type: TBTCV-RUNOptional: No
Call by Reference: No ( called with pass by value option)
SCHEDULED - Status 'Scheduling Released'
Data type: TBTCV-SCHEDOptional: No
Call by Reference: No ( called with pass by value option)
SUSPENDED - Status 'Descheduled Due to Upgrade'
Data type: BTCSTATUSOptional: No
Call by Reference: No ( called with pass by value option)
OTHER - Other (Invalid) Status
Data type: BTCSTATUSOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
JOBCOUNT_MISSING - No Job ID Number Specified
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
JOBNAME_MISSING - No Job Name Specified
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
JOB_NOTEX - Specified Job Does Not Exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SHOW_JOBSTATE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_aborted | TYPE TBTCV-ABORT, " | |||
lv_jobcount | TYPE TBTCO-JOBCOUNT, " | |||
lv_jobcount_missing | TYPE TBTCO, " | |||
lv_jobname | TYPE TBTCO-JOBNAME, " | |||
lv_finished | TYPE TBTCV-FIN, " | |||
lv_jobname_missing | TYPE TBTCV, " | |||
lv_job_notex | TYPE TBTCV, " | |||
lv_preliminary | TYPE TBTCV-PRELIM, " | |||
lv_ready | TYPE TBTCV-READY, " | |||
lv_running | TYPE TBTCV-RUN, " | |||
lv_scheduled | TYPE TBTCV-SCHED, " | |||
lv_suspended | TYPE BTCSTATUS, " | |||
lv_other | TYPE BTCSTATUS. " |
  CALL FUNCTION 'SHOW_JOBSTATE' "Determine Job Status |
EXPORTING | ||
JOBCOUNT | = lv_jobcount | |
JOBNAME | = lv_jobname | |
IMPORTING | ||
ABORTED | = lv_aborted | |
FINISHED | = lv_finished | |
PRELIMINARY | = lv_preliminary | |
READY | = lv_ready | |
RUNNING | = lv_running | |
SCHEDULED | = lv_scheduled | |
SUSPENDED | = lv_suspended | |
OTHER | = lv_other | |
EXCEPTIONS | ||
JOBCOUNT_MISSING = 1 | ||
JOBNAME_MISSING = 2 | ||
JOB_NOTEX = 3 | ||
. " SHOW_JOBSTATE |
ABAP code using 7.40 inline data declarations to call FM SHOW_JOBSTATE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single ABORT FROM TBTCV INTO @DATA(ld_aborted). | ||||
"SELECT single JOBCOUNT FROM TBTCO INTO @DATA(ld_jobcount). | ||||
"SELECT single JOBNAME FROM TBTCO INTO @DATA(ld_jobname). | ||||
"SELECT single FIN FROM TBTCV INTO @DATA(ld_finished). | ||||
"SELECT single PRELIM FROM TBTCV INTO @DATA(ld_preliminary). | ||||
"SELECT single READY FROM TBTCV INTO @DATA(ld_ready). | ||||
"SELECT single RUN FROM TBTCV INTO @DATA(ld_running). | ||||
"SELECT single SCHED FROM TBTCV INTO @DATA(ld_scheduled). | ||||
Search for further information about these or an SAP related objects