# BP_JOB_MODIFY — Modify Background Job

> Changes the header, steps or start condition of an existing background job; with the operation code (OPCODE) it also releases or de-releases jobs. Administration tools that update job scheduling from a program use it. Only jobs that have not started yet can be changed; of its many exceptions handle at least JOB_NOT_MODIFIABLE_ANYMORE and NO_MODIFY_PRIVILEGE_GIVEN.

- 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/bp-job-modify/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| DIALOG | BTCH0000-CHAR1 | Dialog mode | Yes |
| JOBNAME | TBTCJOB-JOBNAME | Job name | - |
| JOBCOUNT | TBTCJOB-JOBCOUNT | Job count | - |
| OPCODE | BTCH0000-INT4 | Operation code | - |
| NEW_JOBHEAD | TBTCJOB | New job header | - |
| RELEASE_STDT | TBTCSTRT | Start condition for release | - |
| RELEASE_TARGETSERVER | BTCTGTSRVR-SRVNAME | Target server | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| MODIFIED_JOBHEAD | TBTCJOB | Modified job header |

## Changing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| EMSG | SYMSG | Error message | - |
| RET | I | Return code | - |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| NEW_STEPLIST | TBTCSTEP | New step list | Yes |

## Exceptions

- CANT_DERELEASE_JOB: Job could not be de-released
- CANT_ENQ_JOB: Job could not be locked
- CANT_READ_JOBDATA: Job data could not be read
- CANT_RELEASE_JOB: Job could not be released
- CANT_SET_JOBSTATUS_IN_DB: Job status could not be set in database
- CANT_START_JOB_IMMEDIATELY: Job cannot start immediately
- CANT_UPDATE_JOBDATA: Job data could not be updated
- INVALID_DIALOG_TYPE: Invalid dialog type
- INVALID_NEW_JOBDATA: Invalid new job data
- INVALID_NEW_JOBSTATUS: Invalid new job status
- INVALID_OPCODE: Invalid operation code
- INVALID_STARTDATE: Invalid start date
- JOB_EDIT_FAILED: Job edit failed
- JOB_MODIFY_CANCELED: Modification canceled
- JOB_NOT_MODIFIABLE_ANYMORE: Job can no longer be modified
- NOTHING_TO_DO: Nothing to do
- NO_MODIFY_PRIVILEGE_GIVEN: No modify authorization
- NO_RELEASE_PRIVILEGE_GIVEN: No release authorization
- NO_BATCH_SERVER_FOUND: No batch server found

## Call template (ABAP)

```abap
CALL FUNCTION 'BP_JOB_MODIFY'
  EXPORTING
    dialog = lv_dialog
  IMPORTING
    modified_jobhead = lv_modified_jobhead
  CHANGING
    emsg = lv_emsg
    ret = lv_ret
  TABLES
    new_steplist = lt_new_steplist
  EXCEPTIONS
    cant_derelease_job = 1
    cant_enq_job = 2
    cant_read_jobdata = 3
    cant_release_job = 4
    cant_set_jobstatus_in_db = 5
    cant_start_job_immediately = 6
    cant_update_jobdata = 7
    invalid_dialog_type = 8
    OTHERS = 9.
```

## Related tables

TBTCO, TBTCP

