BASIS
Function module
Used the same way in S/4HANA
JOB_CLOSE Close and Release Background Job
Sets the start condition of a background job whose steps have been added (immediately, date/time, event, predecessor job, period) and releases the job. It is the last step, called after JOB_OPEN and JOB_SUBMIT. Pass STRTIMMED = 'X' to start immediately; without release authorization the job stays scheduled, so check JOB_WAS_RELEASED.
- Function group
- BTCH
- Remote-enabled (RFC)
- No
- Type
- Function module
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| JOBNAME | TBTCJOB-JOBNAME | Job name | Yes |
| JOBCOUNT | TBTCJOB-JOBCOUNT | Job count | Yes |
| STRTIMMED | BTCH0000-CHAR1 | Start immediately | — |
| SDLSTRTDT | TBTCJOB-SDLSTRTDT | Planned start date | — |
| SDLSTRTTM | TBTCJOB-SDLSTRTTM | Planned start time | — |
| PRDDAYS | TBTCJOB-PRDDAYS | Period (days) | — |
| PRDHOURS | TBTCJOB-PRDHOURS | Period (hours) | — |
| PRDMINS | TBTCJOB-PRDMINS | Period (minutes) | — |
| EVENT_ID | TBTCJOB-EVENTID | Triggering event | — |
| PRED_JOBNAME | TBTCJOB-JOBNAME | Predecessor job name | — |
| PRED_JOBCOUNT | TBTCJOB-JOBCOUNT | Predecessor job count | — |
| PREDJOB_CHECKSTAT | TBTCSTRT-CHECKSTAT | Check predecessor job status | — |
| TARGETSERVER | BTCTGTSRVR-SRVNAME | Target server | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| JOB_WAS_RELEASED | BTCH0000-CHAR1 | Job was released |
Changing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| RET | I | Return code | — |
Exceptions
- CANT_START_IMMEDIATE — Job cannot start immediately
- INVALID_STARTDATE — Invalid start date
- JOBNAME_MISSING — Job name missing
- JOB_CLOSE_FAILED — Job could not be closed
- JOB_NOSTEPS — Job has no steps
- JOB_NOTEX — Job does not exist
- LOCK_FAILED — Lock failed
- INVALID_TARGET — Invalid target server
Call template (ABAP)
A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobname = lv_jobname
jobcount = lv_jobcount
IMPORTING
job_was_released = lv_job_was_released
CHANGING
ret = lv_ret
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9.Related tables
Can't find the report you need?
We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.