Skip to Content

Transport a Software Component Between two Systems Using Any Git Repository (BYOG)

Requires Customer/Partner License
Connect your own Git repositories to two instances of SAP BTP ABAP Environment, using the Fiori app Manage Software Components
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
julieplummer20Julie PlummerFebruary 14, 2025
Created by
julieplummer20
February 18, 2024
Contributors
julieplummer20

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_ADMINISTRATOR and SAP_BR_DEVELOPER to your user
  • In the target system, you have assigned a copy of the business role template SAP_BR_ADMINISTRATOR to 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

This will give you a better overview of your own code, branches, and commits.

Throughout this tutorial, replace ### or 000 with your initials or group number.

  • Step 1

    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

  • Step 2

    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.

    step1a-create-new-remote-repo
  • Step 3
    1. 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: Github repo from previous step
    • Type: Development
    step2a-create-swc
    step2b-create-swc-details
    1. Choose Clone in the top right corner.

      step2c-clone-crop
    2. 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.

    3. 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.

    step2e-clone-success

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

    step2f-json-created

    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.

  • Step 4
    1. Open ABAP in Eclipse (ADT.) You will see that a structure package has been automatically created, with the same name as the software component.

    2. Create an ABAP package of type development: Select your structure package, then choose New > ABAP Package from the context menu.

    3. Enter the following, then choose Next.

      • Name: ZBYOG_TEST_GITHUB_### if you are using Github
      • Description: Test gCTS with Github
      • Superpackage: Should be added automatically
      • Package Type: Development
      step3a-create-abap-dev-pkj
    4. 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
  • Step 5
    1. Create a new ABAP class: Choose File > New > Other… > ABAP Class.

    2. 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.
    3. Choose the same transport request.

    4. Add the following code to your class:

      ABAP
      Copy
      CLASS 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.
      
      
    5. Format, save, and activate your class (**Sh+F1, Ctrl+S, Ctrl+F3**).

    6. Run your class as a console application. The output should look roughly like this:

      step4a-console-hello
  • Step 6
    1. Release the transport task (**F9**).

    2. Release the transport request (**F9**).

      step4a-release-tr

    The transport request number and the transported objects are now visible in your remote repository.

  • Step 7

    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.

    1. 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
    2. Open the target system in ADT. You can see the transported objects.

      step5b-objects-in-target-system
  • Step 8

    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.

    step3a-create-branch

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

    step3b-branch-success
  • Step 9

    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.

  • Step 10

    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.

  • Step 11

    Which action creates a commit on your Git repository?

  • Step 12
Back to top