abapgit-agent 1.1.6 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.github/workflows/release.yml +3 -1
  2. package/CLAUDE.md +248 -0
  3. package/README.md +16 -2
  4. package/RELEASE_NOTES.md +80 -8
  5. package/abap/CLAUDE.md +72 -6
  6. package/abap/copilot-instructions.md +51 -0
  7. package/abap/zcl_abgagt_cmd_factory.clas.abap +2 -0
  8. package/abap/zcl_abgagt_command_tree.clas.abap +237 -0
  9. package/abap/zcl_abgagt_command_tree.clas.xml +15 -0
  10. package/abap/zcl_abgagt_command_view.clas.abap +238 -0
  11. package/abap/zcl_abgagt_command_view.clas.xml +15 -0
  12. package/abap/zcl_abgagt_resource_tree.clas.abap +70 -0
  13. package/abap/zcl_abgagt_resource_tree.clas.xml +15 -0
  14. package/abap/zcl_abgagt_resource_view.clas.abap +68 -0
  15. package/abap/zcl_abgagt_resource_view.clas.xml +15 -0
  16. package/abap/zcl_abgagt_rest_handler.clas.abap +2 -0
  17. package/abap/zcl_abgagt_viewer_clas.clas.abap +58 -0
  18. package/abap/zcl_abgagt_viewer_clas.clas.xml +15 -0
  19. package/abap/zcl_abgagt_viewer_dtel.clas.abap +98 -0
  20. package/abap/zcl_abgagt_viewer_dtel.clas.xml +15 -0
  21. package/abap/zcl_abgagt_viewer_factory.clas.abap +41 -0
  22. package/abap/zcl_abgagt_viewer_factory.clas.xml +15 -0
  23. package/abap/zcl_abgagt_viewer_intf.clas.abap +58 -0
  24. package/abap/zcl_abgagt_viewer_intf.clas.xml +15 -0
  25. package/abap/zcl_abgagt_viewer_stru.clas.abap +59 -0
  26. package/abap/zcl_abgagt_viewer_stru.clas.xml +15 -0
  27. package/abap/zcl_abgagt_viewer_tabl.clas.abap +59 -0
  28. package/abap/zcl_abgagt_viewer_tabl.clas.xml +15 -0
  29. package/abap/zif_abgagt_command.intf.abap +3 -1
  30. package/abap/zif_abgagt_viewer.intf.abap +11 -0
  31. package/abap/zif_abgagt_viewer.intf.xml +15 -0
  32. package/bin/abapgit-agent +397 -0
  33. package/docs/commands.md +27 -8
  34. package/docs/tree-command.md +303 -0
  35. package/docs/view-command.md +409 -0
  36. package/package.json +1 -1
  37. package/src/abap-client.js +22 -0
  38. package/src/agent.js +27 -0
@@ -40,8 +40,10 @@ jobs:
40
40
  id: release_notes
41
41
  run: |
42
42
  if [ -f "RELEASE_NOTES.md" ]; then
43
+ # Extract only the current release (first section until --- separator)
44
+ content=$(awk '/^---$/{exit}1' RELEASE_NOTES.md)
43
45
  echo "CONTENT<<EOF" >> $GITHUB_OUTPUT
44
- cat RELEASE_NOTES.md >> $GITHUB_OUTPUT
46
+ echo "$content" >> $GITHUB_OUTPUT
45
47
  echo "EOF" >> $GITHUB_OUTPUT
46
48
  else
47
49
  echo "CONTENT=No release notes" >> $GITHUB_OUTPUT
package/CLAUDE.md CHANGED
@@ -38,6 +38,7 @@ ABAP REST Handler (ZCL_ABGAGT_REST_HANDLER)
38
38
  Resource: ZCL_ABGAGT_RESOURCE_PULL → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_PULL → ZCL_ABGAGT_AGENT
39
39
  Resource: ZCL_ABGAGT_RESOURCE_INSPECT → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_INSPECT → ZCL_ABGAGT_AGENT
40
40
  Resource: ZCL_ABGAGT_RESOURCE_UNIT → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_UNIT → ZCL_ABGAGT_AGENT
41
+ Resource: ZCL_ABGAGT_RESOURCE_TREE → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_TREE → ZCL_ABGAGT_AGENT
41
42
  ```
42
43
 
43
44
  ### ABAP Objects
@@ -49,6 +50,7 @@ Resource: ZCL_ABGAGT_RESOURCE_UNIT → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COM
49
50
  | `ZCL_ABGAGT_COMMAND_PULL` | Pull command - implements ZIF_ABGAGT_COMMAND |
50
51
  | `ZCL_ABGAGT_COMMAND_INSPECT` | Inspect command - implements ZIF_ABGAGT_COMMAND |
51
52
  | `ZCL_ABGAGT_COMMAND_UNIT` | Unit command - implements ZIF_ABGAGT_COMMAND |
53
+ | `ZCL_ABGAGT_COMMAND_TREE` | Tree command - displays package hierarchy |
52
54
  | `ZIF_ABGAGT_COMMAND` | Command interface with constants |
53
55
  | `ZIF_ABGAGT_CMD_FACTORY` | Factory interface |
54
56
 
@@ -73,6 +75,14 @@ abapgit-agent inspect --files abap/zcl_my_class.clas.abap
73
75
  # Run unit tests for ABAP test classes
74
76
  abapgit-agent unit --files abap/zcl_my_test.clas.testclasses.abap
75
77
 
78
+ # Display package hierarchy tree
79
+ abapgit-agent tree --package $MY_PACKAGE
80
+
81
+ # View ABAP object definitions from ABAP system
82
+ abapgit-agent view --objects ZCL_MY_CLASS
83
+ abapgit-agent view --objects ZIF_MY_INTERFACE --type INTF
84
+ abapgit-agent view --objects ZCL_CLASS1,ZCL_CLASS2 --json
85
+
76
86
  # Health check
77
87
  abapgit-agent health
78
88
 
@@ -85,6 +95,22 @@ abapgit-agent status
85
95
  ### Description
86
96
  Pull and activate ABAP objects from git repository.
87
97
 
98
+ ### Rule: Pull All Changed Files Together
99
+
100
+ **CRITICAL**: When multiple ABAP files are changed, pull them ALL together in a single command:
101
+
102
+ ```bash
103
+ # WRONG - Pull files one by one (may cause activation issues)
104
+ abapgit-agent pull --files zcl_class1.clas.abap
105
+ abapgit-agent pull --files zcl_class2.clas.abap
106
+ abapgit-agent pull --files zif_interface1.intf.abap
107
+
108
+ # CORRECT - Pull all changed files together
109
+ abapgit-agent pull --files zcl_class1.clas.abap,zcl_class2.clas.abap,zif_interface1.intf.abap
110
+ ```
111
+
112
+ **Why?** ABAP objects often have dependencies on each other. Pulling separately can cause activation errors if dependent objects haven't been activated yet. Pulling together ensures the ABAP system processes all changes atomically.
113
+
88
114
  ### Usage
89
115
  ```bash
90
116
  # Auto-detect git remote and branch from current directory
@@ -230,6 +256,202 @@ The unit command uses `CL_SUT_AUNIT_RUNNER` to execute AUnit tests:
230
256
  - `tab_objects` - Get detailed results with nested structure:
231
257
  - `TAB_TESTCLASSES` → `TAB_METHODS` → `STR_ERROR` → `STR_ERROR_CORE`
232
258
 
259
+ ## Tree Command
260
+
261
+ ### Description
262
+ Display the package hierarchy tree from an ABAP system, showing parent packages, sub-packages, and object counts.
263
+
264
+ ### Usage
265
+ ```bash
266
+ # Basic usage
267
+ abapgit-agent tree --package $MY_PACKAGE
268
+
269
+ # With object breakdown by type
270
+ abapgit-agent tree --package $MY_PACKAGE --include-objects
271
+
272
+ # Limit depth (default: 3, max: 10)
273
+ abapgit-agent tree --package $MY_PACKAGE --depth 2
274
+
275
+ # JSON output for scripting
276
+ abapgit-agent tree --package $MY_PACKAGE --json
277
+ ```
278
+
279
+ ### Parameters
280
+
281
+ | Parameter | Required | Description |
282
+ |-----------|----------|-------------|
283
+ | `--package` | Yes | ABAP package name (e.g., `$ZMY_PACKAGE`, `ZMY_PACKAGE`) |
284
+ | `--depth` | No | Maximum depth to traverse (default: 3, max: 10) |
285
+ | `--include-objects` | No | Include object counts breakdown by type |
286
+ | `--json` | No | Output raw JSON only (for scripting) |
287
+
288
+ ### Output
289
+
290
+ **Human-readable with AI metadata:**
291
+ ```
292
+ 🌳 Package Tree: $ZMAIN_PACKAGE
293
+
294
+ 📦 $ZMAIN_PACKAGE (Main Package)
295
+ ├─ 📦 $ZMAIN_SUB1 (Sub Package 1)
296
+ │ ├─ 📦 $ZMAIN_SUB1_A (Sub Package 1A)
297
+ │ └─ 📦 $ZMAIN_SUB1_B (Sub Package 1B)
298
+ └─ 📦 $ZMAIN_SUB2 (Sub Package 2)
299
+
300
+ 📊 Summary
301
+ PACKAGES: 4
302
+ OBJECTS: 127
303
+
304
+ <!-- AI_METADATA_START -->
305
+ {"package":"$ZMAIN_PACKAGE","parent":"$ZSAP_BASE","total_packages":4,"total_objects":127}
306
+ <!-- AI_METADATA_END -->
307
+ ```
308
+
309
+ **With object breakdown:**
310
+ ```
311
+ 📊 Summary
312
+ PACKAGES: 4
313
+ OBJECTS: 127
314
+ TYPES: CLAS=10 INTF=2 PROG=11 FUGR=1 TABL=3
315
+ ```
316
+
317
+ ### JSON Output
318
+ ```json
319
+ {
320
+ "SUCCESS": true,
321
+ "COMMAND": "TREE",
322
+ "PACKAGE": "$ZMAIN_PACKAGE",
323
+ "PARENT_PACKAGE": "$ZSAP_BASE",
324
+ "NODES": [
325
+ {
326
+ "PACKAGE": "$ZMAIN_PACKAGE",
327
+ "PARENT": "",
328
+ "DESCRIPTION": "$ZMAIN_PACKAGE",
329
+ "DEPTH": 0,
330
+ "OBJECT_COUNT": 11
331
+ }
332
+ ],
333
+ "TOTAL_PACKAGES": 4,
334
+ "TOTAL_OBJECTS": 127,
335
+ "OBJECTS": [
336
+ { "OBJECT": "CLAS", "COUNT": 10 },
337
+ { "OBJECT": "INTF", "COUNT": 2 },
338
+ { "OBJECT": "PROG", "COUNT": 11 },
339
+ { "OBJECT": "FUGR", "COUNT": 1 },
340
+ { "OBJECT": "TABL", "COUNT": 3 }
341
+ ],
342
+ "ERROR": ""
343
+ }
344
+ ```
345
+
346
+ ### Error Handling
347
+
348
+ | Error | Message |
349
+ |-------|---------|
350
+ | Package not found | `Package <name> does not exist in the system` |
351
+ | Invalid package name | `Invalid package name: <name>` |
352
+ | Access denied | `Access denied to package information` |
353
+ | Depth too large | `Depth value too large (max: 10)` |
354
+
355
+ ## View Command
356
+
357
+ ### Description
358
+ View ABAP object definitions directly from the ABAP system without pulling from git. **This is the PRIMARY way to explore unfamiliar ABAP objects** - tables, structures, classes, interfaces, and data elements.
359
+
360
+ **When you encounter an unknown table or structure, use this command instead of guessing!**
361
+
362
+ ### Explore Unknown Tables/Structures
363
+
364
+ ```bash
365
+ # View table fields - see all columns, keys, and descriptions
366
+ abapgit-agent view --objects ZMY_TABLE --type TABL
367
+
368
+ # View structure components
369
+ abapgit-agent view --objects ZMY_STRUCT --type STRU
370
+
371
+ # View data element type information
372
+ abapgit-agent view --objects ZMY_DTEL --type DTEL
373
+
374
+ # View class interface and methods
375
+ abapgit-agent view --objects ZCL_UNKNOWN_CLASS
376
+
377
+ # View interface definition
378
+ abapgit-agent view --objects ZIF_UNKNOWN_INTERFACE
379
+ ```
380
+
381
+ ### Usage
382
+ ```bash
383
+ # View single object (auto-detect type from TADIR)
384
+ abapgit-agent view --objects ZCL_MY_CLASS
385
+ abapgit-agent view --objects ZIF_MY_INTERFACE
386
+
387
+ # View with explicit type
388
+ abapgit-agent view --objects ZCL_MY_CLASS --type CLAS
389
+ abapgit-agent view --objects ZIF_MY_INT --type INTF
390
+ abapgit-agent view --objects ZMY_TABLE --type TABL
391
+
392
+ # View multiple objects
393
+ abapgit-agent view --objects ZCL_CLASS1,ZCL_CLASS2,ZIF_INTERFACE1
394
+
395
+ # JSON output (for scripting/AI processing)
396
+ abapgit-agent view --objects ZCL_MY_CLASS --json
397
+ ```
398
+
399
+ ### Parameters
400
+
401
+ | Parameter | Required | Description |
402
+ |-----------|----------|-------------|
403
+ | `--objects` | Yes | Comma-separated list of object names (e.g., `ZCL_MY_CLASS,ZIF_MY_INTERFACE`) |
404
+ | `--type` | No | Object type for all objects (CLAS, INTF, TABL, STRU, DTEL, FUGR, PROG). Auto-detected from name prefix if not specified |
405
+ | `--json` | No | Output raw JSON only (for scripting) |
406
+
407
+ ### Supported Object Types
408
+
409
+ | Type | Description | Detection Pattern |
410
+ |------|-------------|-------------------|
411
+ | CLAS | Class | ZCL_* |
412
+ | INTF | Interface | ZIF_* |
413
+ | TABL | Table | Z* (from DD02L) |
414
+ | STRU | Structure | Z* (from DD02L) |
415
+ | DTEL | Data Element | ZTY_*, ZS_* |
416
+
417
+ ### Output
418
+
419
+ **Human-readable:**
420
+ ```
421
+ 📖 ZCL_MY_CLASS (Class)
422
+ My Custom Configuration Class
423
+ Methods: 3
424
+ - PUBLIC CONSTRUCTOR
425
+ - PUBLIC GET_CONFIG
426
+ - PUBLIC SET_CONFIG
427
+ ```
428
+
429
+ **JSON Output:**
430
+ ```json
431
+ {
432
+ "success": true,
433
+ "command": "VIEW",
434
+ "message": "Retrieved 1 object(s)",
435
+ "objects": [
436
+ {
437
+ "name": "ZCL_MY_CLASS",
438
+ "type": "CLAS",
439
+ "type_text": "Class",
440
+ "description": "My Custom Configuration Class",
441
+ "methods": [...]
442
+ }
443
+ ],
444
+ "summary": { "total": 1 }
445
+ }
446
+ ```
447
+
448
+ ### Error Handling
449
+
450
+ | Error | Message |
451
+ |-------|---------|
452
+ | Object not found | `Object <name> not found` |
453
+ | Invalid object type | `Unsupported object type: <type>` |
454
+
233
455
  ## Status Check
234
456
 
235
457
  ### Description
@@ -295,6 +517,32 @@ export GIT_PASSWORD="git-token"
295
517
 
296
518
  ## Development Workflow
297
519
 
520
+ ### Exploring Unknown ABAP Objects
521
+
522
+ **Before working with an unfamiliar table, structure, class, or interface:**
523
+
524
+ ```bash
525
+ # Don't guess! Use view command to explore:
526
+
527
+ # Check table structure
528
+ abapgit-agent view --objects ZMY_TABLE --type TABL
529
+
530
+ # Check structure components
531
+ abapgit-agent view --objects ZMY_STRUCT --type STRU
532
+
533
+ # Check class methods and interface
534
+ abapgit-agent view --objects ZCL_UNKNOWN_CLASS
535
+
536
+ # Check interface definition
537
+ abapgit-agent view --objects ZIF_UNKNOWN_INTERFACE
538
+
539
+ # Check data element type
540
+ abapgit-agent view --objects ZMY_DTEL --type DTEL
541
+
542
+ # JSON output for programmatic use
543
+ abapgit-agent view --objects ZMY_TABLE --type TABL --json
544
+ ```
545
+
298
546
  ### CLI Tool Development
299
547
 
300
548
  1. Make changes to CLI code (JavaScript)
package/README.md CHANGED
@@ -25,7 +25,7 @@ git clone https://github.com/user/abap-project.git
25
25
  cd abap-project
26
26
 
27
27
  # 3. Initialize configuration
28
- abapgit-agent init --folder /abap --package ZMY_PACKAGE
28
+ abapgit-agent init --folder /abap/ --package ZMY_PACKAGE
29
29
 
30
30
  # 4. Edit .abapGitAgent with credentials
31
31
 
@@ -47,7 +47,7 @@ See [Creating New ABAP Projects](INSTALL.md#creating-new-abap-projects) to set u
47
47
 
48
48
  ```bash
49
49
  # Initialize local configuration for existing git repo
50
- abapgit-agent init --folder /abap --package ZMY_PACKAGE
50
+ abapgit-agent init --folder /abap/ --package ZMY_PACKAGE
51
51
 
52
52
  # Create online repository in ABAP
53
53
  abapgit-agent create
@@ -94,6 +94,18 @@ abapgit-agent unit --files abap/zcl_my_test.clas.testclasses.abap
94
94
  abapgit-agent unit --files abap/zcl_test1.clas.testclasses.abap,abap/zcl_test2.clas.testclasses.abap
95
95
  ```
96
96
 
97
+ ### Explore Commands
98
+
99
+ ```bash
100
+ # Display package hierarchy tree
101
+ abapgit-agent tree --package $MY_PACKAGE
102
+
103
+ # View object definitions from ABAP system (classes, interfaces, tables, data elements)
104
+ abapgit-agent view --objects ZCL_MY_CLASS
105
+ abapgit-agent view --objects SFLIGHT --type TABL
106
+ abapgit-agent view --objects S_CARR_ID --type DTEL
107
+ ```
108
+
97
109
  ### Utility Commands
98
110
 
99
111
  ```bash
@@ -129,6 +141,8 @@ npm run pull -- --url <git-url> --branch main
129
141
  | pull Command | [docs/pull-command.md](docs/pull-command.md) |
130
142
  | inspect Command | [docs/inspect-command.md](docs/inspect-command.md) |
131
143
  | unit Command | [docs/unit-command.md](docs/unit-command.md) |
144
+ | tree Command | [docs/tree-command.md](docs/tree-command.md) |
145
+ | view Command | [docs/view-command.md](docs/view-command.md) |
132
146
  | REST API Reference | [API.md](API.md) |
133
147
  | Error Handling | [ERROR_HANDLING.md](ERROR_HANDLING.md) |
134
148
  | ABAP Coding Guidelines | [abap/CLAUDE.md](abap/CLAUDE.md) |
package/RELEASE_NOTES.md CHANGED
@@ -1,14 +1,86 @@
1
- ## What's New
1
+ # Release Notes
2
+
3
+ ## v1.2.0
4
+
5
+ ### New Features
6
+
7
+ #### tree Command
8
+ Display package hierarchy tree from ABAP system:
9
+ ```bash
10
+ # Basic usage
11
+ abapgit-agent tree --package $MY_PACKAGE
12
+
13
+ # With object counts
14
+ abapgit-agent tree --package $MY_PACKAGE --include-objects
15
+
16
+ # Limit depth
17
+ abapgit-agent tree --package $MY_PACKAGE --depth 2
18
+
19
+ # JSON output for scripting
20
+ abapgit-agent tree --package $MY_PACKAGE --json
21
+ ```
22
+
23
+ #### view Command
24
+ View ABAP object definitions directly from ABAP system without pulling from git:
25
+
26
+ ```bash
27
+ # View class definition
28
+ abapgit-agent view --objects ZCL_MY_CLASS
29
+
30
+ # View interface
31
+ abapgit-agent view --objects ZIF_MY_INTERFACE
32
+
33
+ # View table structure
34
+ abapgit-agent view --objects SFLIGHT --type TABL
35
+
36
+ # View data element
37
+ abapgit-agent view --objects S_CARR_ID --type DTEL
38
+
39
+ # View multiple objects
40
+ abapgit-agent view --objects ZCL_CLASS1,ZIF_INTERFACE1,ZMY_TABLE
41
+
42
+ # Auto-detect type from TADIR
43
+ abapgit-agent view --objects SFLIGHT
44
+
45
+ # JSON output for scripting
46
+ abapgit-agent view --objects ZCL_MY_CLASS --json
47
+ ```
48
+
49
+ **Supported Object Types:**
50
+ - CLAS - Global ABAP class
51
+ - INTF - Global interface
52
+ - TABL - Database table
53
+ - STRU - Structure type
54
+ - DTEL - Data element
55
+
56
+ ### Improvements
57
+
58
+ - **Auto-detection**: view command now queries TADIR to automatically detect object types (no need to specify `--type` for most objects)
59
+ - **Lowercase support**: Object names and types are case-insensitive
60
+ - **Error handling**: Non-existent objects now display clear error messages
61
+ - **Cleaner output**: Removed AI metadata block from tree command output
62
+
63
+ ### Bug Fixes
64
+
65
+ - Fixed non-existent object detection in view command
66
+ - Fixed source code display for class/interface definitions
67
+ - Fixed table and structure field display formatting
68
+ - Fixed data element output with domain information
69
+
70
+ ### Documentation
71
+
72
+ - Added comprehensive docs/tree-command.md
73
+ - Added comprehensive docs/view-command.md
74
+ - Updated README.md with tree and view command examples
75
+ - Updated CLAUDE.md with view command usage for exploring ABAP objects
76
+
77
+ ---
78
+
79
+ ## v1.1.6
2
80
 
3
81
  - Added `create` command to create online repository in ABAP system
4
82
  - Added `import` command to import objects from ABAP package to git
5
83
  - Added unit tests for create and import commands
6
84
  - Added GitHub Actions workflow for automated npm releases
7
- - Improved .gitignore handling in init command (adds .abapGitAgent and cookies file)
85
+ - Improved .gitignore handling in init command
8
86
  - Updated commands documentation
9
-
10
- ## Installation
11
-
12
- ```bash
13
- npm install -g abapgit-agent
14
- ```
package/abap/CLAUDE.md CHANGED
@@ -29,10 +29,10 @@ For quick ABAP code changes:
29
29
 
30
30
  ```bash
31
31
  # 1. Make small change to ABAP file
32
- # 2. Commit and push
32
+ # 2. Commit and push to git
33
33
  git add abap/zcl_my_class.clas.abap
34
34
  git commit -m "fix: ..."
35
- git push
35
+ git push # CRITICAL: Push BEFORE pulling!
36
36
 
37
37
  # 3. Pull only changed file (seconds, not minutes)
38
38
  abapgit-agent pull --files abap/zcl_my_class.clas.abap
@@ -66,6 +66,51 @@ abapgit-agent inspect --files abap/zcl_my_class.clas.abap
66
66
  ```
67
67
  This will show detailed syntax errors including line numbers and error messages.
68
68
 
69
+ ## View ABAP Object Definitions
70
+
71
+ Use the `view` command to inspect ABAP object definitions (classes, interfaces, tables, data elements) directly from the ABAP system. **Very useful when working with unfamiliar tables** - shows complete structure including fields, types, and descriptions.
72
+
73
+ ```bash
74
+ # View a table definition
75
+ abapgit-agent view --objects ZMY_TABLE --type TABL
76
+
77
+ # View a data element definition
78
+ abapgit-agent view --objects ZMY_DTEL --type DTEL
79
+
80
+ # View a class definition
81
+ abapgit-agent view --objects ZCL_MY_CLASS
82
+
83
+ # View multiple objects
84
+ abapgit-agent view --objects ZCL_CLASS1,ZCL_CLASS2,ZIF_INTERFACE1
85
+
86
+ # JSON output for scripting
87
+ abapgit-agent view --objects ZMY_TABLE --type TABL --json
88
+ ```
89
+
90
+ **Table Output Example:**
91
+ ```
92
+ TABLE ZCAIS_D1:
93
+ |----------------+-----+----------------+----------+----------------+----------------------|
94
+ | Field | Key | Type | Length | Data Elem | Description |
95
+ |----------------+-----+----------------+----------+----------------+----------------------|
96
+ | CLIENT | X | CLNT | 3 | MANDT | Client |
97
+ | ID | X | NUMC | 4 | NUMC4 | Count parameters |
98
+ | NAME | | CHAR | 50 | CHAR50 | Comment |
99
+ |----------------+-----+----------------+----------+----------------+----------------------|
100
+ ```
101
+
102
+ **Data Element Output Example:**
103
+ ```
104
+ DATA ELEMENT ZMY_DTEL:
105
+ |----------------+----------------+----------+----------------+----------------------|
106
+ | Field | Type | Length | Domain | Description |
107
+ |----------------+----------------+----------+----------------+----------------------|
108
+ | DOMAIN | CHAR | 20 | ZMY_DOMAIN | Domain: ZMY_DOMAIN |
109
+ | DATA_TYPE | CHAR | 10 | | ABAP Type: CHAR |
110
+ | LENGTH | NUMC | 5 | | Length: 20 |
111
+ |----------------+----------------+----------+----------------+----------------------|
112
+ ```
113
+
69
114
  ## JSON Handling - ALWAYS Use /ui2/cl_json
70
115
 
71
116
  **CRITICAL**: Always use `/ui2/cl_json` for JSON serialization and deserialization.
@@ -138,7 +183,16 @@ ENDCLASS.
138
183
 
139
184
  ## Creating New ABAP Objects - XML Metadata Required
140
185
 
141
- **IMPORTANT**: When creating new ABAP objects in abapGit format, you MUST create XML metadata files alongside the `.clas.abap` and `.intf.abap` files.
186
+ **CRITICAL CHECKLIST - Never Forget!**
187
+
188
+ When creating ANY new ABAP object file, you MUST also create its XML metadata file:
189
+
190
+ | ABAP File | Required XML File |
191
+ |-----------|------------------|
192
+ | `zcl_my_class.clas.abap` | `zcl_my_class.clas.xml` |
193
+ | `zif_my_intf.intf.abap` | `zif_my_intf.intf.xml` |
194
+
195
+ **Without XML files**, abapGit will NOT recognize the objects during pull, and they won't be activated.
142
196
 
143
197
  ### XML Metadata Format for CLAS
144
198
 
@@ -184,15 +238,27 @@ For `zif_abgagt_util.intf.abap`, create `zif_abgagt_util.intf.xml`:
184
238
  </abapGit>
185
239
  ```
186
240
 
187
- **Without XML files**, abapGit will NOT recognize the objects during pull, and they won't be activated in the ABAP system.
241
+ ### Important Notes
242
+
243
+ 1. **CRITICAL: Push to git BEFORE pulling into ABAP**
244
+ - Always commit and push ABAP files to git first
245
+ - Then run `abapgit-agent pull` to activate in ABAP
246
+ - Never run `abapgit-agent pull` without pushing changes first
247
+
248
+ 2. **Only pull ABAP files** - The XML metadata stays in git:
249
+ ```bash
250
+ abapgit-agent pull --files zcl_my_class.clas.abap
251
+ ```
252
+ 2. abapGit reads the XML from git to deserialize the ABAP code
253
+ 3. XML files are NOT activated in ABAP - they are only for abapGit
188
254
 
189
255
  ```bash
190
256
  # After making changes to ABAP files
191
257
  git add .
192
258
  git commit -m "Describe changes"
193
- git push
259
+ git push # CRITICAL: Push BEFORE pulling
194
260
 
195
- # Validate in ABAP system (single file - fast)
261
+ # Then validate in ABAP system (single file - fast)
196
262
  abapgit-agent pull --files abap/zcl_my_class.clas.abap
197
263
 
198
264
  # Or validate all files
@@ -0,0 +1,51 @@
1
+ # ABAP Development with abapGit
2
+
3
+ You are working on an ABAP project using abapGit for version control.
4
+
5
+ ## Commands
6
+
7
+ | Command | Description |
8
+ |---------|-------------|
9
+ | `abapgit-agent pull` | Pull and activate all ABAP objects |
10
+ | `abapgit-agent pull --files <file>` | Pull and activate specific file only |
11
+ | `abapgit-agent inspect --files <file>` | Syntax check ABAP source |
12
+ | `abapgit-agent unit --files <file>` | Run AUnit tests |
13
+
14
+ ## Key ABAP Rules
15
+
16
+ 1. **Global classes MUST use `PUBLIC`**:
17
+ ```abap
18
+ CLASS zcl_my_class DEFINITION PUBLIC. " <- REQUIRED
19
+ ```
20
+
21
+ 2. **Use `/ui2/cl_json` for JSON**:
22
+ ```abap
23
+ DATA ls_data TYPE ty_request.
24
+ ls_data = /ui2/cl_json=>deserialize( json = lv_json ).
25
+ lv_json = /ui2/cl_json=>serialize( data = ls_response ).
26
+ ```
27
+
28
+ 3. **Test class name max 30 chars**: `ltcl_util` (not `ltcl_abgagt_util_test`)
29
+
30
+ 4. **Interface method implementation**: Use prefix `zif_interface~method_name`
31
+
32
+ 5. **abapGit files need XML metadata**: `.clas.xml`, `.intf.xml` alongside `.clas.abap`, `.intf.abap`
33
+
34
+ ## Workflow
35
+
36
+ 1. Edit ABAP file in `/abap/`
37
+ 2. `git add <file> && git commit -m "..." && git push`
38
+ 3. `abapgit-agent pull --files <file>` (seconds, not minutes)
39
+
40
+ ## Error Handling
41
+
42
+ - Activation fails with "Error updating where-used list" = **syntax error**
43
+ - Use `abapgit-agent inspect --files <file>` for detailed error messages
44
+
45
+ ## Object Naming
46
+
47
+ | Pattern | Type |
48
+ |---------|------|
49
+ | `ZCL_*` | Class |
50
+ | `ZIF_*` | Interface |
51
+ | `Z*` | Other objects |
@@ -27,6 +27,8 @@ CLASS zcl_abgagt_cmd_factory IMPLEMENTATION.
27
27
  ( command = zif_abgagt_command=>gc_unit class_name = 'ZCL_ABGAGT_COMMAND_UNIT' )
28
28
  ( command = zif_abgagt_command=>gc_create class_name = 'ZCL_ABGAGT_COMMAND_CREATE' )
29
29
  ( command = zif_abgagt_command=>gc_import class_name = 'ZCL_ABGAGT_COMMAND_IMPORT' )
30
+ ( command = zif_abgagt_command=>gc_tree class_name = 'ZCL_ABGAGT_COMMAND_TREE' )
31
+ ( command = zif_abgagt_command=>gc_view class_name = 'ZCL_ABGAGT_COMMAND_VIEW' )
30
32
  ).
31
33
  ENDMETHOD.
32
34