# Mass Background Job Scheduling from Excel

> A custom program that schedules dozens of background jobs in one go from an Excel file after a go-live, a system copy or the opening of a new company code, with program, variant, step user, start time and period. Rows with the same job name are created as a multi-step job; program, variant and user are checked in advance, and no job is created in test mode.

- Type: Program, Custom development, Mass upload
- Module: BASIS
- Estimated effort: S (3–5 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-background-job-scheduling-from-excel/


## Why is the standard not enough?

SM36 defines jobs one by one, step by step on the screen; setting up hundreds of periodic jobs from a list takes hours and is prone to typos. After a system copy, BTCTRNS1/BTCTRNS2 only suspend and release existing jobs; they do not load a new job plan. This program loads the approved job plan list directly and keeps the result of each row in a log.

### Closest standard alternatives

- SM36: Defines jobs one by one on screen; no bulk scheduling from a file or pre-checks.
- SM37: Monitors and changes scheduled jobs; it does not load a new job plan.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| TBTCO | Job header; created through JOB_OPEN and JOB_CLOSE | Write | - | ECC + S/4 |
| TBTCP | Job steps; added through JOB_SUBMIT | Write | TBTCP-JOBNAME = TBTCO-JOBNAME AND TBTCP-JOBCOUNT = TBTCO-JOBCOUNT | ECC + S/4 |
| TRDIR | Check of program existence and type | Read | TRDIR-NAME = TBTCP-PROGNAME | ECC + S/4 |
| VARID | Existence check for the variant | Read | VARID-REPORT = TBTCP-PROGNAME AND VARID-VARIANT = TBTCP-VARIANT | ECC + S/4 |
| USR02 | Type and lock status of the step user | Read | USR02-BNAME = TBTCP-AUTHCKNAM | ECC + S/4 |

## BAPIs and functions used

- JOB_OPEN: Opens a new background job and returns the job count
- JOB_SUBMIT: Adds a step with program, variant and step user to the job
- JOB_CLOSE: Sets start time, period and target server, closes and releases the job
- BP_JOB_READ: Reads existing jobs with the same name
- BP_JOB_DELETE: Deletes the old scheduled job when the replace option is on

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Job plan file (XLSX or CSV) | Single value | - | Yes |
| P_TEST | Test mode (check without creating jobs) | Checkbox | - | No |
| P_RELEA | Release jobs immediately | Checkbox | - | No |
| P_REPL | Replace scheduled jobs with the same name | Checkbox | - | No |
| S_USTYP | Allowed step user types | Range / multiple | USR02-USTYP | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Job name | TBTCO-JOBNAME | Yes |
| Job class | TBTCO-JOBCLASS | No |
| Program | TBTCP-PROGNAME | Yes |
| Variant | TBTCP-VARIANT | No |
| Step user | TBTCP-AUTHCKNAM | Yes |
| Start date | TBTCO-SDLSTRTDT | Yes |
| Start time | TBTCO-SDLSTRTTM | Yes |
| Period (days) | TBTCO-PRDDAYS | No |
| Period (hours) | TBTCO-PRDHOURS | No |
| Period (months) | TBTCO-PRDMONTHS | No |
| Target server | TBTCO-EXECSERVER | No |

## Result list columns

| Column | Source |
|---|---|
| Row | Calculated: Row number in the file |
| Job name | TBTCO-JOBNAME |
| Job count | TBTCO-JOBCOUNT |
| Program | TBTCP-PROGNAME |
| Variant | TBTCP-VARIANT |
| Step user | TBTCP-AUTHCKNAM |
| Planned start | TBTCO-SDLSTRTDT |
| Job status | TBTCO-STATUS |
| Result | Calculated: Created / Replaced / Test / Skipped / Error |
| Message | Calculated: Check or job function message |

## How does the program work?

1. The file is read; consecutive rows with the same job name are grouped as steps of one job.
2. Checks: the program exists in TRDIR and is executable (SUBC = 1); the variant exists in VARID; the step user exists in USR02, is not locked and has an allowed type (default: system or service user); the start time is not in the past.
3. Depending on the selection, scheduled (P) or released (S) jobs with the same name are found with BP_JOB_READ and deleted with BP_JOB_DELETE if the replace option is on; otherwise the row is skipped.
4. In test mode only the check results are listed. In a real run the job is opened with JOB_OPEN and each step is added with JOB_SUBMIT with program, variant and step user.
5. JOB_CLOSE sets the start date/time, the period (minutes, hours, days, weeks, months) and the target server; depending on the selection the job is released immediately or left as scheduled.
6. The result is shown per row in ALV: job count, status and message; double-clicking the job name opens SM37.

## Authorization objects

- S_BTCH_JOB: Create and release jobs in the job group (RELE)
- S_BTCH_NAM: Run a step under another user name
- S_BTCH_ADM: Delete and change jobs of other users

## Frequently asked questions

### Can I export the current job plan and load it into another system?

Yes, an export option in the same template can be added: released periodic jobs in the source system are written to a file, edited and loaded in the target system. This takes about one extra day.

### Can event-triggered jobs be scheduled as well?

The basic template covers time-based starts. By adding event ID and parameter columns to the file, event-triggered jobs can also be scheduled with JOB_CLOSE; predecessor job chains can be added the same way.

### Can spool recipients or print parameters be provided?

Yes. Columns for printer, print immediately and spool list recipient per step can be added; JOB_SUBMIT supports these print parameters.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=basis-mass-background-job-scheduling-upload
