In Tutorial 1, you installed abapGit in your SAP system, and in Tutorial 2, you configured abapGit for your specific ABAP project. Now that you have successfully connected your SAP system to GitHub (Steps 1-65), it's time to implement a proper development workflow that leverages this integration to improve your development process.
Before beginning this tutorial, ensure you have:
- Completed all steps in Tutorial 1: Installing abapGit in SAP System (Steps 1-31)
- Completed all steps in Tutorial 2: Configuring abapGit for Your Project (Steps 32-65)
- Verified your GitHub integration is working correctly (Steps 62-65 of Tutorial 2)
- Basic understanding of Git concepts (branches, commits, pull requests)
- Developer authorization in your SAP system
flowchart TD
subgraph SAP System
feature_branch["1. Create Feature Branch"]
develop["2. Develop in SAP"]
stage["3. Stage Changes"]
commit["4. Commit and Push"]
end
subgraph GitHub
pr["5. Create Pull Request"]
review["6. Code Review"]
merge["7. Merge to Main"]
end
subgraph SAP Sync
pull["8. Pull Changes to SAP"]
end
feature_branch --> develop
develop --> stage
stage --> commit
commit --> pr
pr --> review
review --> merge
merge --> pull
classDef sap fill:#f9f,stroke:#333,stroke-width:1px;
classDef github fill:#bbf,stroke:#333,stroke-width:1px;
classDef sync fill:#bfb,stroke:#333,stroke-width:1px;
class feature_branch,develop,stage,commit sap;
class pr,review,merge github;
class pull sync;
This tutorial covers the implementation of a standard Git-based development workflow adapted for SAP development:
- Creating feature branches
- Making changes in SAP
- Committing and pushing to GitHub
- Creating pull requests
- Reviewing and merging code
- Pulling changes back to SAP
Continuing from Tutorial 2 where you verified your GitHub integration in Steps 62-65, you'll now implement a proper branching strategy:
-
Open abapGit by running transaction SE38 and executing program
ZABAPGIT -
Navigate to your repository (the one you created in Steps 43-46 of Tutorial 2)
-
Click on the branch icon in the abapGit toolbar (usually labeled "main")
-
In the branch dialog, click Create New Branch
-
Enter a feature branch name using a descriptive convention:
feature/add-customer-list -
Select "Create from: main" to base your new branch on the main branch
-
Click Create
-
Verify that abapGit indicates you're now working on the new branch
With your feature branch created in Steps 66-73, you'll now implement a new feature in SAP:
-
Return to transaction SE80
-
Navigate to your package
Z_GITHUB_DEMO(created in Steps 32-35 of Tutorial 2) -
Right-click on the package and select Create > Program
-
Enter a program name (e.g.,
Z_CUSTOMER_LIST) -
Add the following code:
REPORT z_customer_list. TABLES: kna1. " Customer master data table PARAMETERS: p_limit TYPE i DEFAULT 10. START-OF-SELECTION. " Select customer data SELECT kunnr name1 land1 ort01 FROM kna1 INTO TABLE @DATA(lt_customers) UP TO @p_limit ROWS. " Display results WRITE: / 'Customer List', / '============'. LOOP AT lt_customers INTO DATA(ls_customer). WRITE: / 'ID:', ls_customer-kunnr, 'Name:', ls_customer-name1, 'Country:', ls_customer-land1, 'City:', ls_customer-ort01. ENDLOOP.
-
Save and activate the program
After implementing your feature in Steps 74-79, you'll commit and push it to your feature branch:
-
Return to abapGit by running transaction SE38 and executing program
ZABAPGIT -
Navigate to your repository and verify that you're still on the
feature/add-customer-listbranch -
You should see your program
Z_CUSTOMER_LISTwith a new (non-staged) status -
Check the box next to your program to stage it
-
Click the Stage button
-
Enter a descriptive commit message: "Add customer list program for data reporting"
-
Click Commit
-
When prompted, enter your GitHub credentials
-
Click Execute to complete the push
-
Verify in abapGit that the push was successful
With your changes committed to the feature branch in Steps 80-89, it's time to create a pull request for code review:
-
Open your web browser and navigate to your GitHub repository
-
GitHub should show a notification about your recently pushed branch
-
Click on the Compare & pull request button
-
Enter a pull request title: "Add customer list program"
-
In the description, provide details about your changes:
This pull request adds a new program to display customer information.
The program allows:
- Viewing customer master data
- Limiting the number of records displayed
- Displaying key information including ID, name, country, and city
- Click Create pull request
In a real-world scenario, another team member would review your changes. For this tutorial, you'll review and merge your own pull request:
-
In GitHub, open the pull request you created in Steps 90-95
-
Click on the "Files changed" tab to see the code changes
-
Review the code changes, ensuring everything looks correct
-
Add a comment to simulate a code review: "Code looks good. The field selection is appropriate for the report requirements."
-
Click the Merge pull request button
-
Click Confirm merge
-
Verify that GitHub shows the pull request as merged
-
Click on the Delete branch button to clean up the feature branch (optional)
Now that your changes are merged into the main branch on GitHub in Steps 96-103, you need to update your SAP system:
-
Return to abapGit by running transaction SE38 and executing program
ZABAPGIT -
Navigate to your repository
-
Switch back to the main branch by clicking on the branch icon and selecting "main"
-
Click the Pull button to fetch the latest changes from GitHub
-
abapGit will display the changes from your merged pull request
-
Confirm the pull operation
-
Verify that your
Z_CUSTOMER_LISTprogram is now part of the main branch in your SAP system
Before concluding this tutorial, verify that:
- Your feature branch was successfully created in GitHub
- The new program was properly pushed to GitHub
- The pull request was created, reviewed, and merged
- Changes were successfully pulled back to the main branch in SAP
- The program runs correctly in your SAP system
Issue: "Local objects modified" error when switching branches
Solution:
- Commit or revert any local changes before switching branches
- Check if transport requests are open for modified objects
- Release or reassign transports if necessary
Issue: Conflicts between your changes and the main branch
Solution:
- Pull the latest changes from the main branch before creating your feature branch
- If conflicts occur, resolve them in abapGit's merge tool
- For complex conflicts, consider manually resolving in SAP before committing
Issue: Objects locked in transport requests
Solution:
- Ensure objects are assigned to appropriate transport requests
- Release completed transport requests before switching branches
- Consider implementing a transport request strategy aligned with your branching strategy
Now that you have successfully implemented a development workflow in Steps 66-110, you're ready to proceed to the next phase of the integration:
- Tutorial 4: Implementing Continuous Integration - In this next tutorial, you'll set up automated testing and validation for your SAP developments using GitHub Actions.
In Tutorial 4, you'll learn how to implement automated testing, code quality checks, and validation processes to ensure your SAP developments meet quality standards before being deployed. This builds on the workflow established in this tutorial, adding automation to improve quality and efficiency.