{"success":"","message":"Pull completed with errors","error_detail":"CLAS ZCL_MY_CLASS: Syntax error\nException: The statement...","transport_request":"DEVK900001","activated_count":9,"failed_count":2,"activated_objects":[...],"failed_objects":[{"type":"E","text":"The statement METHOD is unexpected","obj_type":"CLAS","obj_name":"ZCL_MY_CLASS","exception":"The statement METHOD is unexpected"}]}
POST /create
Create an abapGit online repository in the ABAP system.
Import objects from an ABAP package into git. This endpoint runs asynchronously as a background job to handle large packages without HTTP timeouts.
Workflow
1. POST /import → Returns HTTP 202 Accepted with jobNumber
2. GET /import?jobNumber=X → Poll every 2 seconds for status
3. Job completes → Final status with result
Request
# 1. Get CSRF token
curl -c cookies.txt -D headers.txt -X GET "https://your-system:44300/sap/bc/z_abapgit_agent/health"\-u USER:PASSWORD \-H"sap-client: 100"\-H"X-CSRF-Token: fetch"CSRF=$(grep-i"x-csrf-token" headers.txt | awk'{print $2}' | tr-d'\r')# 2. Start import job
curl -X POST "https://your-system:44300/sap/bc/z_abapgit_agent/import"\-H"Content-Type: application/json"\-H"sap-client: 100"\-H"X-CSRF-Token: $CSRF"\-b cookies.txt \-u USER:PASSWORD \-d'{
"url": "https://github.com/user/repo.git",
"branch": "main",
"package": "$MY_PACKAGE",
"message": "feat: initial import from ABAP",
"username": "git-username",
"password": "ghp_token"
}'# 3. Poll for status (repeat until status is "completed" or "error")JOB_NUMBER="12345678"
curl -X GET "https://your-system:44300/sap/bc/z_abapgit_agent/import?jobNumber=$JOB_NUMBER"\-H"sap-client: 100"\-b cookies.txt \-u USER:PASSWORD
Request Body
{"url":"https://github.com/user/repo.git","branch":"main","package":"$MY_PACKAGE","message":"feat: initial import from ABAP","username":"git-username","password":"ghp_token"}
Field
Type
Required
Description
url
String
Yes
Git repository URL
branch
String
No
Branch name (default: main)
package
String
No
ABAP package (auto-detected from repo if omitted)
message
String
No
Commit message (default: “feat: initial import from ABAP package <package>”)
username
String
No
Git username (can also use credentials from .abapGitAgent)
password
String
No
Git token/password
Response: Job Scheduled (HTTP 202 Accepted)
{"success":true,"command":"import","status":"accepted","jobName":"IMPORT_20260305103045","jobNumber":"12345678","message":"Command scheduled for background execution"}
Field
Type
Description
success
Boolean
Always true when job is scheduled
command
String
Command type (“import”)
status
String
Always “accepted” for initial response
jobName
String
Background job name
jobNumber
String
Job number for polling (8 digits with leading zeros)
message
String
Status message
GET /import?jobNumber=X
Poll the status of a running import job.
Request
curl -X GET "https://your-system:44300/sap/bc/z_abapgit_agent/import?jobNumber=12345678"\-H"sap-client: 100"\-b cookies.txt \-u USER:PASSWORD
Response: Job Running
{"job_name":"IMPORT_20260305103045","job_number":"12345678","status":"running","stage":"STAGE_FILES","message":"Staging files (1250 of 3701)","progress":65,"current":1250,"total":3701,"started_at":"20260305103045","updated_at":"20260305103112"}
Response: Job Completed (Success)
{"job_name":"IMPORT_20260305103045","job_number":"12345678","status":"completed","stage":"FINISHED","message":"Import completed successfully","progress":100,"result":"{\"success\":\"X\",\"filesStaged\":\"3701\",\"commitMessage\":\"feat: initial import from ABAP package $MY_PACKAGE\"}","started_at":"20260305103045","updated_at":"20260305103520","completed_at":"20260305103520"}
Response: Job Failed
{"job_name":"IMPORT_20260305103045","job_number":"12345678","status":"error","stage":"FAILED","message":"Error during import","error_message":"Repository not found","progress":30,"started_at":"20260305103045","updated_at":"20260305103112","completed_at":"20260305103112"}
Pre-commit syntax check for ABAP source code without requiring pull/activation. Checks CLAS, INTF, PROG, and DDLS files directly from local filesystem.
Key Features:
Check syntax before committing to git
Auto-detection of companion files (locals_def, locals_imp, testclasses)
{"success":false,"command":"SYNTAX","message":"1 of 1 object(s) have syntax errors","results":[{"object_type":"CLAS","object_name":"ZCL_MY_CLASS","success":false,"error_count":2,"warning_count":0,"errors":[{"line":15,"text":"The statement METHOD is unexpected","include":"Main class"},{"line":42,"text":"Variable LV_TEST not declared","include":"Local implementation"}],"warnings":[],"message":"Syntax check failed with 2 error(s)"}]}
Response (unsupported type)
{"success":false,"command":"SYNTAX","message":"1 of 1 object(s) have syntax errors","results":[{"object_type":"FUGR","object_name":"Z_MY_FUGR","success":false,"error_count":1,"errors":[{"line":1,"text":"Unsupported object type: FUGR. Syntax command only supports CLAS, INTF, PROG, DDLS. Use 'pull' command for other object types."}],"message":"Unsupported object type: FUGR. Use 'pull' command instead."}]}
{"success":"","object_type":"CLAS","object_name":"ZCL_MY_CLASS","error_count":2,"errors":[{"line":"15","column":"12","text":"\"MESSAGE\" is not a declaration"},{"line":"20","column":"5","text":"Variable \"LV_TEST\" not found"}]}
{"success":"","test_count":5,"passed_count":3,"failed_count":2,"message":"2 of 5 tests failed","errors":[{"class_name":"ZCL_MY_TEST","method_name":"TEST_METHOD_1","error_kind":"ERROR","error_text":"Expected X but got Y"},{"class_name":"ZCL_MY_TEST","method_name":"TEST_METHOD_2","error_kind":"FAILURE","error_text":"Reference is initial"}]}
Object type (CLAS, INTF, TABL, STRU, DTEL, TTYP, DDLS). Auto-detected if not specified
full
Boolean
Return all source sections instead of public section only. For CLAS: returns sections[] with CU/CO/CP/CM*/CCDEF/CCIMP/CCAU includes. For INTF/PROG/DDLS: returns single-entry sections[]. Default: false
Supported Object Types
Type
Description
CLAS
Global ABAP class
INTF
Global interface
TABL
Database table
STRU
Structure type
DTEL
Data element
TTYP
Table type
DDLS
CDS View/Entity
Response (success - class/interface)
{"success":true,"command":"VIEW","message":"Retrieved object(s)","objects":[{"name":"ZCL_MY_CLASS","type":"CLAS","type_text":"Class","description":"Class ZCL_MY_CLASS in $PACKAGE","source":"CLASS zcl_my_class DEFINITION PUBLIC.\n PUBLIC SECTION.\n ...","not_found":false,"components":[]}],"summary":{"total":1,"by_type":["CLAS"]},"error":""}
Response (success - class with full: true)
When full: true is set, source is replaced by a sections array. Each entry represents one ABAP include. Line number rendering is done client-side by Node.js.
{"success":true,"command":"VIEW","message":"Retrieved object(s)","objects":[{"name":"ZCL_MY_CLASS","type":"CLAS","type_text":"Class","description":"Class ZCL_MY_CLASS in $PACKAGE","not_found":false,"components":[],"sections":[{"suffix":"CU","description":"Public Section","method_name":"","file":"","lines":["CLASS zcl_my_class DEFINITION PUBLIC FINAL CREATE PUBLIC."," PUBLIC SECTION."," ..."]},{"suffix":"CO","description":"Protected Section","method_name":"","file":"","lines":[" PROTECTED SECTION."]},{"suffix":"CP","description":"Private Section","method_name":"","file":"","lines":[" PRIVATE SECTION."," DATA mv_host TYPE string."]},{"suffix":"CM001","description":"Class Method","method_name":"CONSTRUCTOR","file":"","lines":["METHOD constructor."," mv_host = iv_host.","ENDMETHOD."]},{"suffix":"CCDEF","description":"Local Definitions","method_name":"","file":"locals_def","lines":["CLASS lcl_helper DEFINITION."," ..."]}]}],"summary":{"total":1,"by_type":["CLAS"]},"error":""}
Section field
Description
suffix
Include type: CU (public), CO (protected), CP (private), CM001…CMxxx (method implementations), CCDEF (local defs), CCIMP (local impl), CCAU (unit tests)
description
Human-readable label
method_name
Method name for CM* sections; empty for others
file
Non-empty for sections that come from a separate git file (locals_def, locals_imp, testclasses)
lines
Source lines of this include (no line numbers — rendering is client-side)
Response (success - table)
{"success":true,"command":"VIEW","message":"Retrieved object(s)","objects":[{"name":"SFLIGHT","type":"TABL","type_text":"Table","description":"Table SFLIGHT in SAPBC_DATAMODEL","source":"","not_found":false,"components":[{"field":"MANDT","key":true,"type":"CLNT","length":3,"dataelement":"MANDT","description":"Client"},{"field":"CARRID","key":true,"type":"CHAR","length":3,"dataelement":"S_CARR_ID","description":"Airline Code"}]}],"summary":{"total":1,"by_type":["TABL"]},"error":""}
{"success":true,"command":"PREVIEW","message":"Retrieved data","objects":[{"name":"Z_NONEXISTENT","type":"TABL","type_text":"Table","row_count":0,"total_rows":0,"rows":[],"fields":[],"columns_displayed":0,"columns_hidden":[],"error":"Table or view not found: Z_NONEXISTENT"}],"summary":{"total_objects":1,"total_rows":0},"error":""}
POST /where
Find where-used list for ABAP objects (classes, interfaces, programs).