How to Push ABAP® Exports to Teamscale
Normally Teamscale opens an RFC connection into the SAP system to fetch code and other data. That direction is not always possible: a Teamscale instance in the cloud cannot reach an on-premises SAP system without a site-to-site VPN, and creating the RFC-enabled technical user that such a connection needs might not be permitted under corporate policies, particularly for production systems.
As an alternative, the export can be planned as a batch job in the SAP system and write the result to a shared location as a ZIP file. From there, customer-specific automation can upload the file to a Teamscale endpoint over HTTPS, so no connection from Teamscale to the SAP system is required. For assistance in setting up the batch job, please contact Teamscale Support.
Configuring the Connection
Set up the connection as described in SAP Connection Configuration in Teamscale, with these differences.
Disable Fetch data from SAP system in the SAP ABAP System Connection settings. Teamscale then only imports provided ZIP files instead of retrieving data itself. Keep Polling schedule for changes configured: it is the schedule that integrates the pushed files. An upload additionally starts a synchronization right away, so a pushed export does not wait for the next scheduled run.
Two features are unavailable for such a connection, because both require Teamscale to query the SAP system:
- SAP Code Inspector and ATC check descriptions cannot be fetched from the SAP system. ATC check results are still imported, but only contain the message, not the full description.
- Automatically activating and restarting SCOV for Test Gap analysis is not possible. SCOV has to be started manually.
Granting Upload Permission
Create a technical user in Teamscale for the SAP system to authenticate with, and give it the Edit permission on exactly the connection(s) it may upload for. Open Admin > Settings > SAP System Connections, and use the role assignment button next to the connection.
Uploading an Export
Post the export ZIP file as the raw request body:
curl --user <user>:<access-key> \
--header 'Content-Type: application/octet-stream' \
--data-binary @abap_export.zip \
'https://teamscale.example.com/api/sap-connections/<configuration-id>/abap-export'<configuration-id> is the name of the connection as shown in the Admin perspective. On success, the response body is the name the export was stored as, which is useful for correlating an upload with the archived file later. Teamscale answers with status 400 if the uploaded content is not a readable ABAP export ZIP file or if one of its entries is larger than 100 MiB.
