# SAP Batch Job Tables (TBTCO, TBTCP) and Job Status Codes

> Source: https://netray.co/tools/sap-ecc-background-job-tables-tbtco-tbtcp-reference
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Reference of the tables behind SM37 on SAP ECC 6.0: job header, steps, schedules, events, spool and variants, with joins, plus the TBTCO-STATUS values.

## Category

sap

## Erp

SAP ECC 6.0

## Audience

- SAP Basis administrator
- ABAP developer
- SAP operations

## Tool

**Kind:** worksheet

**Mode:** reference

**Columns:**

#### Section

**Key:** section

**Type:** text

#### Table or code

**Key:** obj

**Type:** text

#### Description

**Key:** desc

**Type:** text

#### Key fields or SM37 label

**Key:** keys

**Type:** text

#### Join to or action

**Key:** join

**Type:** text

#### Typical use

**Key:** use

**Type:** text

**Rows:**

**Section:** Tables

**Obj:** TBTCO

**Desc:** Job header: one row per job run

**Keys:** JOBNAME, JOBCOUNT; STATUS, SDLSTRTDT, SDLSTRTTM, STRTDATE, STRTTIME, ENDDATE, ENDTIME, SDLUNAME, REAXSERVER, JOBCLASS

**Join:** TBTCP on JOBNAME + JOBCOUNT

**Use:** Runtime and failure reports across all jobs

**Section:** Tables

**Obj:** TBTCP

**Desc:** Job steps

**Keys:** JOBNAME, JOBCOUNT, STEPCOUNT; PROGNAME, VARIANT, AUTHCKNAM (step user), LISTIDENT (spool), XPGPROG (external program)

**Join:** TBTCO on JOBNAME + JOBCOUNT; TSP01 on LISTIDENT = RQIDENT

**Use:** Find jobs running a given program or variant

**Section:** Tables

**Obj:** TBTCS

**Desc:** Time schedule control for scheduled periodic jobs

**Keys:** JOBNAME, JOBCOUNT, SDLSTRTDT, SDLSTRTTM, PRDMINS

**Join:** TBTCO on JOBNAME + JOBCOUNT

**Use:** Next planned start of time-based jobs

**Section:** Tables

**Obj:** BTCEVTJOB

**Desc:** Jobs waiting for events

**Keys:** EVENTID, EVENTPARM, JOBNAME, JOBCOUNT

**Join:** TBTCO on JOBNAME + JOBCOUNT

**Use:** Which jobs start after event SAP_END_OF_JOB or a custom event

**Section:** Tables

**Obj:** BTCSED

**Desc:** Descriptions of system event IDs

**Keys:** LANGUAGE, EVENTID, DESCRIPT

**Join:** BTCEVTJOB on EVENTID

**Use:** Document SAP-delivered events

**Section:** Tables

**Obj:** BTCUED

**Desc:** Descriptions of user event IDs

**Keys:** EVENTID, language and description text

**Join:** BTCEVTJOB on EVENTID

**Use:** Document custom events created in SM62

**Section:** Tables

**Obj:** TSP01

**Desc:** Spool requests

**Keys:** RQIDENT (spool number), RQOWNER, RQ0NAME, RQ1NAME, RQ2NAME, RQCRETIME

**Join:** TBTCP on RQIDENT = LISTIDENT

**Use:** Locate the spool list of a job step

**Section:** Tables

**Obj:** TSP02

**Desc:** Output requests for spool requests

**Keys:** PJIDENT (spool number), PJNUMMER

**Join:** TSP01 on PJIDENT = RQIDENT

**Use:** Was the job output printed and where

**Section:** Tables

**Obj:** VARID

**Desc:** Variant directory

**Keys:** REPORT, VARIANT; ENAME, AEDAT

**Join:** TBTCP on PROGNAME = REPORT and VARIANT

**Use:** Who created or changed a job variant

**Section:** Tables

**Obj:** VARIT

**Desc:** Variant texts

**Keys:** LANGU, REPORT, VARIANT, VTEXT

**Join:** VARID on REPORT + VARIANT

**Use:** Variant descriptions for documentation

**Section:** Tables

**Obj:** VARI

**Desc:** Variant contents (cluster storage)

**Keys:** RELID, REPORT, VARIANT (cluster key)

**Join:** Read with function RS_VARIANT_CONTENTS, not SE16

**Use:** Selection values used by a job step

**Section:** Tables

**Obj:** TST01 / TST03

**Desc:** TemSe object directory and data, where job logs are stored

**Keys:** TemSe object name

**Join:** Read job logs with BP_JOBLOG_READ

**Use:** Job log text, never queried directly

**Section:** Status

**Obj:** P

**Desc:** Scheduled: job defined, no start condition released

**Keys:** SM37: Scheduled

**Join:** Release in SM37 (Job > Release)

**Use:** Jobs left unreleased after a transport or copy

**Section:** Status

**Obj:** S

**Desc:** Released: start condition set, waiting for time or event

**Keys:** SM37: Released

**Join:** Change start condition, unrelease, delete

**Use:** Normal state of periodic jobs between runs

**Section:** Status

**Obj:** Y

**Desc:** Ready: start time reached, waiting for a free background work process

**Keys:** SM37: Ready

**Join:** Check SM50 for busy BGD processes

**Use:** Long Ready times indicate too few background work processes

**Section:** Status

**Obj:** R

**Desc:** Active: running in a background work process

**Keys:** SM37: Active

**Join:** Check status, cancel active job, debug via SM50

**Use:** Long runners and stuck jobs

**Section:** Status

**Obj:** F

**Desc:** Finished: all steps ended without error

**Keys:** SM37: Finished

**Join:** Display job log and spool

**Use:** Normal end

**Section:** Status

**Obj:** A

**Desc:** Canceled: a step ended with an error or the job was cancelled

**Keys:** SM37: Canceled

**Join:** Display job log, check ST22 for dumps

**Use:** Failure monitoring

**Section:** Status

**Obj:** Z

**Desc:** Put active: transitional status while the job is being handed to a work process

**Keys:** Constant btc_put_active

**Join:** Normally changes to R within seconds

**Use:** Jobs stuck in Z point to work process or server problems

**Section:** Status

**Obj:** X

**Desc:** Unknown status

**Keys:** Constant btc_unknown_state

**Join:** Run the consistency check in SM65

**Use:** Inconsistencies after server crashes

**Section:** Tools

**Obj:** SM36 / SM37 / SMX

**Desc:** Define jobs, monitor all jobs, monitor own jobs

**Keys:** Job name, user, status, date

**Join:** TBTCO, TBTCP

**Use:** Daily job operations

**Section:** Tools

**Obj:** SM62 / SM64

**Desc:** Maintain background events / trigger an event

**Keys:** EVENTID, parameter

**Join:** BTCEVTJOB

**Use:** Event-driven job chains

**Section:** Tools

**Obj:** BP_JOB_READ / BP_JOBLOG_READ

**Desc:** Function modules to read job data and job log

**Keys:** JOBNAME, JOBCOUNT

**Join:** TBTCO, TBTCP, TemSe

**Use:** Custom job monitoring programs

**Section:** Tools

**Obj:** JOB_OPEN / JOB_SUBMIT / JOB_CLOSE

**Desc:** Function modules to create and release jobs from ABAP

**Keys:** JOBNAME, JOBCOUNT returned by JOB_OPEN

**Join:** SUBMIT ... VIA JOB is an alternative to JOB_SUBMIT

**Use:** Program-scheduled jobs

**Section:** Tools

**Obj:** RSBTCDEL2

**Desc:** Report to delete old job data and logs

**Keys:** Age in days, job name pattern

**Join:** Usually scheduled as standard job SAP_REORG_JOBS

**Use:** Keep TBTCO and TemSe small

**Notes:** Status letters are the constants defined in the background processing include LBTCHDEF (btc_scheduled P, btc_released S, btc_ready Y, btc_running R, btc_finished F, btc_aborted A, btc_put_active Z, btc_unknown_state X). Verify field lists in SE11 on your release.

## Content

**Intro:** A reference of the tables behind SM36 and SM37 on SAP ECC 6.0, with key fields and how they join, plus every TBTCO-STATUS value and what to do about it. Use it to build job reports in SE16N, SQVI or ABAP.

**Sections:**

#### How to use it

**Body:** Filter the Section column: Tables for the data model, Status for TBTCO-STATUS values, Tools for transactions, function modules and reports. A job is identified by JOBNAME plus JOBCOUNT (an 8-character number assigned at creation), so every join uses both fields. TBTCO has one row per job run; periodic jobs create a new JOBCOUNT for each run, which is why counting rows by JOBNAME shows run history.

#### Worked example: which jobs run program X with which variant

**Body:** In SE16N or SQVI, join TBTCP to TBTCO on JOBNAME and JOBCOUNT. Filter TBTCP-PROGNAME = 'RMMRP000' and TBTCO-STATUS = 'S' to find released MRP jobs, then read TBTCP-VARIANT and TBTCP-AUTHCKNAM to see the variant and step user. Join VARID on REPORT = PROGNAME and VARIANT to see who last changed the variant. For finished runs, TBTCP-LISTIDENT gives the spool number, the same as TSP01-RQIDENT. In Open SQL the core is: SELECT o~jobname o~status o~strtdate p~progname p~variant FROM tbtco AS o INNER JOIN tbtcp AS p ON p~jobname = o~jobname AND p~jobcount = o~jobcount, which works on any ECC 6.0 release.

**Bullets:**

- Runtime: ENDDATE/ENDTIME minus STRTDATE/STRTTIME in TBTCO
- Delay: STRTDATE/STRTTIME minus SDLSTRTDT/SDLSTRTTM
- Failures: STATUS = 'A' by date and JOBNAME

#### Reading the status codes

**Body:** P and S are planning states: P means no start condition is released, S means the job waits for its time or event. Y means the start time is reached but no background work process is free, so a growing number of Y jobs at peak times is a capacity signal, not a job problem. R is running, F finished and A canceled. Z is a short transitional state while the job is handed to a work process. X means the system cannot determine the state, typically after a server crash; run the consistency check in SM65 before deleting anything.

#### Gotchas

**Body:** Job logs are not in TBTCO or TBTCP; they are TemSe objects, so read them with BP_JOBLOG_READ or SM37, never by querying TST03. VARI is a cluster table, so variant values need RS_VARIANT_CONTENTS. TBTCO-SDLUNAME is the user who scheduled the job, while TBTCP-AUTHCKNAM is the user whose authorizations each step runs under; audits need the step user. If RSBTCDEL2 is not scheduled, TBTCO and TemSe grow without limit and SM37 selections slow down.

**Cta:** If you want operations staff to ask in plain English which jobs failed last night and why, answered from TBTCO and job logs on your own servers, we can set that up.

**Faq:**

#### Which SAP table stores batch jobs and their steps?

**Answer:** TBTCO holds the job header with JOBNAME, JOBCOUNT, status and start and end times. TBTCP holds the steps: one row per STEPCOUNT with the program (PROGNAME), variant and step user. Join them on JOBNAME and JOBCOUNT.

#### Which table links a batch job to its spool?

**Answer:** TBTCP-LISTIDENT contains the spool request number created by the step. It matches TSP01-RQIDENT, where the spool request owner, names and creation time are stored. TSP02 holds the output requests for that spool.

#### What are the SAP batch job status codes?

**Answer:** In TBTCO-STATUS: P scheduled, S released, Y ready, R active, F finished, A canceled, Z put active (transitional) and X unknown. SM37 shows the same states with labels. The letters are constants in the include LBTCHDEF.

#### Which table stores job variants?

**Answer:** Variant names per program are in VARID, texts in VARIT, and the selection values in cluster table VARI. The variant used by a job step is in TBTCP-VARIANT. Read variant values with function module RS_VARIANT_CONTENTS rather than directly.

## Search terms

sap batch job tables, sap table for batch jobs and the steps, sap batch job variant table, table for sap batch job spool, sap batch job status codes, sap table for batch job with program name, tbtco status values, tbtcp table

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
