abapGit checkout / checkin roundtrip
Goal
Pull a package out of SAP as abapGit-formatted files, edit them with any tool, commit to git, and push the changes back to SAP — without Eclipse, without the abapGit frontend.
Prerequisites
- adt-cli installed and authenticated
- A source package (
$ZDEMOused throughout) - A transport:
export TR=DEVK900001 - Optional: git client, IDE, ESLint-for-ABAP, etc. — none is required
Layout
abapGit classic format. Each object becomes:
src/
zcl_demo.clas.abap # source
zcl_demo.clas.xml # metadata
zif_demo.intf.abap
zif_demo.intf.xml
zt_customer.tabl.xml # DDIC: metadata only, no .abap
zi_customer.ddls.asddls # DDL source
.apack-manifest.xml # (if present — package manifest)
package.devc.xml # package metadata
See Format comparison for the gCTS/AFF equivalent.
Steps
1. Checkout
adt checkout package \$ZDEMO ./src
Expected output:
Importing package $ZDEMO ...
CLAS ZCL_DEMO → src/zcl_demo.clas.abap (+xml)
INTF ZIF_DEMO → src/zif_demo.intf.abap (+xml)
TABL ZT_CUSTOMER → src/zt_customer.tabl.xml
DDLS ZI_CUSTOMER → src/zi_customer.ddls.asddls
DEVC $ZDEMO → src/package.devc.xml
4 objects, 1 package
Narrow by type:
adt checkout package \$ZDEMO ./src --object-types CLAS,INTF,DDLS
2. Edit
Work on the files with any editor, toolchain, linter, or AI assistant. abapGit
.abap files are plain ABAP with no wrapper — you can run prettier-abap,
ESLint-for-ABAP, git diff, etc.
3. Git snapshot
git init && git add src && git commit -m "initial checkout of $ZDEMO"
# ... edit ...
git commit -am "add validation in ZCL_DEMO->main"
4. Dry-run the checkin
Before writing anything back:
adt checkin ./src -p \$ZDEMO --dry-run
Expected output:
Plan (dry-run, no SAP writes):
UPDATE CLAS ZCL_DEMO (source changed)
SKIP INTF ZIF_DEMO (unchanged)
SKIP TABL ZT_CUSTOMER (unchanged)
1 updates, 0 creates, 0 deletes
5. Real checkin
adt checkin ./src -p \$ZDEMO -t $TR
checkin:
- Walks the directory and matches files to the format plugin.
- Opens a batch lock session.
- Creates-or-updates each object (attaches to
$TR). - Activates them as a group.
6. JSON output for scripts
adt checkin ./src -p \$ZDEMO -t $TR --json > result.json
jq '.results[] | select(.status!="ok")' result.json
Exit code is 1 if any object failed — result.json lists the details.
7. Skip activation (staging)
adt checkin ./src -p \$ZDEMO -t $TR --no-activate
Subset operations
# Single object
adt checkout class ZCL_DEMO ./src
adt checkin ./src --types CLAS -p \$ZDEMO -t $TR
# Multiple types
adt checkin ./src --types CLAS,INTF,DDLS -p \$ZDEMO -t $TR
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
Object ZCL_DEMO locked by user PPLENKOV | Stale lock from a previous run | adt checkin ./src -p \$ZDEMO -t $TR --unlock (force-unlocks locks held by your user) |
Activation failed: ZT_CUSTOMER inactive | Type dependency didn't activate in-order | Keep all files together; abapGit activation orders by object kind. If it still fails, split: --types TABL,DTEL,DOMA first, then --types CLAS,INTF,DDLS |
Format plugin not found: abapgit | Plugin dependency not installed | npm i -g @abapify/adt-plugin-abapgit |
Checkout wrote 0 files | Package empty, or type filter excluded everything | Remove --object-types, or drop into SE80/adt ls to confirm content |
| 412 Precondition Failed during checkin | Object changed in SAP since last checkout | Re-checkout, merge, retry |
See also
adt checkoutandadt checkin— command referenceadt import— lower-level with--format-option- gCTS workflow — alternative using git-enabled CTS on SAP
- Format comparison
@abapify/adt-plugin-abapgit— serialiser internals