# How to Fix Errors with SAP Connections

If one of your Teamscale projects does not show current ABAP code changes from your SAP system anymore, this article may help you to remedy the issue. As a general recommendation, please make sure you are running the latest versions of both Teamscale and the Teamscale Connector for SAP NetWeaver® AS ABAP®.

# Problem Description

Teamscale does not show recent ABAP code changes for one of the SAP systems connected via the Teamscale Connector for SAP NetWeaver® AS ABAP®. The most recent commit shown in the Activity perspective does not reflect current changes in the system.

# Inspecting the Worker Log

The first thing to inspect is the worker log. In the System perspective, select the Worker Log entries for Maintenance Jobs and enter abapsystem into the Regex field:

Worker Log Filter

Then click on the most recent error entry, and inspect the detailed log message.

# Error: Export Configuration Locked

# Symptom

The worker log entry contains a message like

Error occurred during ABAP export in SAP system
Unable to lock export for configuration id CQI_MUYWGCIN.
An other export for this configuration may be running.
Or an earlier export could not finish properly. Export aborted.

Check Shadow Mode Settings

Make sure you have only one Teamscale instance running in non-shadow mode and accessing the same Teamscale working directory.

# Solution (Teamscale Administrators)

  1. Log into Teamscale as an administrator
  2. Enter the following into your browser: http(s)://YOUR_TEAMSCALE_URL/api.html#/?includeInternal=true
  3. Find the entry for SAP/clearHistoryIdLock
  4. Click Try it out, enter the SAP Configuration ID, and click Execute.
  5. If the service responds with a return code of 204, the export configuration has been successfully unlocked.

# Solution (SAP System Administrators)

  1. Log on to the SAP system using SAPGui.
  2. Locate the database table /CQSE/ABAPEXP (e.g. in SE11)
  3. In the entry with the EXPORT_CONFIG_ID from the error message, change LOCKED from X to .

# Error: Crash in the SAP system

Under certain conditions, the export in the SAP system can fail.

# Symptom

The worker log entry contains a line like

RfcException raised by system [CQR|abap-rel|00]:

This means that an error occurred in the SAP system. In this case, we need more information from the SAP system.

# Gathering Further Information

  1. Note the time the error was logged in the worker log.
  2. Log on to the SAP system using SAPGui.
  3. Open transaction ST22 and search for short dumps caused by the Teamscale user at the time noted in step 1.
  4. Export the short dump into a text file
  5. Send the file to support@teamscale.com or request a link to perform an HTTPS-secured upload
  6. Our experts will investigate the reason for the crash and provide you with mitigation instructions

# Possible Reasons

There are a number of different things that can cause a code export to crash. Of course, our SAP connector heavily relies on SAP standard functionality. Sometimes these standard routines do not handle edge cases very well, which might lead to crashes. Our exporter does have extensive error handling functionality, but some conditions cannot be handled programmatically, but immediately lead to a dump, e.g. violation of ASSERT conditions, or unbound field symbols, to name just two.

These conditions can occur e.g. when Code Inspector is executed for an object with rarely used syntax, when DDIC information or function groups have become inconsistent because of some previous error condition unrelated to Teamscale.

# Workarounds

Depending on the cause for the crash, there are different mitigation strategies to disable certain functionalities of the SAP Connector, so that the condition causing the crash does not occur anymore. You may search the call stack for the last code block belonging to the /CQSE/ namespace in order to locate the export step the error is related to, e.g. Code Inspector checks or DDIC export.

# Code Inspector

In case of Code Inspector crashes, you may search the short dump for the value of the variable OBJECT_NAME to identify which object Code Inspector was checking when it crashed. Then, have a look at the ABAP code in your favorite ABAP editor, and try to check it manually using Code Inspector. If the check fails, you have the following options:

  • Adjust your ABAP code so that Code Inspector can successfully run the check
  • Search the SAP Support Portal for a note fixing the check (e.g. Note 2215785)
  • In the SAP system, disable the particular check in the check variant that is used by Teamscale
  • Add the particular object to the Code Inspector exclude specification in Teamscale's SAP connection settings for the respective system to exclude it from Code Inspector checks. Be sure to use the object name as shown in Teamscale:

Code Inspector Excludes

# DDIC Export

In case the crash is related to the DDIC export, you may search the short dump for strings such as OBJECT_NAME, OBJ_NAME, PROG_NAME, or PROGRAM_NAME to determine which DDIC object caused the crash. Then, open the respective DDIC object with SAPGui and run consistency checks (e.g. to identify broken foreign-key relationships in database tables). Workarounds are:

  • Fix the inconsistencies in the respective DDIC object
  • Disable the option Include objects in ABAP Dictionary (DDIC) in Teamscale's SAP connection settings for the respective system

# Error: Timeout

Similar to crashes related to programming errors or data inconsistency, in some cases the RFC connection to the SAP system may be terminated due to a timeout in the SAP system.

# Symptom

The worker log entry contains a line like

RfcException raised by system [CQR|abap-rel|00]:
message: Zeitlimit überschritten

# Solution

Please make sure that

If the problem persists, please:

  1. Perform an ABAP trace and/or an SQL trace on your system during export
  2. Send the results to support@teamscale.com or request a link to perform an HTTPS-secured upload
  3. Our experts will investigate the reason for the crash and provide you with further instructions