abapgit-agent 1.3.0 → 1.4.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.
- package/API.md +179 -1
- package/CLAUDE.md +202 -0
- package/INSTALL.md +6 -11
- package/README.md +10 -0
- package/RELEASE_NOTES.md +44 -0
- package/abap/CLAUDE.md +130 -0
- package/abap/zcl_abgagt_cmd_factory.clas.abap +1 -0
- package/abap/zcl_abgagt_command_preview.clas.abap +386 -0
- package/abap/zcl_abgagt_command_preview.clas.xml +15 -0
- package/abap/zcl_abgagt_resource_preview.clas.abap +67 -0
- package/abap/zcl_abgagt_resource_preview.clas.xml +15 -0
- package/abap/zcl_abgagt_rest_handler.clas.abap +1 -0
- package/abap/zif_abgagt_command.intf.abap +2 -1
- package/bin/abapgit-agent +237 -0
- package/docs/commands.md +5 -0
- package/docs/preview-command.md +528 -0
- package/package.json +1 -1
- package/src/abap-client.js +18 -0
- package/src/agent.js +19 -0
package/API.md
CHANGED
|
@@ -12,6 +12,7 @@ The ABAP system exposes these endpoints via SICF handler: `sap/bc/z_abapgit_agen
|
|
|
12
12
|
| POST | `/unit` | Execute unit tests (AUnit) |
|
|
13
13
|
| POST | `/tree` | Display package hierarchy tree |
|
|
14
14
|
| POST | `/view` | View ABAP object definitions |
|
|
15
|
+
| POST | `/preview` | Preview table/CDS view data |
|
|
15
16
|
|
|
16
17
|
## GET /health
|
|
17
18
|
|
|
@@ -441,7 +442,158 @@ View ABAP object definitions directly from ABAP system.
|
|
|
441
442
|
}
|
|
442
443
|
```
|
|
443
444
|
|
|
444
|
-
##
|
|
445
|
+
## POST /preview
|
|
446
|
+
|
|
447
|
+
Preview data from ABAP tables or CDS views directly from the ABAP system. This is useful for exploring table/view contents without writing queries.
|
|
448
|
+
|
|
449
|
+
### Request Body
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{
|
|
453
|
+
"objects": ["SFLIGHT", "ZC_MY_CDS_VIEW"],
|
|
454
|
+
"type": "TABL",
|
|
455
|
+
"limit": 10,
|
|
456
|
+
"where": "CARRID = 'AA'",
|
|
457
|
+
"columns": ["CARRID", "CONNID", "PRICE"]
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
| Field | Type | Description |
|
|
462
|
+
|-------|------|-------------|
|
|
463
|
+
| `objects` | Array | List of table/view names (required) |
|
|
464
|
+
| `type` | String | Object type (TABL, DDLS). Auto-detected if not specified |
|
|
465
|
+
| `limit` | Integer | Maximum rows to return (default: 10, max: 100) |
|
|
466
|
+
| `where` | String | WHERE clause filter (e.g., `CARRID = 'AA'`) |
|
|
467
|
+
| `columns` | Array | Column names to display (optional) |
|
|
468
|
+
|
|
469
|
+
### Supported Object Types
|
|
470
|
+
|
|
471
|
+
| Type | Description |
|
|
472
|
+
|------|-------------|
|
|
473
|
+
| TABL | Database table |
|
|
474
|
+
| DDLS | CDS View/Entity |
|
|
475
|
+
|
|
476
|
+
### Auto-Detection Rules
|
|
477
|
+
|
|
478
|
+
If `type` is not specified, the system detects the type from TADIR:
|
|
479
|
+
- CDS views (DDLS) are preferred if found in TADIR
|
|
480
|
+
- Otherwise defaults to table (TABL)
|
|
481
|
+
|
|
482
|
+
### Response (success - table)
|
|
483
|
+
|
|
484
|
+
```json
|
|
485
|
+
{
|
|
486
|
+
"success": true,
|
|
487
|
+
"command": "PREVIEW",
|
|
488
|
+
"message": "Retrieved data",
|
|
489
|
+
"objects": [
|
|
490
|
+
{
|
|
491
|
+
"name": "SFLIGHT",
|
|
492
|
+
"type": "TABL",
|
|
493
|
+
"type_text": "Table",
|
|
494
|
+
"row_count": 5,
|
|
495
|
+
"total_rows": 10,
|
|
496
|
+
"rows": [
|
|
497
|
+
{
|
|
498
|
+
"MANDT": "100",
|
|
499
|
+
"CARRID": "AA",
|
|
500
|
+
"CONNID": 17,
|
|
501
|
+
"FLDATE": "2024-10-24",
|
|
502
|
+
"PRICE": 422.94,
|
|
503
|
+
"CURRENCY": "USD",
|
|
504
|
+
"PLANETYPE": "747-400"
|
|
505
|
+
}
|
|
506
|
+
],
|
|
507
|
+
"fields": [
|
|
508
|
+
{ "field": "MANDT", "type": "CLNT", "length": 3 },
|
|
509
|
+
{ "field": "CARRID", "type": "CHAR", "length": 3 },
|
|
510
|
+
{ "field": "CONNID", "type": "NUMC", "length": 4 },
|
|
511
|
+
{ "field": "FLDATE", "type": "DATS", "length": 8 },
|
|
512
|
+
{ "field": "PRICE", "type": "CURR", "length": 16, "decimals": 2 },
|
|
513
|
+
{ "field": "CURRENCY", "type": "CUKY", "length": 5 }
|
|
514
|
+
],
|
|
515
|
+
"columns_displayed": 6,
|
|
516
|
+
"columns_hidden": ["SEATSMAX", "SEATSOCC", "PAYMENTSUM"],
|
|
517
|
+
"error": ""
|
|
518
|
+
}
|
|
519
|
+
],
|
|
520
|
+
"summary": {
|
|
521
|
+
"total_objects": 1,
|
|
522
|
+
"total_rows": 5
|
|
523
|
+
},
|
|
524
|
+
"error": ""
|
|
525
|
+
}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Response (success - CDS view)
|
|
529
|
+
|
|
530
|
+
```json
|
|
531
|
+
{
|
|
532
|
+
"success": true,
|
|
533
|
+
"command": "PREVIEW",
|
|
534
|
+
"message": "Retrieved data",
|
|
535
|
+
"objects": [
|
|
536
|
+
{
|
|
537
|
+
"name": "ZC_MY_CDS_VIEW",
|
|
538
|
+
"type": "DDLS",
|
|
539
|
+
"type_text": "CDS View",
|
|
540
|
+
"row_count": 10,
|
|
541
|
+
"total_rows": 25,
|
|
542
|
+
"rows": [
|
|
543
|
+
{
|
|
544
|
+
"PACKAGE": "ZMY_PACKAGE",
|
|
545
|
+
"DESCRIPTION": "My Package",
|
|
546
|
+
"PARENT": "$ZROOT"
|
|
547
|
+
}
|
|
548
|
+
],
|
|
549
|
+
"fields": [
|
|
550
|
+
{ "field": "PACKAGE", "type": "CHAR", "length": 30 },
|
|
551
|
+
{ "field": "DESCRIPTION", "type": "CHAR", "length": 60 },
|
|
552
|
+
{ "field": "PARENT", "type": "CHAR", "length": 30 }
|
|
553
|
+
],
|
|
554
|
+
"columns_displayed": 3,
|
|
555
|
+
"columns_hidden": [],
|
|
556
|
+
"error": ""
|
|
557
|
+
}
|
|
558
|
+
],
|
|
559
|
+
"summary": {
|
|
560
|
+
"total_objects": 1,
|
|
561
|
+
"total_rows": 10
|
|
562
|
+
},
|
|
563
|
+
"error": ""
|
|
564
|
+
}
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
### Response (error - not found)
|
|
568
|
+
|
|
569
|
+
```json
|
|
570
|
+
{
|
|
571
|
+
"success": true,
|
|
572
|
+
"command": "PREVIEW",
|
|
573
|
+
"message": "Retrieved data",
|
|
574
|
+
"objects": [
|
|
575
|
+
{
|
|
576
|
+
"name": "Z_NONEXISTENT",
|
|
577
|
+
"type": "TABL",
|
|
578
|
+
"type_text": "Table",
|
|
579
|
+
"row_count": 0,
|
|
580
|
+
"total_rows": 0,
|
|
581
|
+
"rows": [],
|
|
582
|
+
"fields": [],
|
|
583
|
+
"columns_displayed": 0,
|
|
584
|
+
"columns_hidden": [],
|
|
585
|
+
"error": "Table or view not found: Z_NONEXISTENT"
|
|
586
|
+
}
|
|
587
|
+
],
|
|
588
|
+
"summary": {
|
|
589
|
+
"total_objects": 1,
|
|
590
|
+
"total_rows": 0
|
|
591
|
+
},
|
|
592
|
+
"error": ""
|
|
593
|
+
}
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
### Response Structure
|
|
445
597
|
|
|
446
598
|
### Pull Response Fields
|
|
447
599
|
|
|
@@ -506,6 +658,32 @@ View ABAP object definitions directly from ABAP system.
|
|
|
506
658
|
| `summary` | Object | Summary with total and by_type |
|
|
507
659
|
| `error` | String | Error message (empty if success) |
|
|
508
660
|
|
|
661
|
+
### Preview Response Fields
|
|
662
|
+
|
|
663
|
+
| Field | Type | Description |
|
|
664
|
+
|-------|------|-------------|
|
|
665
|
+
| `success` | Boolean | Whether the request succeeded |
|
|
666
|
+
| `command` | String | Command name ("PREVIEW") |
|
|
667
|
+
| `message` | String | Status message |
|
|
668
|
+
| `objects` | Array | List of table/view results |
|
|
669
|
+
| `summary` | Object | Summary with total_objects and total_rows |
|
|
670
|
+
| `error` | String | Error message (empty if success) |
|
|
671
|
+
|
|
672
|
+
### Preview Object Fields
|
|
673
|
+
|
|
674
|
+
| Field | Type | Description |
|
|
675
|
+
|-------|------|-------------|
|
|
676
|
+
| `name` | String | Table/view name |
|
|
677
|
+
| `type` | String | Object type (TABL, DDLS) |
|
|
678
|
+
| `type_text` | String | Human-readable type (Table, CDS View) |
|
|
679
|
+
| `row_count` | Integer | Number of rows returned |
|
|
680
|
+
| `total_rows` | Integer | Total rows available (before limit) |
|
|
681
|
+
| `rows` | Array | Array of row objects with field:value pairs |
|
|
682
|
+
| `fields` | Array | Field metadata (field, type, length, decimals) |
|
|
683
|
+
| `columns_displayed` | Integer | Number of columns in output |
|
|
684
|
+
| `columns_hidden` | Array | Column names not displayed (if limited) |
|
|
685
|
+
| `error` | String | Error message (empty if success) |
|
|
686
|
+
|
|
509
687
|
### Object Fields (for View)
|
|
510
688
|
|
|
511
689
|
| Field | Type | Description |
|
package/CLAUDE.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
This is the **abapgit-agent** CLI tool project - a Node.js application for pulling and activating ABAP code from git repositories.
|
|
4
4
|
|
|
5
|
+
## Quick Reference
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Quick commands
|
|
9
|
+
abapgit-agent pull # Pull and activate all
|
|
10
|
+
abapgit-agent pull --files file.clas.abap # Pull specific file(s)
|
|
11
|
+
abapgit-agent inspect --files file.clas.abap # Syntax check
|
|
12
|
+
abapgit-agent unit --files test.clas.testclasses.abap # Run tests
|
|
13
|
+
abapgit-agent preview --objects TABLE # Preview table data
|
|
14
|
+
abapgit-agent view --objects OBJ # View object definition
|
|
15
|
+
abapgit-agent tree --package $PACKAGE # Show package hierarchy
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Common Tasks
|
|
19
|
+
|
|
20
|
+
**Making code changes:**
|
|
21
|
+
```bash
|
|
22
|
+
1. Edit ABAP file(s)
|
|
23
|
+
2. git add && git commit && git push
|
|
24
|
+
3. abapgit-agent pull --files file.clas.abap
|
|
25
|
+
4. Check for errors in output
|
|
26
|
+
5. If "Error updating where-used list" → use inspect for details
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Exploring unknown tables:**
|
|
30
|
+
```bash
|
|
31
|
+
abapgit-agent preview --objects SFLIGHT # See sample data
|
|
32
|
+
abapgit-agent view --objects SFLIGHT --type TABL # See structure
|
|
33
|
+
```
|
|
34
|
+
|
|
5
35
|
## Project Structure
|
|
6
36
|
|
|
7
37
|
```
|
|
@@ -83,6 +113,14 @@ abapgit-agent view --objects ZCL_MY_CLASS
|
|
|
83
113
|
abapgit-agent view --objects ZIF_MY_INTERFACE --type INTF
|
|
84
114
|
abapgit-agent view --objects ZCL_CLASS1,ZCL_CLASS2 --json
|
|
85
115
|
|
|
116
|
+
# Preview table/CDS view data
|
|
117
|
+
abapgit-agent preview --objects SFLIGHT
|
|
118
|
+
abapgit-agent preview --objects ZC_MY_CDS_VIEW --type DDLS
|
|
119
|
+
abapgit-agent preview --objects SFLIGHT --columns CARRID,CONNID,PRICE --limit 20
|
|
120
|
+
abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
|
|
121
|
+
abapgit-agent preview --objects SFLIGHT --vertical
|
|
122
|
+
abapgit-agent preview --objects SFLIGHT --compact
|
|
123
|
+
|
|
86
124
|
# Health check
|
|
87
125
|
abapgit-agent health
|
|
88
126
|
|
|
@@ -579,6 +617,148 @@ where devclass not like '$%'
|
|
|
579
617
|
| Object not found | `Object <name> not found` |
|
|
580
618
|
| Invalid object type | `Unsupported object type: <type>` |
|
|
581
619
|
|
|
620
|
+
## Preview Command
|
|
621
|
+
|
|
622
|
+
### Description
|
|
623
|
+
Preview data from ABAP tables or CDS views directly from the ABAP system. This command retrieves sample data rows to help developers understand table/view contents without needing to query manually.
|
|
624
|
+
|
|
625
|
+
**This is the PRIMARY way to explore table and CDS view DATA.**
|
|
626
|
+
|
|
627
|
+
### Usage
|
|
628
|
+
```bash
|
|
629
|
+
# Preview table data (auto-detect type)
|
|
630
|
+
abapgit-agent preview --objects SFLIGHT
|
|
631
|
+
|
|
632
|
+
# Preview CDS view data
|
|
633
|
+
abapgit-agent preview --objects ZC_MY_CDS_VIEW --type DDLS
|
|
634
|
+
|
|
635
|
+
# Preview with explicit type
|
|
636
|
+
abapgit-agent preview --objects SFLIGHT --type TABL
|
|
637
|
+
|
|
638
|
+
# Preview with row limit
|
|
639
|
+
abapgit-agent preview --objects SFLIGHT --limit 20
|
|
640
|
+
|
|
641
|
+
# Preview with WHERE clause filter
|
|
642
|
+
abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
|
|
643
|
+
|
|
644
|
+
# Preview specific columns only
|
|
645
|
+
abapgit-agent preview --objects SFLIGHT --columns CARRID,CONNID,FLDATE,PRICE
|
|
646
|
+
|
|
647
|
+
# Vertical format (for wide tables)
|
|
648
|
+
abapgit-agent preview --objects SFLIGHT --vertical
|
|
649
|
+
|
|
650
|
+
# JSON output (for scripting/AI processing)
|
|
651
|
+
abapgit-agent preview --objects SFLIGHT --json
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
### Parameters
|
|
655
|
+
|
|
656
|
+
| Parameter | Required | Description |
|
|
657
|
+
|-----------|----------|-------------|
|
|
658
|
+
| `--objects` | Yes | Comma-separated list of table/view names |
|
|
659
|
+
| `--type` | No | Object type (TABL, DDLS). Auto-detected from TADIR if not specified |
|
|
660
|
+
| `--limit` | No | Maximum rows to return (default: 10, max: 100) |
|
|
661
|
+
| `--where` | No | WHERE clause filter (e.g., `CARRID = 'AA'`) |
|
|
662
|
+
| `--columns` | No | Comma-separated column names to display |
|
|
663
|
+
| `--vertical` | No | Show data in vertical format (one field per line) |
|
|
664
|
+
| `--compact` | No | Truncate values to fit columns |
|
|
665
|
+
| `--json` | No | Output raw JSON only |
|
|
666
|
+
|
|
667
|
+
### Output
|
|
668
|
+
|
|
669
|
+
**Default (first 6 columns shown with indicator):**
|
|
670
|
+
```
|
|
671
|
+
📊 Preview: SFLIGHT (Table)
|
|
672
|
+
|
|
673
|
+
┌──────────┬────────┬──────────┬───────────┬─────────┬─────────┐
|
|
674
|
+
│ CARRID │ CONNID │ FLDATE │ PRICE │ CURRENCY│ PLANETYPE│
|
|
675
|
+
├──────────┼────────┼──────────┼───────────┼─────────┼─────────┤
|
|
676
|
+
│ AA │ 0017 │ 20240201 │ 422.94 │ USD │ 747-400 │
|
|
677
|
+
│ AA │ 0017 │ 20240202 │ 422.94 │ USD │ 747-400 │
|
|
678
|
+
└──────────┴────────┴──────────┴───────────┴─────────┴─────────┘
|
|
679
|
+
|
|
680
|
+
Showing 2 of 10 rows
|
|
681
|
+
⚠️ Note: 3 more columns hidden (SEATSMAX, SEATSOCC, PAYMENTSUM)
|
|
682
|
+
Use --columns to select specific columns
|
|
683
|
+
Use --json for full data
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
**With WHERE Filter:**
|
|
687
|
+
```
|
|
688
|
+
📊 Preview: SFLIGHT (filtered)
|
|
689
|
+
|
|
690
|
+
┌──────────┬────────┬──────────┬─────────┐
|
|
691
|
+
│ CARRID │ CONNID │ FLDATE │ PRICE │
|
|
692
|
+
├──────────┼────────┼──────────┼─────────┤
|
|
693
|
+
│ AA │ 0017 │ 20240201 │ 422.94 │
|
|
694
|
+
│ AA │ 0017 │ 20240202 │ 422.94 │
|
|
695
|
+
└──────────┴────────┴──────────┴─────────┘
|
|
696
|
+
|
|
697
|
+
WHERE: CARRID = 'AA'
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
**Vertical Format (for wide tables):**
|
|
701
|
+
```
|
|
702
|
+
📊 Preview: SFLIGHT (1 of 10 rows, vertical)
|
|
703
|
+
|
|
704
|
+
Row 1:
|
|
705
|
+
────────────────────────────────────────────────────────────
|
|
706
|
+
CARRID: AA
|
|
707
|
+
CONNID: 0017
|
|
708
|
+
FLDATE: 20240201
|
|
709
|
+
PRICE: 422.94
|
|
710
|
+
CURRENCY: USD
|
|
711
|
+
PLANETYPE: 747-400
|
|
712
|
+
SEATSMAX: 400
|
|
713
|
+
SEATSOCC: 350
|
|
714
|
+
PAYMENTSUM: 145000
|
|
715
|
+
────────────────────────────────────────────────────────────
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
### JSON Output
|
|
719
|
+
```json
|
|
720
|
+
{
|
|
721
|
+
"SUCCESS": true,
|
|
722
|
+
"COMMAND": "PREVIEW",
|
|
723
|
+
"OBJECTS": [
|
|
724
|
+
{
|
|
725
|
+
"NAME": "SFLIGHT",
|
|
726
|
+
"TYPE": "TABL",
|
|
727
|
+
"TYPE_TEXT": "Table",
|
|
728
|
+
"ROW_COUNT": 2,
|
|
729
|
+
"TOTAL_ROWS": 10,
|
|
730
|
+
"ROWS": [
|
|
731
|
+
{ "CARRID": "AA", "CONNID": "0017", "FLDATE": "20240201", "PRICE": "422.94", ... }
|
|
732
|
+
],
|
|
733
|
+
"FIELDS": [
|
|
734
|
+
{ "FIELD": "CARRID", "TYPE": "CHAR", "LENGTH": 3 },
|
|
735
|
+
{ "FIELD": "PRICE", "TYPE": "CURR", "LENGTH": 16 }
|
|
736
|
+
],
|
|
737
|
+
"COLUMNS_DISPLAYED": 6,
|
|
738
|
+
"COLUMNS_HIDDEN": ["SEATSMAX", "SEATSOCC", "PAYMENTSUM"]
|
|
739
|
+
}
|
|
740
|
+
],
|
|
741
|
+
"SUMMARY": { "TOTAL_OBJECTS": 1, "TOTAL_ROWS": 2 },
|
|
742
|
+
"ERROR": ""
|
|
743
|
+
}
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
### Error Handling
|
|
747
|
+
|
|
748
|
+
| Error | Message |
|
|
749
|
+
|-------|---------|
|
|
750
|
+
| Table not found | `Table not found: Z_NONEXISTENT` |
|
|
751
|
+
| CDS View not found | `CDS View not found: Z_NONEXISTENT` |
|
|
752
|
+
| Access denied | `Access denied to table: SFLIGHT` |
|
|
753
|
+
| Invalid WHERE clause | `Invalid WHERE clause: <reason>` |
|
|
754
|
+
|
|
755
|
+
### Auto-Detection Rules
|
|
756
|
+
|
|
757
|
+
| Object Name Pattern | Default Type |
|
|
758
|
+
|---------------------|--------------|
|
|
759
|
+
| `ZC_*` or `zc_*` | DDLS (CDS View) |
|
|
760
|
+
| Other | TABL (Table) |
|
|
761
|
+
|
|
582
762
|
## Status Check
|
|
583
763
|
|
|
584
764
|
### Description
|
|
@@ -642,6 +822,28 @@ export GIT_USERNAME="git-username"
|
|
|
642
822
|
export GIT_PASSWORD="git-token"
|
|
643
823
|
```
|
|
644
824
|
|
|
825
|
+
## Troubleshooting
|
|
826
|
+
|
|
827
|
+
**Pull fails with "Error updating where-used list":**
|
|
828
|
+
- This means SYNTAX ERROR in the object
|
|
829
|
+
- Run `abapgit-agent inspect --files <file>` for detailed errors
|
|
830
|
+
|
|
831
|
+
**Pull shows "Failed Objects" > 0:**
|
|
832
|
+
- Objects failed to activate - check the error messages
|
|
833
|
+
- Fix syntax errors and pull again
|
|
834
|
+
|
|
835
|
+
**Preview/View command fails:**
|
|
836
|
+
- Check table/view exists in the ABAP system
|
|
837
|
+
- Verify credentials in `.abapGitAgent`
|
|
838
|
+
|
|
839
|
+
**"Table or view not found":**
|
|
840
|
+
- Table may not exist or may have different name
|
|
841
|
+
- Use `view` command to check available tables
|
|
842
|
+
|
|
843
|
+
**Terminal width issues with preview:**
|
|
844
|
+
- Use `--columns` to specify exact columns
|
|
845
|
+
- Use `--vertical` for wide tables
|
|
846
|
+
|
|
645
847
|
## Development Workflow
|
|
646
848
|
|
|
647
849
|
### Exploring Unknown ABAP Objects
|
package/INSTALL.md
CHANGED
|
@@ -12,17 +12,12 @@ Claude (VS Code) → CLI Tool → ABAP System (REST/HTTP)
|
|
|
12
12
|
|
|
13
13
|
### ABAP Side - REST Implementation
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
| `zcl_abgagt_resource_inspect.clas.abap` | Class | POST /inspect handler |
|
|
22
|
-
| `zcl_abgagt_resource_unit.clas.abap` | Class | POST /unit handler |
|
|
23
|
-
| `zcl_abgagt_resource_health.clas.abap` | Class | GET /health handler |
|
|
24
|
-
|
|
25
|
-
**Note:** Error details are returned directly in the REST response via `error_detail` field.
|
|
15
|
+
The ABAP backend consists of:
|
|
16
|
+
- **Main agent** - Core logic for pull, inspect, unit operations
|
|
17
|
+
- **REST handler** - Routes HTTP requests to appropriate resources
|
|
18
|
+
- **Resource handlers** - Individual endpoints (/pull, /inspect, /unit, /tree, /view, /preview, /health)
|
|
19
|
+
|
|
20
|
+
Deploy all ABAP objects using abapGit from the `/abap` folder.
|
|
26
21
|
|
|
27
22
|
### CLI Tool (Node.js)
|
|
28
23
|
- REST client for ABAP communication
|
package/README.md
CHANGED
|
@@ -104,6 +104,15 @@ abapgit-agent tree --package $MY_PACKAGE
|
|
|
104
104
|
abapgit-agent view --objects ZCL_MY_CLASS
|
|
105
105
|
abapgit-agent view --objects SFLIGHT --type TABL
|
|
106
106
|
abapgit-agent view --objects S_CARR_ID --type DTEL
|
|
107
|
+
|
|
108
|
+
# Preview table or CDS view data
|
|
109
|
+
abapgit-agent preview --objects SFLIGHT
|
|
110
|
+
abapgit-agent preview --objects ZC_MY_CDS_VIEW --type DDLS
|
|
111
|
+
abapgit-agent preview --objects SFLIGHT --limit 20
|
|
112
|
+
abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
|
|
113
|
+
abapgit-agent preview --objects SFLIGHT --columns CARRID,CONNID,PRICE
|
|
114
|
+
abapgit-agent preview --objects SFLIGHT --vertical
|
|
115
|
+
abapgit-agent preview --objects SFLIGHT --compact
|
|
107
116
|
```
|
|
108
117
|
|
|
109
118
|
### Utility Commands
|
|
@@ -143,6 +152,7 @@ npm run pull -- --url <git-url> --branch main
|
|
|
143
152
|
| unit Command | [docs/unit-command.md](docs/unit-command.md) |
|
|
144
153
|
| tree Command | [docs/tree-command.md](docs/tree-command.md) |
|
|
145
154
|
| view Command | [docs/view-command.md](docs/view-command.md) |
|
|
155
|
+
| preview Command | [docs/preview-command.md](docs/preview-command.md) |
|
|
146
156
|
| REST API Reference | [API.md](API.md) |
|
|
147
157
|
| Error Handling | [ERROR_HANDLING.md](ERROR_HANDLING.md) |
|
|
148
158
|
| ABAP Coding Guidelines | [abap/CLAUDE.md](abap/CLAUDE.md) |
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## v1.4.0
|
|
4
|
+
|
|
5
|
+
### New Features
|
|
6
|
+
|
|
7
|
+
#### preview Command
|
|
8
|
+
Preview data from ABAP tables or CDS views directly from the ABAP system:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# Preview table data (auto-detect type)
|
|
12
|
+
abapgit-agent preview --objects SFLIGHT
|
|
13
|
+
|
|
14
|
+
# Preview CDS view data
|
|
15
|
+
abapgit-agent preview --objects ZC_MY_CDS_VIEW --type DDLS
|
|
16
|
+
|
|
17
|
+
# Preview with row limit
|
|
18
|
+
abapgit-agent preview --objects SFLIGHT --limit 20
|
|
19
|
+
|
|
20
|
+
# Preview with WHERE clause filter
|
|
21
|
+
abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
|
|
22
|
+
|
|
23
|
+
# Preview specific columns only
|
|
24
|
+
abapgit-agent preview --objects SFLIGHT --columns CARRID,CONNID,PRICE
|
|
25
|
+
|
|
26
|
+
# Vertical format (for wide tables)
|
|
27
|
+
abapgit-agent preview --objects SFLIGHT --vertical
|
|
28
|
+
|
|
29
|
+
# Compact mode (truncated values)
|
|
30
|
+
abapgit-agent preview --objects SFLIGHT --compact
|
|
31
|
+
|
|
32
|
+
# JSON output
|
|
33
|
+
abapgit-agent preview --objects SFLIGHT --json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Documentation
|
|
37
|
+
|
|
38
|
+
- Added comprehensive docs/preview-command.md
|
|
39
|
+
- Updated API.md with /preview endpoint
|
|
40
|
+
- Updated IMPLEMENTATION_PLAN.md with tree, view, preview commands
|
|
41
|
+
- Simplified INSTALL.md ABAP components section
|
|
42
|
+
- Updated README.md with preview command examples
|
|
43
|
+
- Improved CLAUDE.md files with best practices
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
3
47
|
## v1.3.0
|
|
4
48
|
|
|
5
49
|
### New Features
|
package/abap/CLAUDE.md
CHANGED
|
@@ -4,6 +4,30 @@ This file provides guidelines for **generating ABAP code** in abapGit repositori
|
|
|
4
4
|
|
|
5
5
|
**Use this file as a template**: Copy it to your ABAP repository root when setting up new projects with Claude Code.
|
|
6
6
|
|
|
7
|
+
## Quick Reference
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# After editing ABAP files:
|
|
11
|
+
git add . && git commit -m "feat: description" && git push
|
|
12
|
+
abapgit-agent pull --files abap/zcl_my_class.clas.abap
|
|
13
|
+
|
|
14
|
+
# If pull fails with syntax error:
|
|
15
|
+
abapgit-agent inspect --files abap/zcl_my_class.clas.abap
|
|
16
|
+
|
|
17
|
+
# Explore tables/views:
|
|
18
|
+
abapgit-agent preview --objects ZTABLE
|
|
19
|
+
abapgit-agent view --objects ZTABLE --type TABL
|
|
20
|
+
abapgit-agent tree --package $MY_PACKAGE
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Common Workflow
|
|
24
|
+
|
|
25
|
+
1. Generate/edit ABAP code
|
|
26
|
+
2. Push to git: `git add . && git commit && git push`
|
|
27
|
+
3. Activate in ABAP: `abapgit-agent pull --files file.clas.abap`
|
|
28
|
+
4. Check for errors - fix if needed
|
|
29
|
+
5. Repeat
|
|
30
|
+
|
|
7
31
|
## ABAP Syntax Validation
|
|
8
32
|
|
|
9
33
|
This is an ABAP project. **Do not attempt local syntax validation** - ABAP code can only be validated in an SAP system.
|
|
@@ -214,6 +238,112 @@ DATA ELEMENT ZMY_DTEL:
|
|
|
214
238
|
Key Definition: WITH KEY
|
|
215
239
|
```
|
|
216
240
|
|
|
241
|
+
## CLI Commands Reference
|
|
242
|
+
|
|
243
|
+
This section documents the available CLI commands for ABAP development.
|
|
244
|
+
|
|
245
|
+
### Pull Command
|
|
246
|
+
|
|
247
|
+
Pull and activate ABAP objects from git repository.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Pull all files
|
|
251
|
+
abapgit-agent pull
|
|
252
|
+
|
|
253
|
+
# Pull specific files (faster)
|
|
254
|
+
abapgit-agent pull --files abap/zcl_my_class.clas.abap
|
|
255
|
+
|
|
256
|
+
# Pull with transport request
|
|
257
|
+
abapgit-agent pull --files abap/zcl_my_class.clas.abap --transport DEVK900001
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Inspect Command
|
|
261
|
+
|
|
262
|
+
Run syntax check on ABAP objects.
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
# Syntax check single file
|
|
266
|
+
abapgit-agent inspect --files abap/zcl_my_class.clas.abap
|
|
267
|
+
|
|
268
|
+
# Syntax check multiple files
|
|
269
|
+
abapgit-agent inspect --files abap/zcl_class1.clas.abap,abap/zcl_class2.clas.abap
|
|
270
|
+
|
|
271
|
+
# Syntax check CDS view
|
|
272
|
+
abapgit-agent inspect --files abap/zc_my_view.ddls.asddls
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Unit Command
|
|
276
|
+
|
|
277
|
+
Run ABAP unit tests.
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Run unit tests for test class
|
|
281
|
+
abapgit-agent unit --files abap/zcl_my_test.clas.testclasses.abap
|
|
282
|
+
|
|
283
|
+
# Run unit tests for package
|
|
284
|
+
abapgit-agent unit --package $MY_PACKAGE
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Tree Command
|
|
288
|
+
|
|
289
|
+
Display package hierarchy.
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
# Display package tree
|
|
293
|
+
abapgit-agent tree --package $MY_PACKAGE
|
|
294
|
+
|
|
295
|
+
# With object counts
|
|
296
|
+
abapgit-agent tree --package $MY_PACKAGE --include-objects
|
|
297
|
+
|
|
298
|
+
# JSON output
|
|
299
|
+
abapgit-agent tree --package $MY_PACKAGE --json
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### View Command
|
|
303
|
+
|
|
304
|
+
View ABAP object definitions directly from the system.
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
# View table structure
|
|
308
|
+
abapgit-agent view --objects ZMY_TABLE --type TABL
|
|
309
|
+
|
|
310
|
+
# View class definition
|
|
311
|
+
abapgit-agent view --objects ZCL_MY_CLASS
|
|
312
|
+
|
|
313
|
+
# View CDS view
|
|
314
|
+
abapgit-agent view --objects ZC_MY_CDS_VIEW --type DDLS
|
|
315
|
+
|
|
316
|
+
# JSON output
|
|
317
|
+
abapgit-agent view --objects ZCL_MY_CLASS --json
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Preview Command
|
|
321
|
+
|
|
322
|
+
Preview data from tables or CDS views.
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# Preview table data
|
|
326
|
+
abapgit-agent preview --objects SFLIGHT
|
|
327
|
+
|
|
328
|
+
# Preview with row limit
|
|
329
|
+
abapgit-agent preview --objects SFLIGHT --limit 5
|
|
330
|
+
|
|
331
|
+
# Preview with WHERE filter
|
|
332
|
+
abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
|
|
333
|
+
|
|
334
|
+
# Preview specific columns
|
|
335
|
+
abapgit-agent preview --objects SFLIGHT --columns CARRID,PRICE,FLDATE
|
|
336
|
+
|
|
337
|
+
# Vertical format (for wide tables)
|
|
338
|
+
abapgit-agent preview --objects SFLIGHT --vertical
|
|
339
|
+
|
|
340
|
+
# Compact mode (truncated values)
|
|
341
|
+
abapgit-agent preview --objects SFLIGHT --compact
|
|
342
|
+
|
|
343
|
+
# JSON output
|
|
344
|
+
abapgit-agent preview --objects SFLIGHT --json
|
|
345
|
+
```
|
|
346
|
+
|
|
217
347
|
## JSON Handling - ALWAYS Use /ui2/cl_json
|
|
218
348
|
|
|
219
349
|
**CRITICAL**: Always use `/ui2/cl_json` for JSON serialization and deserialization.
|
|
@@ -29,6 +29,7 @@ CLASS zcl_abgagt_cmd_factory IMPLEMENTATION.
|
|
|
29
29
|
( command = zif_abgagt_command=>gc_import class_name = 'ZCL_ABGAGT_COMMAND_IMPORT' )
|
|
30
30
|
( command = zif_abgagt_command=>gc_tree class_name = 'ZCL_ABGAGT_COMMAND_TREE' )
|
|
31
31
|
( command = zif_abgagt_command=>gc_view class_name = 'ZCL_ABGAGT_COMMAND_VIEW' )
|
|
32
|
+
( command = zif_abgagt_command=>gc_preview class_name = 'ZCL_ABGAGT_COMMAND_PREVIEW' )
|
|
32
33
|
).
|
|
33
34
|
ENDMETHOD.
|
|
34
35
|
|