import Command
Import existing ABAP objects from a package into an existing abapGit online repository.
Command
abapgit-agent import
abapgit-agent import --message "Your commit message"
Prerequisites
- Repository already exists in ABAP (created via abapGit UI or
createcommand) - Package has objects to import
- GitHub credentials configured in
.abapGitAgent
Behavior
The import command runs asynchronously as a background job:
- ✅ No HTTP timeout - Works for large packages with thousands of objects
- ✅ Real-time progress - Shows progress bar with current stage
- ✅ Non-blocking - Returns job number immediately
- ✅ Auto-polling - Polls every 2 seconds until completion
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
--message |
No | feat: initial import from ABAP package <package> |
Commit message |
--help |
No | - | Show help |
Configuration
.abapGitAgent
Add GitHub credentials to .abapGitAgent:
{
"gitUsername": "<your-github-username>",
"gitPassword": "ghp_your_github_token"
}
Environment Variables
export GIT_USERNAME="<your-github-username>"
export GIT_PASSWORD="ghp_your_github_token"
GitHub Personal Access Token
- Create a PAT at:
- GitHub.com: https://github.com/settings/tokens
- Select scopes:
repo- Full control of private repositories- Or
public_repoif your repo is public
How It Works
The import command runs asynchronously using a background job with real-time progress updates:
- Start Background Job - Creates ABAP background job
- Poll for Status - Polls every 2 seconds for progress
- Display Progress - Shows progress bar with current stage
- Complete - Shows final results (files staged, time spent)
Import Stages
The background job progresses through 5 stages:
- Find Repository (10%) - Locate abapGit repository by git URL
- Refresh Repository (30%) - Get latest state from ABAP
- Stage Files (50-70%) - Create stage with all local files from package
- Prepare Commit (70%) - Build commit message and prepare metadata
- Push (90%) - Commit and push to remote repository
Workflow
Full Development Cycle
1. Develop in ABAP (SAP GUI, ADT)
└─> Create/modify objects in package
2. abapgit-agent import
└─> Stages, commits, and pushes to git
3. git pull (optional, in local repo)
└─> Get files to local folder
4. Repeat
Output
Success
📦 Starting import job
URL: https://github.com/user/repo.git
✅ Job started: 14334000
[==============================] Import completed successfully
✅ Import completed successfully!
Files staged: 3701
Commit: feat: initial import from ABAP package FRA_HOME_MAIN
⏱️ Time spent: 20 seconds
📈 Stats:
Job number: 14334000
Started: 2026-03-04 13:33:40
Completed: 2026-03-04 13:34:00
Progress Display
During import, a progress bar shows the current stage:
[=============== ] Staging local files...
[=========================== ] Pushing to repository...
[==============================] Import completed successfully
With Custom Message
📦 Starting import job
URL: https://github.com/user/repo.git
✅ Job started: 14335000
[==============================] Import completed successfully
✅ Import completed successfully!
Files staged: 15
Commit: My custom import message
⏱️ Time spent: 8 seconds
📈 Stats:
Job number: 14335000
Started: 2026-03-04 14:20:10
Completed: 2026-03-04 14:20:18
Error - Repository Not Found
📦 Starting import job
URL: https://github.com/user/repo.git
✅ Job started: 14336000
[=============== ] Finding repository...
❌ Import failed!
Error: Repository not found
Error - No Objects Found
📦 Starting import job
URL: https://github.com/user/repo.git
✅ Job started: 14337000
[=========================== ] Staging local files...
❌ Import failed!
Error: No objects found in package
Error - GitHub Credentials
📦 Starting import job
URL: https://github.com/user/repo.git
✅ Job started: 14338000
[=========================== ] Pushing to repository...
❌ Import failed!
Error: Error during import (HTTP 403 Forbidden)
Troubleshooting
HTTP 401/403 Unauthorized
GitHub credentials not configured or invalid:
- Create a GitHub Personal Access Token
- Add to
.abapGitAgent:
{
"gitUsername": "<your-github-username>",
"gitPassword": "ghp_your_token"
}
Note: The password must be passed exactly as-is (case-sensitive). The import command preserves case sensitivity.
Repository Not Found
The repository must exist in abapGit:
- Run
abapgit-agent createto create it, OR - Create manually in abapGit: run transaction
ZABAPGIT(orSE38→ZABAPGIT) → New → Online → enter git URL
No Objects Found
The package may be empty or objects not yet created:
- Verify package in SAP GUI:
SE21→ Display Package - Ensure objects exist in the package
Job Stuck or Hangs
If the import appears to hang:
- Check ABAP background job:
SM37→ Job name:ABGAGT_IMPORT_* - View job log for errors
- If job failed, error will be shown in CLI after timeout
Large Package Import
For packages with thousands of objects:
- Import runs asynchronously (no HTTP timeout)
- Progress updates every 2 seconds
- Typical speed: ~100-200 objects per second
- 3700+ objects: ~20-30 seconds
Full Workflow
Option 1: abapgit-agent (Recommended)
# Initialize
abapgit-agent init --folder /abap --package ZMYPROJECT
# Edit config
vim .abapGitAgent
# Create repository
abapgit-agent create
# Develop objects in ABAP...
# Import objects to git
abapgit-agent import
# Pull to local folder
git pull origin main
Option 2: abapGit UI for Creation
# Initialize
abapgit-agent init --folder /abap --package ZMYPROJECT
# Edit config
vim .abapGitAgent
# Create repository in abapGit: run transaction ZABAPGIT → New → Online → Enter git URL
# Develop objects in ABAP...
# Import objects to git
abapgit-agent import