{"audience":"BASIS administrators, application support teams and business units that own critical night jobs.","authorization_objects":[{"note":"Display background jobs of all users (BASIS administrator)","object":"S_BTCH_ADM"},{"note":"Display other users' jobs by job group","object":"S_BTCH_JOB"}],"components":[],"countries":[],"effort_days_max":4,"effort_days_min":3,"effort_size":"S","faq":[{"a":"There are two criteria: a finished job whose runtime exceeds its own average of the last N days by more than the threshold percentage, or a job that has been active longer than the threshold in minutes. Both thresholds are set on the selection screen.","q":"Which jobs count as \"long-running\"?"},{"a":"In the basic version you jump from the job name to the SM37 job log for the error. If needed, the last error line of the log can also be read and added as a separate column; this takes about one extra day.","q":"Does the error message from the job log appear in the list?"},{"a":"Yes. TBTCO, TBTCP and TRDIRT keep the same structure in S/4HANA. Jobs scheduled through Application Jobs (Fiori) are stored in the same tables, so they are included.","q":"Does the report work on S/4HANA?"}],"features":[{"code":"alv","label":"ALV list (sort, filter, subtotals)","note":""},{"code":"layout","label":"User-specific layout variants","note":""},{"code":"drilldown","label":"Double-click drill-down to the document","note":"Double-clicking the job name opens the job log in SM37."},{"code":"excel","label":"Export to Excel","note":""},{"code":"background","label":"Runs as a background job","note":""},{"code":"email","label":"Send the result by email","note":"Each morning, job owners can receive the findings for their own jobs."}],"functions":[],"gap":"SM37 lists jobs by status and date range and shows the duration, but it does not compare today's runtime of a job with its own historical average, does not calculate the delay against the planned start and does not show the step program and variant in the main list. How many times in a row a periodic job was cancelled is not visible either. The custom report does these comparisons and distributes the result in a morning email.","id":"basis-cancelled-long-running-jobs","industries":[],"input_columns":[],"kind":"report","language":"en","lastmod":"2026-11-17","logic":"1. Jobs that started within the selected date range or are still running are read from TBTCO: job name, job count, status (STATUS: A cancelled, R active, F finished), scheduling user, planned and actual start and end.\n2. Runtime (min) = end date/time − start date/time; for active jobs the current time is used instead of the end. Start delay = actual start − planned start (SDLSTRTDT/SDLSTRTTM).\n3. Reference runtime: the average of the successfully finished (F) runs of the same job name in the last N days. Deviation % = (runtime − average) ÷ average × 100.\n4. Jobs included: cancelled ones; those above the deviation threshold; those active for longer than the threshold. For periodic jobs, the number of consecutive cancelled runs is counted.\n5. The step program, variant and step user (AUTHCKNAM) are added from TBTCP and the program title from TRDIRT. For multi-step jobs, the first cancelled step is shown.\n6. The result is sorted by finding in ALV; double-clicking the job name opens the job log in SM37.","module":"BASIS","object_type":"alv_report","output_columns":[{"calculated":false,"formula":"","label":"Job name","source_field":"JOBNAME","source_table":"TBTCO"},{"calculated":false,"formula":"","label":"Status","source_field":"STATUS","source_table":"TBTCO"},{"calculated":false,"formula":"","label":"Scheduled by","source_field":"SDLUNAME","source_table":"TBTCO"},{"calculated":false,"formula":"","label":"Step program","source_field":"PROGNAME","source_table":"TBTCP"},{"calculated":false,"formula":"","label":"Program title","source_field":"TEXT","source_table":"TRDIRT"},{"calculated":false,"formula":"","label":"Variant","source_field":"VARIANT","source_table":"TBTCP"},{"calculated":false,"formula":"","label":"Step user","source_field":"AUTHCKNAM","source_table":"TBTCP"},{"calculated":false,"formula":"","label":"Start date","source_field":"STRTDATE","source_table":"TBTCO"},{"calculated":false,"formula":"","label":"Start time","source_field":"STRTTIME","source_table":"TBTCO"},{"calculated":true,"formula":"End − start (active job: now − start)","label":"Runtime (min)","source_field":null,"source_table":null},{"calculated":true,"formula":"Average of finished runs in the last N days","label":"Average runtime (min)","source_field":null,"source_table":null},{"calculated":true,"formula":"(Runtime − average) ÷ average × 100","label":"Deviation %","source_field":null,"source_table":null},{"calculated":true,"formula":"Actual start − TBTCO-SDLSTRTDT/SDLSTRTTM","label":"Start delay (min)","source_field":null,"source_table":null},{"calculated":true,"formula":"Number of consecutive cancelled recent runs of a periodic job","label":"Consecutive cancellations","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Server","source_field":"REAXSERVER","source_table":"TBTCO"}],"parameters":[{"example":"FI_*","kind":"select_option","label":"Job name","name":"S_JOBNM","ref_field":"TBTCO-JOBNAME","required":false},{"example":"BATCH_FI","kind":"select_option","label":"Scheduling user","name":"S_SDLUS","ref_field":"TBTCO-SDLUNAME","required":false},{"example":"16.11.2026 – 17.11.2026","kind":"select_option","label":"Start date","name":"S_STRTD","ref_field":"TBTCO-STRTDATE","required":true},{"example":"","kind":"select_option","label":"Step program","name":"S_PROG","ref_field":"TBTCP-PROGNAME","required":false},{"example":"50","kind":"parameter","label":"Runtime deviation threshold (%)","name":"P_DEVPCT","ref_field":"","required":false},{"example":"30","kind":"parameter","label":"Reference period (days)","name":"P_REFDAY","ref_field":"","required":false},{"example":"120","kind":"parameter","label":"Long-running active job threshold (min)","name":"P_ACTMIN","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Show cancelled jobs","name":"P_CANC","ref_field":"","required":false}],"part_of":["basis-daily-system-check-pack"],"performance":"Narrow TBTCO by start date and status; calculate the reference average with a single GROUP BY query. If job history is kept for years, limit the reference period to 30 days. Run the report in the background every morning after the night jobs have finished.","quote_url":"https://nekuhub.com/en/request-a-quote/?report=basis-cancelled-long-running-jobs","related":["basis-number-range-exhaustion-alert-job"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Lists jobs by status and date; no comparison with the historical average, start delay or count of consecutive cancellations.","tcode":"SM37"},{"note":"Gives background workload as aggregated statistics; it does not produce a findings list per job.","tcode":"ST03N"}],"summary":"A custom ALV report that lists background jobs that were cancelled, are still running or finished far above their usual runtime, with the step program, variant, step user and a comparison with the average runtime of recent days. When night jobs go wrong, the BASIS team sees in one list in the morning what deviated and by how much.","tables":[{"access":"read","join_on":"","role":"Job header: status, planned and actual start, end, server (driving table)","table":"TBTCO","variant":"both"},{"access":"read","join_on":"TBTCP-JOBNAME = TBTCO-JOBNAME AND TBTCP-JOBCOUNT = TBTCO-JOBCOUNT","role":"Job steps: program, variant and step user","table":"TBTCP","variant":"both"},{"access":"read","join_on":"TRDIRT-NAME = TBTCP-PROGNAME AND TRDIRT-SPRSL = SY-LANGU","role":"Title of the step program","table":"TRDIRT","variant":"both"}],"title":"Cancelled and Long-Running Background Jobs Report","url":"https://nekuhub.com/en/reports/cancelled-and-long-running-background-jobs-report/","vendor_id":"nekudos"}