In the release 2302 of SAP BTP ABAP environment (available since February 2023) the integration with SAP Cloud Transport Management (cTMS) became available. This increases the coverage of unified transport processes within BTP to a new and important area.
In this blog post we will describe step by step how to set up this integration and how to use it. The landscape we are using consists of three ABAP instances (DEV, QA, PROD) which are mapped to three transport nodes in SAP Cloud Transport Management (see graphical overview below).
The communication between the two services is established via Communication Arrangements on the ABAP side and via a service instance and destinations on the cTMS side.
Prerequisites
- You have at least two instances of SAP BTP, ABAP environment. In our example we are using three.
- You have subscribed to SAP Cloud Transport Management. For more details see the corresponding documentation.
- You have the needed roles for the ABAP environment (SAP_BR_ADMINISTRATOR and SAP_BR_DEVELOPER)
- You have the needed roles for cTMS (Administrator or LandscapeOperator and TransportOperator). For more details see the corresponding documentation.
- You have the needed role to create a service instance and a service key in the BTP subaccount with the subscription to cTMS (role collection “Subaccount Administrator”). Alternatively you can reuse an already existing cTMS service key.
Setup
Service Instance for cTMS
In order to connect from the ABAP environment to Cloud Transport Management you need a service instance of cTMS. The access details for the instance are stored in a service key which also has to be created. Please follow the instructions in the SAP Documentation.
If you already have a cTMS service instance of plan type ‘standard‘ with a service key you do not need to create a new one, but can reuse the existing one.
The cTMS service key can be retrieved from the ‘Instances and Subscriptions’ view in the SAP BTP Cockpit. Search for an instance of type ‘Cloud Transport Management’ and click on the link in the ‘Credentials‘ column.
The service key should look like this:
From the service key we will need four entries (marked on the screenshot):
- clientid
- clientsecret
- url
- uri
Outbound Communication Arrangement SAP_COM_0599 in ABAP DEV
We now will create an outbound communication arrangement which uses the cTMS service key we have just created. For this, in your development instance of the ABAP environment, click on the Communication Arrangements tile.
On the communication arrangements overview screen select ‘New‘.
Select the scenario SAP_COM_0599, choose an Arrangement Name and click on ‘Create‘.
We will create the needed communication system on the fly: In the ‘Common Data‘ area click on the ‘New‘ button next to the ‘Communication System‘ field.
Choose a System ID for the communication system (only upper case letters and underscores are possible). The System Name can be identical. Click on ‘Create‘.
Open the Service Key of the Cloud Transport Management instance (created in the previous chapter) and copy the entry ‘uri‘ (without the leading https://) to the field ‘Host Name‘ in the area ‘General‘
Also copy the entry ‘url‘ (again without https://) to the field ‘Token Endpoint‘ in the area ‘OAuth 2.0 Settings‘.
Append ‘/oauth/token?grant_type=client_credentials‘ to the end of the URL.
Scroll down to the area ‘Users for Outbound Communication’ and click on the ‘+‘ (plus) icon.
Choose Authentication Method ‘OAuth 2.0’.
Copy the service key entry ‘clientid‘ to the field ‘OAuth 2.0 Client ID‘.
Copy the entry ‘clientsecret‘ to the field ‘Client Secret‘.
Click on ‘Create‘.
Click on ‘Save‘ to create the communication system.
The data from the Communication System is automatically taken over to the Communication Arrangement.
You have to provide a ‘CTMS Node Name‘ in the area ‘Additional Properties‘. This name has to be reused when creating transport nodes in cTMS. It will be the name of the entry (development) node in your transport landscape. Please note that the name will be converted to upper case letters when entering it.
Click on ‘Save‘ to create the Communication Arrangement.
The Communication Arrangement can now be used.
Please also check out the documentation.
Inbound Communication Arrangements SAP_COM_0510 in ABAP QA and PROD
The next step is to create inbound Communication Arrangements for all ABAP instances into which you would like to import (deploy) cTMS transport requests. In our example this would be the QA and the PROD instance.
Open your ABAP QA instance and click on the ‘Communication Arrangements‘ tile.
Click on the ‘New‘ button.
Select the Scenario ‘SAP_COM_0510′, choose an Arrangement Name and click on ‘Create‘.
We will again create the needed communication system on the fly: In ‘Common Data‘ area click on the ‘New‘ button next to the ‘Communication System‘ field.
Choose a System ID for the communication system (only upper case letters and underscores are possible). The System Name can be identical. Click on ‘Create‘.
Select the checkbox ‘Inbound Only‘.
We will now create a technical communication user for the inbound communication. To do this, scroll down to the area ‘Users for Inbound Communication‘ and click on the ‘+‘ (plus) icon.
Click on ‘New User‘.
Enter a User Name, Description and Password. Store this information in a safe place, because it will be needed later to set up the destinations for cTMS.
The password has to have at least 20 characters so you might want to use the Propose Password functionality.
Click on ‘Create‘.
Confirm the user by clicking on ‘OK‘.
Click on ‘Save‘ to create the communication system.
The data from the Communication System is automatically taken over to the Communication Arrangement.
The Service URL in the line ‘Git Repository – Manage‘ will be used to set up the destination for cTMS.
Click on ‘Save‘ to create the communication arrangement.
You can ignore a warning referring to the ATC Check Run.
Go to your other ABAP instances which should become targets of imports and repeat these steps (potentially with other names for the created artifacts…). In our example we have to do it for the productive instance.
Please check out the documentation as well (Prerequisites section).
Destinations for cTMS import into QA and PROD
We will now use the information from the inbound communication arrangements to create destinations pointing to the ABAP instances.
Go to the SAP BTP subaccount in which you subscribed to cTMS, open the Destinations tab and click on ‘New Destination‘.
Provide a meaningful name for the destination and switch the authentication to ‘Basic Authentication‘.
In a second browser tab open the inbound communication arrangement of scenario SAP_COM_510 for your ABAP QA instance.
From here copy the Service URL from the row Git Repository – Manage to the URL field in the destination.
Copy the User Name to the field User in the destination.
Provide the Password you have assigned to the communication user when creating the communication arrangement.
Click on ‘Save‘.
Click on ‘Check Connection‘.
It should return ‘200: OK’
Now repeat these steps and create destinations for all SAP BTP ABAP instances which will become targets for cTMS imports. In our example this is one more destination for the productive instance.
Please also have a look at the documentation.
Transport nodes and routes
The final configuration step is the creation of your transport landscape consisting of transport nodes and routes.
For this enter the SAP BTP subaccount in which you subscribed to Cloud Transport Management, open the ‘Instances and Subscription‘ tab and click on ‘Cloud Transport Management‘ in the ‘Subscriptions‘ area.
This opens the Cloud Transport Management user interface. Click on ‘Transport Nodes‘ in the navigation pane.
Click on the ‘+‘ (plus) icon to create a new transport node.
Let’s start with the development node.
Provide a Name for the development node. It has to be identical (case sensitive) with the Additional Property ‘CTMS Node Name’ you provided when creating the outbound communication arrangement of scenario SAP_COM_0599 in your ABAP development instance.
Set the checkbox ‘Allow Upload to Node‘.
If you plan to use the transport node only to feed transport requests into your landscape (as a pure source node) you can leave the rest of the input fields on their default values, especially you don’t need a Content Type or a Destination.
Click on ‘OK‘ to create the node.
You might want to double-check your additional property setting in the outbound communication arrangement in your ABAP development instance.
Now let’s create the target transport nodes, starting with the QA instance.
Click on the ‘+‘ (plus) icon again.
Provide a meaningful Name for the transport node.
Set the Content Type to ‘BTP ABAP‘.
Select the Destination pointing to your BTP ABAP QA instance.
Click on ‘OK‘ to create the node.
Now repeat these steps for all other target nodes, in our example for the productive node.
We have now created three transport nodes.
We will now create two transport routes connecting the three nodes.
Click on ‘Transport Routes‘ in the navigation pane and click on the ‘+’ (Plus) icon to create a new transport route.
Let’s start with the transport route from Development to QA.
Provide a unique Name for the route. Select the development transport node as source node and the QA node as target node.
Click on ‘OK‘ to create the route.
Now let’s create the transport route from QA to Production.
Click on the ‘+’ (Plus) icon to create a new transport route.
Provide a unique Name for the route. Select the QA transport node as source node and the production node as target node.
Click on ‘OK‘ to create the route.
We have now created two transport routes:
You can now check the visualization of your transport landscape. Click on ‘Landscape Visualization‘ in the navigation pane. You might have to scroll down to find your ABAP transport landscape.
This concludes the setup of the integration of SAP BTP, ABAP environment and SAP Cloud Transport Management.
The creation of transport nodes and routes is documented here (nodes) and here (routes).
Usage
Prerequisites
- You have created a software component (see the documentation).
- You have cloned the software component to all your ABAP instances (see the documentation). Depending on your development concept you can clone the repository as source in your development instance and as target in the other instance (QA, production). This disables the ‘push’ functionality for QA and production.
- You have connected your ABAP Development Tools (ADT) to your development instance.
- You have created a package and assigned it to the software component. Additionally you have assigned the transport layer to the package which was created when cloning the repository. This ensures that gCTS (which is used behind the scenes in SAP BTP ABAP) picks up the transport requests when they are released.
Create or change objects
In your ADT create a new object (or change an existing one) in a package which is assigned to the software component (and the corresponding transport layer).
In the process you are asked for a transport request. Choose an existing one or create a new one. In case of a new transport request provide a meaningful description and click on ‘Finish‘.
This creates a new transport request with a transport task containing the new (or changed) object.
You can now perform the needed development and eventually activate the changed objects.
Release ABAP transport request
After you are done with your changes and have activated your objects, you might want to transport them. Like in ‘classical’ ABAP CTS (Change and Transport System) you have to release ‘your’ transport task (and your colleagues ‘their’ transport task in the same transport request).
Right click on the transport task to open the context menu and click on ‘Release‘.
After all tasks have been released it is time to release the transport request itself.
Right click on the transport request to open the context menu and click on ‘Release‘.
The objects in the transport requests are now pushed to the central source code Git repository and a commit ID is created for the current state. This commit ID refers to the state of the complete software component, not only to the objects in this specific transport request.
It would now be possible to manually pull this commit into the target systems, but we would like to use Cloud Transport Management to have a more governed approach to deploying the content.
Export commit to cTMS transport request
Go to your ABAP development instance and open the ‘Manage Software Component‘ app by clicking in the corresponding tile. It can be found in the Software Component Lifecycle Management area.
Click on the software component to which you have assigned your package and your objects.
Click on the branch from which you would like to transport a commit.
Select the commit you would like to transport and click on ‘Export to cTMS‘. Please note that this commit comprises all previous changes to the software component (all earlier commits).
On the popup select the transport node in cTMS from which the cTMS transport request should be created and exported. If you only have one outbound communication arrangement of type SAP_COM_0599 you will only have one node available.
Click on ‘Export‘. After a few seconds you will (hopefully…) receive a success message about the newly created transport request.
Open your Cloud Transport Management instance and go to the Landscape Visualization pane. Select your QA node and open the transport queue of it.
You should see your newly created transport request which references the software component and the commit ID in its description.
Import cTMS transport request in target system
We will now import the newly created transport request into the ABAP QA instance. In order to see the effect of the import let’s first have a look into the current state in the QA instance.
Go to your QA instance and click on the ‘Manage Software Components‘ tile.
Choose the software component in which you have done the changes.
Scroll down to the ‘Branches‘ area. You will see that a delta is displayed which is not yet synched. This means that the local repository of the QA instance is on a different commit level than the central source code repository.
Click on the branch in which you have done the changes. In our example there is only the ‘main’ branch available.
You now see a detailed list of all commits and their status. In our example we see three commits which have not yet been pulled to the QA instance. We will import a transport request which refers to the commit with the ID starting with ‘2ce35fcd’, which is the newest one.
Now switch to Cloud Transport Management to the import queue of the ABAP QA instance. Mark the transport request we have just created. Click on ‘Import Selected’.
Confirm the popup by clicking on ‘OK‘, of course after carefully checking the information.
After some time (depending on the complexity of the changes) the import finishes (hopefully successfully like in the example). You can now access the detailed log file by clicking on the icon with the paper with the magnifying glass.
Let’s return to the ABAP QA instance and check the status of the commits. You might have to refresh the page.
You will see that the commit of the transport request (the top one) has been successfully pulled into the QA instance. But also the previous commits which where not yet present in the QA instance (the two below) have been pulled automatically.
As there are commits left to be pulled in this branch of this software component, the overall status has changed to ‘Synchronized (no delta)’.
The objects contained in the three commits are now present in the QA instance and can be tested. If the tests are successful the transport request can be imported into the productive instance.
For this go to cTMS again and open the import queue of your productive node:
When the import into the QA instance was started, the transport request was automatically forwarded to the productive node and put into the import queue.
Select the transport request and click on ‘Import Selected‘.
Confirm the popup by clicking on ‘OK‘, again of course after carefully checking the information.
After some time (depending on the complexity of the changes) the import finishes (hopefully successfully like in the example). You can now access the detailed log file by clicking on the icon with the paper with the magnifying glass.