6 minute read

How to Set Up and Manage Automatic SAP Jobs

What is an SAP job for and how is it structured?

Background jobs are used in many areas where processes are executed automatically by the system at certain times without manual intervention. In the area of Unix systems, the concept of cron jobs is well known, and on Windows computers,background processes can be set up with the task scheduler. SAP also has appropriate background processing for processes – so-called SAP jobs.

SAP jobs can be executed once or recurrently – for example, every day at midnight. This allows, for example, resource-intensive processing to take place at night when few or no users are logged on to the system. Another application example is the recurring collection of new EDI messages from an external B2B Integration Hub, as in the case of ecosio.

In the following article we will introduce the most important features and show how to set them up. We then go into how to modify existing SAP jobs and how to read processing logs from SAP jobs.

Properties of SAP jobs

SAP jobs are set up using transaction SM36. The following graphic shows an example SAP job.

Überblick über SAP Job
Overview of SAP Job

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

There are unique job names that can be freely assigned. For reasons of clarity, it is recommended that you adhere to a uniform system-wide naming convention.

SAP job classes

An SAP job must be assigned to a specific job class when it is created. Job classes define the priority with which a background job is executed. A distinction is made between the following three classes.

Class A – High priority

Urgent or critical background jobs can be planned with class A. These jobs are given priority before class B or C jobs are executed.

Class B – Medium priority

As soon as class A jobs are processed, class B jobs are started.

Class C – Low priority

Class C jobs have the lowest priority and are only started when class A and B jobs have been processed.

White Paper - EDI Integration in SAP

Status

Besides the assigned priority class, there is a certain status. The possible statuses are as follows:

  1. Planned
    The job is only scheduled, but has no start condition, end date, execution frequency, and so on, and will never run.
  2. Released
    The job has assigned process steps and all the parameters for execution are available. The job is waiting to be executed for the first time as soon as the start condition is fulfilled – e.g. a certain time.
  3. Ready
    The job is ready for execution and has been placed in the execution queue by the job scheduler. As soon as a background process is free, the job is executed.
  4. Active
    The job runs in the background. The status of the job can no longer be changed during execution.
  5. Ready
    The job has been successfully completed.
  6. Cancelled
    The job has been canceled. The termination may have been caused manually by an administrator, or a problem may have occurred during the execution of the job. The exact details can be read in the job logs and in the spool (see description below).

Steps

Every SAP job consists of one or more processing steps – so-called steps. The following figure shows an example step.

SAP Job - Prozessschritt
SAP Job – Process Step

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

A step in an SAP job can have three different characteristics:

  1. ABAP program
    In this case, an ABAP program is started and a variant and the language can be passed. In the screenshot above, for example, the ABAP program /EPO1/EXC_ECOSIO_FETCH is executed with the variant FETCH, which periodically fetches messages from the ecosio Integration Hub.
  2. External command
    With this function, a command predefined by the system administrator can be called up and parameters can also be transferred for the call.
  3. External program
    In this case an external program is started, whereby parameters can also be transferred here.

Setup

In the first step, the job name and job class are defined in transaction SM36, as mentioned above. Then the individual steps of the job are defined, which are executed in sequence – from top to bottom.

The next step is to select the start condition of the job.

SAP Job Startbedingung
SAP Job Start Condition

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

Usually you choose a certain time as start condition, from when the job should be executed, and a repeat interval – e.g. every 10 minutes. If no time is specified, the job remains in the “scheduled” state and is not executed.

After specifying a time and a repetition frequency, the job is saved. Afterwards the job changes to “released” and waits for its first execution. Alternatively, a job can be executed immediately by clicking on “Immediately”.

Change

To change an SAP job, go to transaction SM37. There you can get an overview of all jobs in the different statuses. To change a job that has already been released, select it in the overview and then choose “Job > Released – Scheduled” from the menu bar.

SAP Job Übersicht
SAP Job Overview

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

The job can now be processed again and then released again.

View logs

As with a regularly executed process, an SAP job can also terminate unexpectedly. In this case, we recommend that you look at the logs. You can access this again using transaction SM37. In the first step, select one of the jobs already executed and then choose “Spool” or “Job log”.

Logdaten eines SAP Jobs
Log Data of an SAP Job

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

These two functions provide an overview of the logs themselves and the individual process steps. A prerequisite is, of course, that the process steps also write processing logs.

With the introduction of SAP S/4HANA, the IDoc format will undergo some changes. You can find out what these changes are in detail in this article.

Do you have any questions?

Do you still have questions about SAP jobs or the connection of external systems to your SAP ERP or SAP S/4HANA system? Do not hesitate and contact us. We are always available to answer your questions.

 

SAP ERP and SAP S/4HANA are the trademarks or registered trademarks of SAP SE or its affiliates in Germany and in several other countries.

Subjects

most read

Keep on reading

2 minute read

How to End Another User's SAP Session

Unable to edit a crucial document in SAP® because you're locked out? Learning how to end another user's SAP session will solve this issue.

3 minute read

Finding Translations for SAP® Terminology

Using the correct translations for SAP® terminology is important in international projects. Discover how to find these quickly.

2 minute read

How to Save an IDoc Parser Report to a Local File

In this short and simple guide we show you how to save an IDoc parser report to a local file in just a couple of easy steps.

6 minute read

How to Debug SAP Message ME161 - "The Notified Quantity Exceeds the Ordered Quantity"

Don't know how to fix SAP error message ME161 "The notified quantity exceeds the ordered quantity"? In this article we break it down.

3 minute read

ecosio to Host SAP/EDI Workshop at UKISUG Connect 2021

ecosio is exhibiting and running an SAP/EDI workshop at this year's UKISUG Connect conference. Find out what attendees can enjoy at the event.

6 minute read

SAP® EDI Project Roles - A Breakdown

Learn the various EDI project roles involved in achieving successful EDI integration in SAP systems and how the different roles interact.

10 minute read

Alternative Solutions for EDI Data Exchange with SAP PI

Many companies use SAP PI to enable data exchange between a given SAP ERP system and its connecting systems. Discover the options available.

6 minute read

How do I Implement EDI with SAP Integration Suite®?

EDI with SAP Integration Suite®: take over internally yourself or hire a fully managed EDI service provider? In this article we explore the positives and negatives of these approaches.

3 minute read

How to create an SAP transaction code

Want to know how to create an SAP transaction code for an existing ABAP program so that you can easily call the program?

9 minute read

Alternative Solutions for EDI Data Exchange with SAP PI and SAP PO

Discover the three possibilities when it comes to implementation of electronic data interchange (EDI) in SAP Process Integration or SAP Process Orchestration (SAP PI/PO).

4 minute read

IDoc Status Change in SAP ERP

IDoc statuses are not always the clearest - particularly when errors occur. In this article we explain how to change IDoc status as required.

5 minute read

How Can I Add an Entry to an SAP Table?

In this article we show how to add entries to an existing SAP table - even if it does not have its own maintenance dialog.

We use cookies to provide an optimal website experience. You decide which one you want to allow. Depending on the setting, however, not all functionalities may be available to you. Data protection & imprint.