# JOB_OPEN — Open Background Job

> Creates a new background job and returns its job count (JOBCOUNT); it is the first step of the trio used together with JOB_SUBMIT and JOB_CLOSE. Custom programs use it to run or schedule a report in the background from code. Pass the returned JOBCOUNT and JOBNAME unchanged to the next two calls and always handle the exceptions.

- Modules: BASIS
- Type: Function module
- Function group: BTCH
- Remote-enabled (RFC): No
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/job-open/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| JOBNAME | TBTCJOB-JOBNAME | Job name | Yes |
| JOBGROUP | TBTCJOB-JOBGROUP | Job group | - |
| SDLSTRTDT | TBTCJOB-SDLSTRTDT | Planned start date | - |
| SDLSTRTTM | TBTCJOB-SDLSTRTTM | Planned start time | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| JOBCOUNT | TBTCJOB-JOBCOUNT | Job count |
| INFO | I | Info code |

## Changing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| RET | I | Return code | - |

## Exceptions

- CANT_CREATE_JOB: Job could not be created
- INVALID_JOB_DATA: Invalid job data
- JOBNAME_MISSING: Job name missing

## Call template (ABAP)

```abap
CALL FUNCTION 'JOB_OPEN'
  EXPORTING
    jobname = lv_jobname
  IMPORTING
    jobcount = lv_jobcount
    info = lv_info
  CHANGING
    ret = lv_ret
  EXCEPTIONS
    cant_create_job = 1
    invalid_job_data = 2
    jobname_missing = 3
    OTHERS = 4.
```

## Related tables

TBTCO

