---
url: /howto/sap-integration/teamscale-sap-connection.md
description: >-
  This article describes how to configure an SAP ABAP system connection in
  Teamscale.
---

# How to Configure an SAP® System Connection in Teamscale

Once the [SAP system is prepared](../sap-system/), you tell Teamscale how to reach it.
All settings described here are made in the web interface of Teamscale under *Admin* > *Settings*.

:::tip Option Reference
This guide covers what the settings mean and which ones you need.
A complete list of every option is available in the [SAP System Connections reference](../../../reference/admin-settings/sap-system-connections/).
:::

\[\[toc]]

## Configuring the Repository Clone Directory

First, you should check if a suiting directory is specified in section [*Git* > *Repository Clone Directory*](../../../reference/admin-settings/git/#repository-clone-directory).
Teamscale will save the (historized) code exports in subdirectories of this directory and access them for analysis there.
Under the hood, this is realized by a local Git repository which is managed by Teamscale automatically.
Usually, the Teamscale repository clone directory will be specified by the system administrator of the Teamscale server, you should check with them to define the proper location.
It can be specified as absolute or relative path and defaults to a folder named `repo` within the JVM process working directory.
In case of a relative path, the location is relative to the parent of the Teamscale storage directory (parameter `database.directory` of the `teamscale.properties` [configuration file](../../../reference/administration-ts-installation/).)

## Adding an SAP ABAP System Connection

Under *SAP* > *SAP ABAP System Connection*, the parameters to connect to an SAP NetWeaver system must be specified.
For every SAP system, a separate connection configuration must be added.
To add a new connection, press the `Add` button.
In the opening dialog, a unique connection ID must be specified, for example the three letter SAP system ID could be used.
After this, a new configuration section is added, in which the parameters must be specified.

The first options are the parameters for the RFC connection.
The required parameters mainly depend on the connection type, that is, whether the connection to the SAP system is direct or via logon balancing.
Further options specify the logon data (client, user, password).
They are listed under [System and Logon Parameters](../../../reference/admin-settings/sap-system-connections/#system-and-logon-parameters).

Further options control the code retrieval of Teamscale from the SAP system.
These specify which code should be retrieved, how often it should be updated and if other result data should be included, for example test coverage data.
They are listed under [Object Selection Parameters](../../../reference/admin-settings/sap-system-connections/#object-selection-parameters).

:::info No RFC Connection Possible?
If Teamscale cannot open an RFC connection into the SAP system at all, for example because network segmentation separates the two, the SAP system can instead [push ABAP exports to Teamscale](../pushing-abap-exports/) over HTTPS.
:::

### Namespace Configuration

The namespace parameters *Include objects in default custom namespaces* and *Further custom namespaces* specify which code objects should be retrieved from the SAP system.
It is recommended to specify all custom namespaces, which are available for development, e.g., enable the retrieval of the default custom namespaces `Y` and `Z` as well as all further custom namespaces e.g. `/ABC/` which are registered for your organization.
Note that these parameters only define for which code Teamscale keeps track of the change history, but not which code gets analyzed.
The actual selection of the analyzed code is specified in the [project configuration](../../../reference/ui/project/project/#creating-a-project)).

### Update Intervals

The scheduling parameters *Polling schedule for changes* and *Polling schedule for full sync* define when code (and further data, e.g. coverage results) is retrieved from the SAP system.

*Change polling* only retrieves objects that have changed since the last retrieval, thus the amount of transferred data is low and the execution time is very short (a few seconds only).
A change to an object is only observed once the object gets activated.
Here, intervals between 10 and 30 minutes are recommended.
Longer intervals may result in an unwanted long delay of analysis results after activation of code changes, shorter intervals may lead to a too fine-grained change history.

The *full sync* interval controls when retrieval of all code objects (within the specified namespaces) is performed.
Usually, no code changes are visible after synchronization.
In rare cases, however, the code base can change without Teamscale's change polling recognizing it.
Such missed changes are typically not caused by regular development, but may result from special transport or upgrade activities.
A regular full sync ensures that the code repository created by Teamscale is in sync with the actual code within the SAP system.
We recommend a daily update during night.

Both intervals are specified as [cron](https://en.wikipedia.org/wiki/Cron) expressions, for example `*/10 * * * *` specifies an update of every 10 minutes, `0 1 * * *` a nightly update at 1:00am.
When saving a new SAP connection, an initial full sync will be scheduled automatically.
Depending on the amount of code in the system, and other parameters, it will take some minutes until the code is available for analysis in Teamscale.

## Background Full Sync

By default, all updates of the ABAP code are retrieved from the SAP system by **synchronous** communication.
The full synchronization, which retrieves the entire code of the configured namespaces, can be alternatively configured to use **asynchronous** communication, i.e. run in the background on the SAP system.

Background processing is used to avoid a long run-time of the RFC session, which would block other jobs within Teamscale and/or result in communication timeouts.
A long run-time is to expect especially if SAP Code Inspector check execution is configured.

To achieve background processing of the full sync, a batch (BTC) job is scheduled and released in the SAP system.
Jobs are monitored in transaction `SM37`. It only requires that the RFC user for Teamscale is authorized for `RELE` (release) activity at authorization object `S_BTCH_JOB`.

In background processing mode, a full synchronization will initially only schedule a background job in the SAP system.
Teamscale is not waiting for the job to finish and closes the connection to the SAP system immediately after scheduling the job.
The collection of the source code and meta-data and especially the execution of SAP Code Inspector is then executed in the background on the SAP system.
When the background job finishes, the results will be stored in a database table.
For retrieving the results, Teamscale is polling the SAP system regularly to check whether the scheduled job is finished and results are available.
If so, the result data is retrieved from the SAP system and Teamscale's internal ABAP repository is updated.

Change polling, which only queries changed objects, is always scheduled in synchronous communication mode.
Also, initial code retrieval is done synchronously but will not execute SAP Code Inspector to make the entire code base visible in Teamscale without a too long delay.

### Configuring Background Full Sync

The main configuration in Teamscale is made by the option *Use background job for full sync* of the *SAP ABAP System Connection* settings.
This will schedule batch jobs in the SAP system to perform the full sync.
The [global settings](../../../reference/admin-settings/sap-system-connections/#global-settings) control how often Teamscale polls for finished results and for how long.

## Secure Network Communication (optional)

If the RFC communication between Teamscale and SAP NetWeaver should be secured (encrypted), Teamscale can connect to the SAP system via *Secure Network Communications (SNC)*.
In order to use it, a respective configuration of the SAP system and the Teamscale server is required.

Configure the [SAP system](../sap-system/#snc-configuration-of-the-sap-system-optional) and the [Teamscale server](../teamscale-server/#snc-configuration-on-the-teamscale-server) first.
Then enable SNC under *SAP ABAP System Connection* and specify the [SNC options](../../../reference/admin-settings/sap-system-connections/#secure-network-communications-snc).

## Integrating SAP Code Inspector / ATC

Messages resulting from checks of *SAP Code Inspector (SCI)* can be imported into Teamscale as findings.
Thus, all findings management features of Teamscale (e.g., working with baselines, tolerated findings, the definition of tasks, ...) are also available for SCI messages.
Once configured, no further manual actions are required by developers to get results of the SCI tests.

The integration of SAP Code Inspector findings in Teamscale requires that an appropriate Code Inspector variant is defined in the SAP system and that the SAP system connection settings and the project configuration in Teamscale are set up accordingly.

Teamscale supports findings from SAP Code Inspector and from its addons `Code Pal for ABAP` and `Code Vulnerability Analyzer` (`CVA`).
To get findings from these addons, they must be installed in the SAP system (CVA might require an additional license) and enabled in the Code Inspector variant.
[Installation Instructions for Code Pal](https://github.com/SAP/code-pal-for-abap/blob/master/pages/how-to-install.md) and [SAP documentation for CVA](https://pages.community.sap.com/topics/abap-testing-analysis/code-vulnerability-analyzer)

Define the variant in the SAP system first, as described in [Selecting or Defining a Code Inspector Check Variant](../sap-system/#selecting-or-defining-a-code-inspector-check-variant).
Then set the [Code Inspector options](../../../reference/admin-settings/sap-system-connections/#code-inspector-execution) on the connection, and enable the analysis in the [project configuration](../teamscale-abap-project/#code-inspector-settings-in-project-configuration).

### Restricting What Code Inspector Checks

The parameters *Code Inspector include specification* and *Code Inspector exclude specification* are used to restrict the code that is checked by SAP Code Inspector.
These includes/excludes are stated as a list of Glob patterns matching against the file paths of the ABAP source code objects as visible in Teamscale, this is similar to the patterns used for project configuration.

Note that the single star wild card (`*`, which matches a sequence of chars but not `/`) cannot be used in these patterns.

With this configuration, Code Inspector is executed in the SAP system during every code retrieval.
During change polling, only changed ABAP repository objects are checked by SAP Code Inspector, but during the full synchronization, Code Inspector is executed for all ABAP repository objects in the specified namespaces.
As the full synchronization may take a long time (up to a few hours for code bases of many million lines of code), we recommend to schedule the full synchronization at most once every night.

:::warning Potential memory bottlenecks with Extended Program Check (SLIN) inspections
Please note that the SAP Code Inspector inspections in *Extended Program Check (SLIN)* use internal caching to store and reuse test results.
If these inspections are activated in a Code Inspector variant, memory bottlenecks may be caused in case of very large ABAP programs that lead to failing (full) exports.
A prominent example of a very long program (with more than 120k LOC) is the standalone version of the [AbapGit report](https://raw.githubusercontent.com/abapGit/build/main/zabapgit_standalone.prog.abap).
If included in the codebase, we recommend to exclude this report from SAP Code Inspector executions by using the following pattern in the *Code Inspector exclude specification*: `**/PROG/*zabapgit*.abap`.
:::

## Check Descriptions for SAP ATC Checks

Beginning with Teamscale 2026.5 and Teamscale Connector for SAP NetWeaver® AS ABAP v2606, it is now possible to see descriptions for ATC checks.
Teamscale fetches their descriptions from SAP systems for display in the findings detail view and also in the Check Explorer.
To use this feature, some procedures need to be performed on an SAP system and also in Teamscale.

The configuration steps on the SAP system are described in [Installation of the SAP Connector](../sap-system/#installation-of-the-sap-connector), and the certificate handling in [Trusting the SAP System's Certificate](../teamscale-server/#trusting-the-sap-system-s-certificate).

In Teamscale, the feature is configured per SAP system connection under *Admin* > *Settings* > *SAP System Connections* with the options [*Check descriptions: Retrieve via HTTP(S)* and *Check descriptions: ICF base URL*](../../../reference/admin-settings/sap-system-connections/#check-descriptions).

When you save the connection, Teamscale contacts the endpoint to check that it can be reached.
If it cannot, Teamscale reports the underlying error.
You can still save the connection, in which case everything except check descriptions keeps working.

An SAP router does not carry these HTTPS requests.
If you connect through an SAP router, set *Check descriptions: ICF base URL* to an address that Teamscale can reach directly over HTTPS.

## Test Gap Analysis Set Up For SAP

To perform test gap analysis, it is required that the SAP Coverage Analyzer (SCOV) is collecting coverage data from (test) executions.
Depending on the actual system, either SCOV Lite (if available) or the regular SCOV has to be used as coverage analyzer.
Teamscale will use SCOV Lite automatically, if the Teamscale user has the `S_COV_ADM` authorization object.
SCOV Lite is the preferred method, as it has a smaller performance impact.
If you want to use the regular SCOV, it is necessary to activate SCOV manually for every system.

Activating the coverage analyzer is described in [Activating Coverage Collection (SCOV)](../sap-system/#activating-coverage-collection-scov).
If coverage does not arrive as expected, see [Troubleshooting SAP System Connections](../../../troubleshooting/troubleshooting-sap/#no-coverage-information-arrives-in-teamscale).
