Transport a Software Component Between two Systems Using Any Git Repository (BYOG)
Connect your own Git repositories to two instances of SAP BTP ABAP Environment, using the Fiori app Manage Software Components
Overview
You will learn
- How to create and clone a remote repository
- How to create a software component and link the remote repository
- How to clone the software component
- How to create a branch
- How to delete a software component
- How to create and delete tags This will give you a better overview of your own code, branches, and commits. Throughout this tutorial, replace
###or000with your initials or group number.
Prerequisites
Prerequisites
- You have two service instances of SAP BTP ABAP Environment on the same global account
- In the source system, you have assigned the copies of the business role templates
SAP_BR_ADMINISTRATORandSAP_BR_DEVELOPERto your user - In the target system, you have assigned a copy of the business role template
SAP_BR_ADMINISTRATORto your user - You have installed the latest version of ABAP in Eclipse (ADT)
- You have created a new empty repository with the preferred git provider. The repository must be publicly accessible on the internet - repositories hosted on a private company network are currently not supported
- You have administrative authorizations to push, pull and clone from this repository; credentials must include a username and a password or token
Steps
Until now, the ABAP repositories in Steampunk were managed by the SAP Help Portal: Manage Software Components app. This was the only interface where you could see the status of your remote repository. Bring Your Own Git (BYOG) allows you to connect your own Git repositories with the Manage Software Components app.
However, you are not allowed to make code changes in your remote Git repository and then import these changes into the local SAP system, since this could violate any guidelines for cloud development.
For more information on these guidelines, see C0 Developer Extensibility for CDS Data Models
First, open your preferred Git provider and create a new repository; here, we are using Github.
IMPORTANT: Create a branch at the same time. In
Github, adding a readme file will automatically create a main branch for the repository.

In Manage Software Components, create a new software component. Enter the following and choose Create:
- Namespace: For test purposes, usually Z.
- Name: Based on remote repo name, here
BYOG_REPO_###. - Description: Bring your own git
- Repository URL:
Githubrepo from previous step - Type: Development

step2a-create-swc 
step2b-create-swc-details Choose Clone in the top right corner.

step2c-clone-crop Enter the following and choose Next.
- User name and the password or token of your git credentials
- *Appropriate radio button for your authentication method, either password or OAuth token.
Important: The credentials must be for a user who has administrative rights to the repository and is allowed to push and pull changes.
From the dropdown select the name of the branch you want to clone and choose Clone.

step2d-clone-repo
When the cloning is finished, the status changes to Success.

In the remote repository, a new commit has been generated from noreply@example.com and a new file added.

Important: This file is necessary for pushing and pulling changes into the SAP system. Therefore this file should never be deleted or modified at any time.
Open ABAP in Eclipse (ADT.) You will see that a structure package has been automatically created, with the same name as the software component.
Create an ABAP package of type development: Select your structure package, then choose New > ABAP Package from the context menu.
Enter the following, then choose Next.
- Name:
ZBYOG_TEST_GITHUB_###if you are usingGithub - Description:
Test gCTS with Github Superpackage: Should be added automatically- Package Type: Development

step3a-create-abap-dev-pkj - Name:
The software component and transport layer are automatically derived from the generated structure package. Choose Next, then Finish.

step3b-swc-and-t-layer 
step3c-tr-package
Create a new ABAP class: Choose File > New > Other… > ABAP Class.
Enter the following for your class, then choose Next.
- Name:
ZCL_HELLO_WORLD_### - Description for your class, e.g.
Test gCTS with Github - Interface:
if_oo_adt_classrun. This enables you to run the class in the console.
- Name:
Choose the same transport request.
Add the following code to your class:
ABAPCLASS zcl_hello_world_### DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES if_oo_adt_classrun . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_hello_world_### IMPLEMENTATION. METHOD if_oo_adt_classrun~main. out->write( 'Hello' ). ENDMETHOD. ENDCLASS.Format, save, and activate your class (
Sh+F1,Ctrl+S,Ctrl+F3).Run your class as a console application. The output should look roughly like this:

step4a-console-hello
Release the transport task (F9).
Release the transport request (F9).

step4a-release-tr
The transport request number and the transported objects are now visible in your remote repository.
To import your released transport into a target system (e.g., your test or production system), you must clone the same repository into this target system.
Repeat step 3.2 to 3.4. The only difference is the “Repository Role”, which now must be set to “Target”.

step5a-clone-to-target Open the target system in ADT. You can see the transported objects.

step5b-objects-in-target-system
Currently, creating a new branch for BYOG is not supported in Manage Software Components. Therefore, create the branch using the native interface of your git provider linked to your repository.

In Manage Software Components, you can see the new branch by refreshing the Branches table. You can then proceed as usual with checkout.

The Tag function is the same as in non BYOG software components.
To create a tag, go to the commit view of your selected branch. The created tag will also be visible on your remote repository. Deleting a tag will also delete the tag in the remote repository.
Deleting a software component in Manage Software Components will unlink the component to the remote repository, but will not delete the remote repository in Github. The local software component will be marked as not editable; releasing transport requests will no longer be possible.
Important: Deleting the software component is an irreversible action.
To delete the component simply choose Delete.
SAP Help Portal: How to Configure Your Git Repository
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.