In Tutorial 1, you installed abapGit in your SAP system. Now, we'll configure abapGit for your specific ABAP project to enable version control with GitHub. This tutorial builds directly on the abapGit installation you completed in Steps 1-31 of the previous tutorial.
Before beginning this tutorial, ensure you have:
- Completed all steps in Tutorial 1: Installing abapGit in SAP System
- Verified abapGit is working correctly (Step 31 of Tutorial 1)
- Authorization to create and modify ABAP packages
- An existing ABAP development project or the authority to create one
- Your GitHub account credentials ready
flowchart LR
subgraph SAP
package[ABAP Package]
objects[SAP Objects]
abapgit[abapGit Client]
package --> objects
objects <--> abapgit
end
subgraph GitHub
repo[GitHub Repository]
gitfiles[Serialized Files]
repo --> gitfiles
end
abapgit <-->|HTTPS| repo
style package fill:#f9f,stroke:#333,stroke-width:2px
style repo fill:#bbf,stroke:#333,stroke-width:2px
Continuing from Tutorial 1 where you verified the abapGit installation in Steps 29-31, you'll now create a dedicated package for your SAP development objects:
-
Execute transaction SE80
-
Select Package from the dropdown menu
-
Enter a suitable package name (e.g.,
Z_GITHUB_DEMO) and click Create -
In the package properties dialog:
- Enter a meaningful description: "Demo Package for GitHub Integration"
- Set package type to "Development"
- Assign to an appropriate transport request
- Click Save
Now that you have your ABAP package (created in Steps 32-35), you need to create a corresponding GitHub repository:
- Log in to your GitHub account
- Click the "+" icon in the top-right corner and select "New repository"
- Enter a repository name that corresponds to your ABAP package (e.g.,
sap-github-demo) - Add a description that references your SAP project
- Choose "Public" or "Private" visibility based on your requirements
- Initialize the repository with a README file
- Click Create repository
With both your ABAP package (Steps 32-35) and GitHub repository (Steps 36-42) ready, you'll now connect them using abapGit:
-
Execute the abapGit program by running transaction SE38 and executing program
ZABAPGITthat you installed in Tutorial 1 -
Click on the "+" icon (New Online)
-
Enter the following details:
- Git Repository URL:
https://github.com/YOUR-USERNAME/sap-github-demo.git(the repository created in Steps 36-42) - Package:
Z_GITHUB_DEMO(the package you created in Steps 32-35) - Branch: main (default)
- Click Create Online Repo
- Git Repository URL:
-
abapGit will show your new repository connection with no objects
Now that you've established the connection between your ABAP package and GitHub repository, let's create a sample ABAP program to demonstrate the workflow:
-
Return to transaction SE80
-
Navigate to your package
Z_GITHUB_DEMOcreated in Steps 32-35 -
Right-click on the package and select Create > Program
-
Enter a program name (e.g.,
Z_GITHUB_HELLO_WORLD) -
Add the following simple code:
REPORT z_github_hello_world. PARAMETERS: p_name TYPE string DEFAULT 'World'. START-OF-SELECTION. WRITE: / 'Hello,', p_name, '!'. WRITE: / 'This program is version controlled with GitHub.'.
-
Save and activate the program
Now that you have created a sample program in Steps 47-52, you'll push it to your GitHub repository:
-
Return to abapGit by running transaction SE38 and executing program
ZABAPGIT -
Navigate to your repository (created in Steps 43-46)
-
You should see your program
Z_GITHUB_HELLO_WORLDwith a new (non-staged) status -
Check the box next to your program to stage it
-
Click the Stage button
-
Enter a commit message that describes your changes (e.g., "Add hello world program")
-
Click Commit
-
When prompted, enter your GitHub username and password or personal access token
-
Click Execute to complete the push
After pushing your code in Steps 53-61, let's verify that everything is working correctly:
- Open your web browser and navigate to your GitHub repository
- Verify that your program appears in the repository
- Click on the program file to view its content
- Check that the commit message is displayed in the repository history
Before proceeding to the next tutorial, verify that:
- Your ABAP package is properly linked to your GitHub repository
- You can successfully push changes from SAP to GitHub
- The program content appears correctly in GitHub
- The commit history shows your changes
Issue: "Authentication failed" when pushing to GitHub
Solution:
- GitHub may require a personal access token instead of your password
- Generate a new token in GitHub (Settings > Developer settings > Personal access tokens)
- Ensure the token has the appropriate repository permissions
- Use this token instead of your password when prompted by abapGit
Issue: "Package not found" error when creating repository
Solution:
- Ensure the package you specified in Step 34 exists and is correctly named
- Check that you have authorization to use this package
- Try creating the package again if necessary
Issue: Timeout or connection errors when pushing to GitHub
Solution:
- Check that the SSL certificate was properly imported in Tutorial 1 (Steps 21-28)
- Verify your network connectivity to GitHub
- Ensure your proxy settings are correctly configured if you're behind a corporate firewall
Now that you have successfully configured abapGit for your project in Steps 32-65, you're ready to proceed to the next phase of the integration setup:
- Tutorial 3: Implementing Development Workflow - In this next tutorial, you'll learn how to implement a proper development workflow using the integration you've just configured.
In Tutorial 3, you'll learn about branching strategies, collaborative development, and how to manage changes between SAP and GitHub using the foundation you've built in Tutorials 1 and 2.