# GET_JOB_RUNTIME_INFO — Read Background Job Runtime Data

> Called from inside a program running in the background, it returns the name, count and step number of the job it runs in and the triggering event. Programs use it to write logs against their own job, to prevent parallel runs of the same job or to read the event parameter. If the program runs in the foreground, the NO_RUNTIME_INFO exception is raised.

- 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/get-job-runtime-info/

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| JOBNAME | TBTCM-JOBNAME | Job name |
| JOBCOUNT | TBTCM-JOBCOUNT | Job count |
| STEPCOUNT | TBTCM-STEPCOUNT | Step number |
| EVENTID | TBTCM-EVENTID | Triggering event |
| EVENTPARM | TBTCM-EVENTPARM | Event parameter |
| EXTERNAL_PROGRAM_ACTIVE | TBTCM-XPGACTIVE | External program active |

## Exceptions

- NO_RUNTIME_INFO: No runtime info (foreground)

## Call template (ABAP)

```abap
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
  IMPORTING
    jobname = lv_jobname
    jobcount = lv_jobcount
    stepcount = lv_stepcount
    eventid = lv_eventid
    eventparm = lv_eventparm
    external_program_active = lv_external_program_active
  EXCEPTIONS
    no_runtime_info = 1
    OTHERS = 2.
```


