abapgit-agent 1.5.0 → 1.6.1

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 (119) hide show
  1. package/README.md +1 -0
  2. package/abap/guidelines/00_index.md +36 -0
  3. package/abap/guidelines/01_sql.md +88 -0
  4. package/abap/guidelines/02_exceptions.md +176 -0
  5. package/abap/guidelines/03_testing.md +269 -0
  6. package/abap/guidelines/04_cds.md +136 -0
  7. package/abap/guidelines/05_classes.md +58 -0
  8. package/abap/guidelines/06_objects.md +110 -0
  9. package/abap/guidelines/07_json.md +24 -0
  10. package/abap/guidelines/08_abapgit.md +222 -0
  11. package/abap/guidelines/09_unit_testable_code.md +568 -0
  12. package/bin/abapgit-agent +513 -38
  13. package/bin/abgagt +24 -0
  14. package/package.json +8 -2
  15. package/src/abap-client.js +65 -2
  16. package/src/agent.js +57 -3
  17. package/src/config.js +1 -1
  18. package/src/ref-search.js +1037 -0
  19. package/.abapGitAgent.example +0 -11
  20. package/.github/workflows/release.yml +0 -60
  21. package/API.md +0 -710
  22. package/CLAUDE.md +0 -1058
  23. package/CLAUDE_MEM.md +0 -88
  24. package/ERROR_HANDLING.md +0 -30
  25. package/INSTALL.md +0 -155
  26. package/RELEASE_NOTES.md +0 -143
  27. package/abap/CLAUDE.md +0 -1010
  28. package/abap/copilot-instructions.md +0 -79
  29. package/abap/package.devc.xml +0 -10
  30. package/abap/zcl_abgagt_agent.clas.abap +0 -420
  31. package/abap/zcl_abgagt_agent.clas.xml +0 -15
  32. package/abap/zcl_abgagt_cmd_factory.clas.abap +0 -48
  33. package/abap/zcl_abgagt_cmd_factory.clas.xml +0 -15
  34. package/abap/zcl_abgagt_command_create.clas.abap +0 -95
  35. package/abap/zcl_abgagt_command_create.clas.xml +0 -15
  36. package/abap/zcl_abgagt_command_import.clas.abap +0 -138
  37. package/abap/zcl_abgagt_command_import.clas.xml +0 -15
  38. package/abap/zcl_abgagt_command_inspect.clas.abap +0 -456
  39. package/abap/zcl_abgagt_command_inspect.clas.testclasses.abap +0 -121
  40. package/abap/zcl_abgagt_command_inspect.clas.xml +0 -16
  41. package/abap/zcl_abgagt_command_preview.clas.abap +0 -386
  42. package/abap/zcl_abgagt_command_preview.clas.xml +0 -15
  43. package/abap/zcl_abgagt_command_pull.clas.abap +0 -80
  44. package/abap/zcl_abgagt_command_pull.clas.testclasses.abap +0 -87
  45. package/abap/zcl_abgagt_command_pull.clas.xml +0 -16
  46. package/abap/zcl_abgagt_command_tree.clas.abap +0 -237
  47. package/abap/zcl_abgagt_command_tree.clas.xml +0 -15
  48. package/abap/zcl_abgagt_command_unit.clas.abap +0 -297
  49. package/abap/zcl_abgagt_command_unit.clas.xml +0 -15
  50. package/abap/zcl_abgagt_command_view.clas.abap +0 -240
  51. package/abap/zcl_abgagt_command_view.clas.xml +0 -15
  52. package/abap/zcl_abgagt_resource_create.clas.abap +0 -71
  53. package/abap/zcl_abgagt_resource_create.clas.xml +0 -15
  54. package/abap/zcl_abgagt_resource_health.clas.abap +0 -25
  55. package/abap/zcl_abgagt_resource_health.clas.xml +0 -15
  56. package/abap/zcl_abgagt_resource_import.clas.abap +0 -66
  57. package/abap/zcl_abgagt_resource_import.clas.xml +0 -15
  58. package/abap/zcl_abgagt_resource_inspect.clas.abap +0 -63
  59. package/abap/zcl_abgagt_resource_inspect.clas.xml +0 -15
  60. package/abap/zcl_abgagt_resource_preview.clas.abap +0 -67
  61. package/abap/zcl_abgagt_resource_preview.clas.xml +0 -15
  62. package/abap/zcl_abgagt_resource_pull.clas.abap +0 -71
  63. package/abap/zcl_abgagt_resource_pull.clas.xml +0 -15
  64. package/abap/zcl_abgagt_resource_tree.clas.abap +0 -70
  65. package/abap/zcl_abgagt_resource_tree.clas.xml +0 -15
  66. package/abap/zcl_abgagt_resource_unit.clas.abap +0 -64
  67. package/abap/zcl_abgagt_resource_unit.clas.xml +0 -15
  68. package/abap/zcl_abgagt_resource_view.clas.abap +0 -68
  69. package/abap/zcl_abgagt_resource_view.clas.xml +0 -15
  70. package/abap/zcl_abgagt_rest_handler.clas.abap +0 -32
  71. package/abap/zcl_abgagt_rest_handler.clas.xml +0 -15
  72. package/abap/zcl_abgagt_util.clas.abap +0 -93
  73. package/abap/zcl_abgagt_util.clas.testclasses.abap +0 -84
  74. package/abap/zcl_abgagt_util.clas.xml +0 -16
  75. package/abap/zcl_abgagt_viewer_clas.clas.abap +0 -58
  76. package/abap/zcl_abgagt_viewer_clas.clas.xml +0 -15
  77. package/abap/zcl_abgagt_viewer_ddls.clas.abap +0 -83
  78. package/abap/zcl_abgagt_viewer_ddls.clas.xml +0 -15
  79. package/abap/zcl_abgagt_viewer_dtel.clas.abap +0 -98
  80. package/abap/zcl_abgagt_viewer_dtel.clas.xml +0 -15
  81. package/abap/zcl_abgagt_viewer_factory.clas.abap +0 -41
  82. package/abap/zcl_abgagt_viewer_factory.clas.xml +0 -15
  83. package/abap/zcl_abgagt_viewer_intf.clas.abap +0 -58
  84. package/abap/zcl_abgagt_viewer_intf.clas.xml +0 -15
  85. package/abap/zcl_abgagt_viewer_stru.clas.abap +0 -59
  86. package/abap/zcl_abgagt_viewer_stru.clas.xml +0 -15
  87. package/abap/zcl_abgagt_viewer_tabl.clas.abap +0 -59
  88. package/abap/zcl_abgagt_viewer_tabl.clas.xml +0 -15
  89. package/abap/zcl_abgagt_viewer_ttyp.clas.abap +0 -93
  90. package/abap/zcl_abgagt_viewer_ttyp.clas.xml +0 -15
  91. package/abap/zif_abgagt_agent.intf.abap +0 -53
  92. package/abap/zif_abgagt_agent.intf.xml +0 -15
  93. package/abap/zif_abgagt_cmd_factory.intf.abap +0 -7
  94. package/abap/zif_abgagt_cmd_factory.intf.xml +0 -15
  95. package/abap/zif_abgagt_command.intf.abap +0 -26
  96. package/abap/zif_abgagt_command.intf.xml +0 -15
  97. package/abap/zif_abgagt_util.intf.abap +0 -28
  98. package/abap/zif_abgagt_util.intf.xml +0 -15
  99. package/abap/zif_abgagt_viewer.intf.abap +0 -12
  100. package/abap/zif_abgagt_viewer.intf.xml +0 -15
  101. package/docs/commands.md +0 -142
  102. package/docs/create-command.md +0 -129
  103. package/docs/health-command.md +0 -89
  104. package/docs/import-command.md +0 -195
  105. package/docs/init-command.md +0 -189
  106. package/docs/inspect-command.md +0 -169
  107. package/docs/list-command.md +0 -289
  108. package/docs/preview-command.md +0 -528
  109. package/docs/pull-command.md +0 -202
  110. package/docs/status-command.md +0 -68
  111. package/docs/tree-command.md +0 -303
  112. package/docs/unit-command.md +0 -167
  113. package/docs/view-command.md +0 -501
  114. package/img/claude.png +0 -0
  115. package/scripts/claude-integration.js +0 -351
  116. package/scripts/release.js +0 -298
  117. package/scripts/release.sh +0 -60
  118. package/scripts/test-integration.js +0 -139
  119. package/scripts/unrelease.js +0 -277
package/CLAUDE.md DELETED
@@ -1,1058 +0,0 @@
1
- # ABAP Git Agent - CLI Tool Development
2
-
3
- This is the **abapgit-agent** CLI tool project - a Node.js application for pulling and activating ABAP code from git repositories.
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
-
35
- ## Project Structure
36
-
37
- ```
38
- abapgit-agent/
39
- ├── bin/
40
- │ └── abapgit-agent # CLI entry point
41
- ├── src/
42
- │ ├── agent.js # Main agent class
43
- │ ├── abap-client.js # REST client for ABAP communication
44
- │ ├── config.js # Configuration management
45
- │ ├── server.js # HTTP server
46
- │ └── logger.js # Logging utilities
47
- ├── abap/ # ABAP backend components
48
- │ ├── zcl_abapgit_agent*.clas.abap # Main agent class
49
- │ ├── zif_abapgit_agent.intf.abap # Agent interface
50
- │ ├── zcl_abgagt_cmd_factory.clas.abap # Command factory
51
- │ ├── zcl_abgagt_command_*.clas.abap # Command implementations
52
- │ ├── zif_abgagt_command.intf.abap # Command interface
53
- │ ├── zcl_abgagt_resource_*.clas.abap # REST resource handlers
54
- │ └── CLAUDE.md # ABAP project guidelines
55
- └── tests/
56
- ```
57
-
58
- ## ABAP Architecture
59
-
60
- ### Call Stack
61
- ```
62
- CLI (bin/abapgit-agent)
63
-
64
- REST Client (src/abap-client.js)
65
-
66
- ABAP REST Handler (ZCL_ABGAGT_REST_HANDLER)
67
-
68
- Resource: ZCL_ABGAGT_RESOURCE_PULL → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_PULL → ZCL_ABGAGT_AGENT
69
- Resource: ZCL_ABGAGT_RESOURCE_INSPECT → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_INSPECT → ZCL_ABGAGT_AGENT
70
- Resource: ZCL_ABGAGT_RESOURCE_UNIT → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_UNIT → ZCL_ABGAGT_AGENT
71
- Resource: ZCL_ABGAGT_RESOURCE_TREE → ZCL_ABGAGT_CMD_FACTORY → ZCL_ABGAGT_COMMAND_TREE → ZCL_ABGAGT_AGENT
72
- ```
73
-
74
- ### ABAP Objects
75
-
76
- | Object | Description |
77
- |--------|-------------|
78
- | `ZCL_ABGAGT_AGENT` | Main agent - handles pull, inspect, unit operations |
79
- | `ZCL_ABGAGT_CMD_FACTORY` | Command factory - creates command instances dynamically |
80
- | `ZCL_ABGAGT_COMMAND_PULL` | Pull command - implements ZIF_ABGAGT_COMMAND |
81
- | `ZCL_ABGAGT_COMMAND_INSPECT` | Inspect command - implements ZIF_ABGAGT_COMMAND |
82
- | `ZCL_ABGAGT_COMMAND_UNIT` | Unit command - implements ZIF_ABGAGT_COMMAND |
83
- | `ZCL_ABGAGT_COMMAND_TREE` | Tree command - displays package hierarchy |
84
- | `ZIF_ABGAGT_COMMAND` | Command interface with constants |
85
- | `ZIF_ABGAGT_CMD_FACTORY` | Factory interface |
86
-
87
- ## CLI Commands
88
-
89
- ```bash
90
- # Pull and activate from current git repo
91
- abapgit-agent pull
92
-
93
- # Pull specific files only (fast - recommended for iterative development)
94
- abapgit-agent pull --files <file1>,<file2>,...
95
-
96
- # Pull from specific branch
97
- abapgit-agent pull --branch <branch>
98
-
99
- # Pull from specific URL
100
- abapgit-agent pull --url <git-url>
101
-
102
- # Syntax check an ABAP file (IMPORTANT for debugging activation errors)
103
- abapgit-agent inspect --files abap/zcl_my_class.clas.abap
104
-
105
- # Run unit tests for ABAP test classes
106
- abapgit-agent unit --files abap/zcl_my_test.clas.testclasses.abap
107
-
108
- # Display package hierarchy tree
109
- abapgit-agent tree --package $MY_PACKAGE
110
-
111
- # View ABAP object definitions from ABAP system
112
- abapgit-agent view --objects ZCL_MY_CLASS
113
- abapgit-agent view --objects ZIF_MY_INTERFACE --type INTF
114
- abapgit-agent view --objects ZCL_CLASS1,ZCL_CLASS2 --json
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
-
124
- # Health check
125
- abapgit-agent health
126
-
127
- # Check configuration
128
- abapgit-agent status
129
- ```
130
- Note: All ABAP commands automatically check CLI/ABAP API version compatibility.
131
-
132
- ## Pull Command
133
-
134
- ### Description
135
- Pull and activate ABAP objects from git repository.
136
-
137
- ### Rule: Pull All Changed Files Together
138
-
139
- **CRITICAL**: When multiple ABAP files are changed, pull them ALL together in a single command:
140
-
141
- ```bash
142
- # WRONG - Pull files one by one (may cause activation issues)
143
- abapgit-agent pull --files zcl_class1.clas.abap
144
- abapgit-agent pull --files zcl_class2.clas.abap
145
- abapgit-agent pull --files zif_interface1.intf.abap
146
-
147
- # CORRECT - Pull all changed files together
148
- abapgit-agent pull --files zcl_class1.clas.abap,zcl_class2.clas.abap,zif_interface1.intf.abap
149
- ```
150
-
151
- **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.
152
-
153
- ### Usage
154
- ```bash
155
- # Auto-detect git remote and branch from current directory
156
- abapgit-agent pull
157
-
158
- # Pull specific files only
159
- abapgit-agent pull --files zcl_my_class.clas.abap,zif_my_intf.intf.abap
160
-
161
- # Pull from specific branch
162
- abapgit-agent pull --branch develop
163
-
164
- # Pull from specific URL (useful for CI/CD)
165
- abapgit-agent pull --url https://github.com/org/my-repo.git
166
-
167
- # Combined options
168
- abapgit-agent pull --branch develop --files src/zcl_my_class.clas.abap
169
- ```
170
-
171
- ### File Format
172
- Files are parsed to extract `(obj_type, obj_name)`:
173
- - `zcl_my_class.clas.abap` → CLAS, ZCL_MY_CLASS
174
- - `zif_my_intf.intf.abap` → INTF, ZIF_MY_INTF
175
- - `src/zcl_my_class.clas.abap` → CLAS, ZCL_MY_CLASS (subdirectory support)
176
-
177
- ### Output
178
- ```
179
- ✅ Pull completed successfully!
180
- Job ID: CAIS20260208115649
181
- Message: Pull completed successfully
182
-
183
- 📋 Pull Log (N messages):
184
- ───────────────────────────────────────────────────────────────────────────────
185
- Icon │ Object │ Message
186
- ...
187
-
188
- 📦 Activated Objects (N):
189
- ───────────────────────────────────────────────────────────────────────────────
190
- ✅ CLAS ZCL_MY_CLASS
191
- ...
192
-
193
- ❌ Failed Objects Log (M entries):
194
- ───────────────────────────────────────────────────────────────────────────────
195
- ❌ CLAS ZCL_MY_CLASS: Error message text
196
- Exception: Exception details
197
- ```
198
-
199
- ### Key Behaviors
200
- 1. **Activated Objects** - Only includes objects that completed successfully (no errors in log)
201
- 2. **Failed Objects Log** - Shows all error messages (duplicates allowed for multiple errors per object)
202
- 3. **Error Details** - When errors occur, displays error detail section at the top
203
-
204
- ## Health Check
205
-
206
- ### Description
207
- Check if the ABAP REST API is healthy.
208
-
209
- ### Usage
210
- ```bash
211
- abapgit-agent health
212
- ```
213
-
214
- ### Output
215
- ```json
216
- {
217
- "status": "healthy",
218
- "abap": "connected",
219
- "version": "1.0.0"
220
- }
221
- ```
222
-
223
- ## Inspect Command
224
-
225
- ### Description
226
- Run syntax check for ABAP objects. Supports both regular ABAP objects (classes, interfaces, programs) and CDS views (DDLS).
227
-
228
- ### Usage
229
- ```bash
230
- # Inspect single file
231
- abapgit-agent inspect --files abap/zcl_my_class.clas.abap
232
-
233
- # Inspect multiple files
234
- abapgit-agent inspect --files abap/zcl_class1.clas.abap,abap/zcl_class2.clas.abap
235
-
236
- # Inspect CDS view
237
- abapgit-agent inspect --files abap/zc_my_view.ddls.asddls
238
-
239
- # Inspect mixed file types (DDLS + CLAS)
240
- abapgit-agent inspect --files abap/zc_my_view.ddls.asddls,abap/zcl_my_class.clas.abap
241
-
242
- # Inspect with specific Code Inspector variant
243
- abapgit-agent inspect --files abap/zcl_my_class.clas.abap --variant ALL_CHECKS
244
-
245
- # Inspect with no variant (uses default SAP standard checks)
246
- abapgit-agent inspect --files abap/zcl_my_class.clas.abap --variant EMPTY
247
- ```
248
-
249
- ### Parameters
250
-
251
- | Parameter | Required | Description |
252
- |-----------|----------|-------------|
253
- | `--files` | Yes | Comma-separated list of ABAP files to inspect |
254
- | `--variant` | No | Code Inspector variant name (e.g., `ALL_CHECKS`, `EMPTY`) |
255
-
256
- ### Supported Object Types
257
-
258
- | Type | Description | Validation Method |
259
- |------|-------------|------------------|
260
- | CLAS | Class | Code Inspector (SCI) |
261
- | INTF | Interface | Code Inspector (SCI) |
262
- | PROG | Program | Code Inspector (SCI) |
263
- | FUGR | Function Group | Code Inspector (SCI) |
264
- | DDLS | CDS View/Entity | DDL Handler (CL_DD_DDL_HANDLER_FACTORY) |
265
-
266
- ### Output
267
-
268
- **Passed:**
269
- ```
270
- ✅ CLAS ZCL_MY_CLASS - Syntax check passed
271
- ```
272
-
273
- **With Warnings:**
274
- ```
275
- ⚠️ DDLS ZC_MY_VIEW - Syntax check passed with warnings (4):
276
-
277
- Warnings:
278
- ────────────────────────────────────────────────────────────
279
- Line 9 : ParentPackage
280
- Line 11 : SoftwareComponent
281
- ```
282
-
283
- **Failed:**
284
- ```
285
- ❌ DDLS ZC_MY_VIEW - Syntax check failed (1 error(s)):
286
-
287
- Errors:
288
- ────────────────────────────────────────────────────────────
289
- Line 21, Column 12: Error message text
290
- ```
291
-
292
- ### Key Behaviors
293
-
294
- 1. **Multiple files in one request** - All files are sent in a single API call for better performance
295
- 2. **CDS View validation** - Uses `CL_DD_DDL_HANDLER_FACTORY` to validate CDS views
296
- 3. **Check inactive version first** - For CDS views, checks the inactive version first (`get_state = 'M'`), then falls back to active version
297
- 4. **Detailed error messages** - Uses `get_errors()` and `get_warnings()` methods from the exception to get detailed information
298
- 5. **Per-object results** - Returns results for each object individually
299
-
300
- ### File Format
301
- Files are parsed to extract `(obj_type, obj_name)`:
302
- - `zcl_my_class.clas.abap` → CLAS, ZCL_MY_CLASS
303
- - `zc_my_view.ddls.asddls` → DDLS, ZC_MY_VIEW
304
-
305
- ## Unit Command
306
-
307
- ### Description
308
- Run AUnit tests for ABAP test classes and display detailed results including failed test methods with error messages.
309
-
310
- ### Usage
311
- ```bash
312
- # Run unit tests for a single test class file
313
- abapgit-agent unit --files abap/zcl_my_test.clas.testclasses.abap
314
-
315
- # Run unit tests for multiple test class files
316
- abapgit-agent unit --files abap/zcl_test1.clas.testclasses.abap,abap/zcl_test2.clas.testclasses.abap
317
-
318
- # Run unit tests for a specific package
319
- abapgit-agent unit --package $MY_PACKAGE
320
- ```
321
-
322
- ### File Format
323
- The command accepts test class files (`.clas.testclasses.abap`):
324
- - `zcl_my_test.clas.testclasses.abap` → CLAS, ZCL_MY_TEST
325
- - `src/tests/zcl_my_test.clas.testclasses.abap` → CLAS, ZCL_MY_TEST (with path)
326
-
327
- ### Output
328
- ```
329
- ✅ ZCL_MY_TEST - All tests passed
330
- Tests: 10 | Passed: 10 | Failed: 0
331
- ```
332
-
333
- When tests fail:
334
- ```
335
- ❌ ZCL_MY_TEST - Tests failed
336
- Tests: 10 | Passed: 8 | Failed: 2
337
- ✗ ZCL_MY_TEST=>TEST_METHOD_1: Error description
338
- ✗ ZCL_MY_TEST=>TEST_METHOD_2: Another error
339
-
340
- Failed Tests:
341
- ────────────────────────────────────────────────────────────────────────────────
342
- ✗ ZCL_MY_TEST=>TEST_METHOD_1
343
- Error: Expected X but got Y
344
- ```
345
-
346
- ### Error Details
347
- When a test fails, the output includes:
348
- - **Test Class**: The class containing the failed test
349
- - **Method**: The failed test method name (with `=>` notation)
350
- - **Error Kind**: Type of error (e.g., 'ERROR', 'FAILURE')
351
- - **Error Text**: Detailed error message from AUnit
352
-
353
- ### Response JSON Structure
354
- ```json
355
- {
356
- "success": "X",
357
- "message": "2 of 10 tests failed",
358
- "test_count": 10,
359
- "passed_count": 8,
360
- "failed_count": 2,
361
- "errors": [
362
- {
363
- "class_name": "ZCL_MY_TEST",
364
- "method_name": "TEST_METHOD_1",
365
- "error_kind": "ERROR",
366
- "error_text": "Expected X but got Y"
367
- }
368
- ]
369
- }
370
- ```
371
-
372
- ### Implementation
373
- The unit command uses `CL_SUT_AUNIT_RUNNER` to execute AUnit tests:
374
- - `CL_SUT_AUNIT_RUNNER=>S_CREATE` - Create test runner
375
- - `run()` - Execute tests
376
- - `str_results` - Get test statistics (cnt_testmethods, cnt_ok_methods, cnt_error_methods)
377
- - `tab_objects` - Get detailed results with nested structure:
378
- - `TAB_TESTCLASSES` → `TAB_METHODS` → `STR_ERROR` → `STR_ERROR_CORE`
379
-
380
- ## Tree Command
381
-
382
- ### Description
383
- Display the package hierarchy tree from an ABAP system, showing parent packages, sub-packages, and object counts.
384
-
385
- ### Usage
386
- ```bash
387
- # Basic usage
388
- abapgit-agent tree --package $MY_PACKAGE
389
-
390
- # With object breakdown by type
391
- abapgit-agent tree --package $MY_PACKAGE --include-objects
392
-
393
- # Limit depth (default: 3, max: 10)
394
- abapgit-agent tree --package $MY_PACKAGE --depth 2
395
-
396
- # JSON output for scripting
397
- abapgit-agent tree --package $MY_PACKAGE --json
398
- ```
399
-
400
- ### Parameters
401
-
402
- | Parameter | Required | Description |
403
- |-----------|----------|-------------|
404
- | `--package` | Yes | ABAP package name (e.g., `$ZMY_PACKAGE`, `ZMY_PACKAGE`) |
405
- | `--depth` | No | Maximum depth to traverse (default: 3, max: 10) |
406
- | `--include-objects` | No | Include object counts breakdown by type |
407
- | `--json` | No | Output raw JSON only (for scripting) |
408
-
409
- ### Output
410
-
411
- **Human-readable with AI metadata:**
412
- ```
413
- 🌳 Package Tree: $ZMAIN_PACKAGE
414
-
415
- 📦 $ZMAIN_PACKAGE (Main Package)
416
- ├─ 📦 $ZMAIN_SUB1 (Sub Package 1)
417
- │ ├─ 📦 $ZMAIN_SUB1_A (Sub Package 1A)
418
- │ └─ 📦 $ZMAIN_SUB1_B (Sub Package 1B)
419
- └─ 📦 $ZMAIN_SUB2 (Sub Package 2)
420
-
421
- 📊 Summary
422
- PACKAGES: 4
423
- OBJECTS: 127
424
-
425
- <!-- AI_METADATA_START -->
426
- {"package":"$ZMAIN_PACKAGE","parent":"$ZSAP_BASE","total_packages":4,"total_objects":127}
427
- <!-- AI_METADATA_END -->
428
- ```
429
-
430
- **With object breakdown:**
431
- ```
432
- 📊 Summary
433
- PACKAGES: 4
434
- OBJECTS: 127
435
- TYPES: CLAS=10 INTF=2 PROG=11 FUGR=1 TABL=3
436
- ```
437
-
438
- ### JSON Output
439
- ```json
440
- {
441
- "SUCCESS": true,
442
- "COMMAND": "TREE",
443
- "PACKAGE": "$ZMAIN_PACKAGE",
444
- "PARENT_PACKAGE": "$ZSAP_BASE",
445
- "NODES": [
446
- {
447
- "PACKAGE": "$ZMAIN_PACKAGE",
448
- "PARENT": "",
449
- "DESCRIPTION": "$ZMAIN_PACKAGE",
450
- "DEPTH": 0,
451
- "OBJECT_COUNT": 11
452
- }
453
- ],
454
- "TOTAL_PACKAGES": 4,
455
- "TOTAL_OBJECTS": 127,
456
- "OBJECTS": [
457
- { "OBJECT": "CLAS", "COUNT": 10 },
458
- { "OBJECT": "INTF", "COUNT": 2 },
459
- { "OBJECT": "PROG", "COUNT": 11 },
460
- { "OBJECT": "FUGR", "COUNT": 1 },
461
- { "OBJECT": "TABL", "COUNT": 3 }
462
- ],
463
- "ERROR": ""
464
- }
465
- ```
466
-
467
- ### Error Handling
468
-
469
- | Error | Message |
470
- |-------|---------|
471
- | Package not found | `Package <name> does not exist in the system` |
472
- | Invalid package name | `Invalid package name: <name>` |
473
- | Access denied | `Access denied to package information` |
474
- | Depth too large | `Depth value too large (max: 10)` |
475
-
476
- ## View Command
477
-
478
- ### Description
479
- 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.
480
-
481
- **When you encounter an unknown table or structure, use this command instead of guessing!**
482
-
483
- ### Explore Unknown Tables/Structures
484
-
485
- ```bash
486
- # View table fields - see all columns, keys, and descriptions
487
- abapgit-agent view --objects ZMY_TABLE --type TABL
488
-
489
- # View structure components
490
- abapgit-agent view --objects ZMY_STRUCT --type STRU
491
-
492
- # View data element type information
493
- abapgit-agent view --objects ZMY_DTEL --type DTEL
494
-
495
- # View CDS view definition
496
- abapgit-agent view --objects ZC_MY_CDS_VIEW --type DDLS
497
-
498
- # View class interface and methods
499
- abapgit-agent view --objects ZCL_UNKNOWN_CLASS
500
-
501
- # View interface definition
502
- abapgit-agent view --objects ZIF_UNKNOWN_INTERFACE
503
- ```
504
-
505
- ### When to Use View Command
506
-
507
- AI assistant SHOULD call `view` command when:
508
-
509
- - User asks to "check", "look up", or "explore" an unfamiliar object
510
- - Working with a table/structure and you don't know the field names/types
511
- - Calling a class/interface method and you don't know the parameters
512
- - User provides an object name that may not exist in the git repository
513
- - You need to verify an object exists before using it
514
-
515
- **Example workflow:**
516
- ```
517
- User: "Check if SFLIGHT table has a PRICE field"
518
-
519
- Assistant: <calls `abapgit-agent view --objects SFLIGHT --type TABL`>
520
- → Shows table structure with all fields including PRICE
521
- ```
522
-
523
- ### Usage
524
- ```bash
525
- # View single object (auto-detect type from TADIR)
526
- abapgit-agent view --objects ZCL_MY_CLASS
527
- abapgit-agent view --objects ZIF_MY_INTERFACE
528
-
529
- # View with explicit type
530
- abapgit-agent view --objects ZCL_MY_CLASS --type CLAS
531
- abapgit-agent view --objects ZIF_MY_INT --type INTF
532
- abapgit-agent view --objects ZMY_TABLE --type TABL
533
-
534
- # View multiple objects
535
- abapgit-agent view --objects ZCL_CLASS1,ZCL_CLASS2,ZIF_INTERFACE1
536
-
537
- # JSON output (for scripting/AI processing)
538
- abapgit-agent view --objects ZCL_MY_CLASS --json
539
- ```
540
-
541
- ### Parameters
542
-
543
- | Parameter | Required | Description |
544
- |-----------|----------|-------------|
545
- | `--objects` | Yes | Comma-separated list of object names (e.g., `ZCL_MY_CLASS,ZIF_MY_INTERFACE`) |
546
- | `--type` | No | Object type (CLAS, INTF, TABL, STRU, DTEL, TTYP, DDLS). Auto-detected from TADIR if not specified |
547
- | `--json` | No | Output raw JSON only (for scripting) |
548
-
549
- ### Supported Object Types
550
-
551
- | Type | Description |
552
- |------|-------------|
553
- | CLAS | Class |
554
- | INTF | Interface |
555
- | TABL | Table |
556
- | STRU | Structure |
557
- | DTEL | Data Element |
558
- | TTYP | Table Type |
559
- | DDLS | CDS View/Entity |
560
-
561
- **Note:** Object type is automatically detected from TADIR. Use `--type` only when you know the type and want to override auto-detection.
562
-
563
- ### Output
564
-
565
- **Human-readable:**
566
- ```
567
- 📖 ZCL_MY_CLASS (Class)
568
- Class ZCL_MY_CLASS in $PACKAGE
569
-
570
- CLASS zcl_my_class DEFINITION PUBLIC.
571
-
572
- PUBLIC SECTION.
573
- INTERFACES: zif_my_interface.
574
- METHODS: constructor,
575
- get_value RETURNING VALUE(rv_result) TYPE string.
576
- ENDCLASS.
577
- ```
578
-
579
- **JSON Output:**
580
- ```json
581
- {
582
- "success": true,
583
- "command": "VIEW",
584
- "message": "Retrieved object(s)",
585
- "objects": [
586
- {
587
- "name": "ZCL_MY_CLASS",
588
- "type": "CLAS",
589
- "type_text": "Class",
590
- "description": "Class ZCL_MY_CLASS in $PACKAGE",
591
- "source": "CLASS zcl_my_class DEFINITION PUBLIC...",
592
- "not_found": false
593
- }
594
- ],
595
- "summary": { "total": 1 }
596
- }
597
- ```
598
-
599
- **Table Type Output:**
600
- ```
601
- 📖 ZMY_TTYP (Table Type)
602
- Table Type ZMY_TTYP in $PACKAGE
603
-
604
- Line Type: ZMY_STRUCTURE
605
- Access Mode: STANDARD
606
- Key Definition: WITH KEY
607
- ```
608
-
609
- **CDS View Output:**
610
- ```
611
- 📖 ZC_MY_CDS_VIEW (CDS View)
612
- CDS View ZC_MY_CDS_VIEW in $PACKAGE
613
-
614
- @AbapCatalog.sqlViewName: 'ZCMYVIEW'
615
- @AbapCatalog.compiler.compareFilter: true
616
- @AccessControl.authorizationCheck: #NOT_REQUIRED
617
- @EndUserText.label: 'My CDS View'
618
- define view ZC_MY_CDS_VIEW as select from tdevc
619
- {
620
- key devclass as Devclass,
621
- parentcl as ParentPackage,
622
- ctext as Description
623
- }
624
- where devclass not like '$%'
625
- ```
626
-
627
- ### Error Handling
628
-
629
- | Error | Message |
630
- |-------|---------|
631
- | Object not found | `Object <name> not found` |
632
- | Invalid object type | `Unsupported object type: <type>` |
633
-
634
- ## Preview Command
635
-
636
- ### Description
637
- 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.
638
-
639
- **This is the PRIMARY way to explore table and CDS view DATA.**
640
-
641
- ### Usage
642
- ```bash
643
- # Preview table data (auto-detect type)
644
- abapgit-agent preview --objects SFLIGHT
645
-
646
- # Preview CDS view data
647
- abapgit-agent preview --objects ZC_MY_CDS_VIEW --type DDLS
648
-
649
- # Preview with explicit type
650
- abapgit-agent preview --objects SFLIGHT --type TABL
651
-
652
- # Preview with row limit
653
- abapgit-agent preview --objects SFLIGHT --limit 20
654
-
655
- # Preview with WHERE clause filter
656
- abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
657
-
658
- # Preview specific columns only
659
- abapgit-agent preview --objects SFLIGHT --columns CARRID,CONNID,FLDATE,PRICE
660
-
661
- # Vertical format (for wide tables)
662
- abapgit-agent preview --objects SFLIGHT --vertical
663
-
664
- # JSON output (for scripting/AI processing)
665
- abapgit-agent preview --objects SFLIGHT --json
666
- ```
667
-
668
- ### Parameters
669
-
670
- | Parameter | Required | Description |
671
- |-----------|----------|-------------|
672
- | `--objects` | Yes | Comma-separated list of table/view names |
673
- | `--type` | No | Object type (TABL, DDLS). Auto-detected from TADIR if not specified |
674
- | `--limit` | No | Maximum rows to return (default: 10, max: 100) |
675
- | `--where` | No | WHERE clause filter (e.g., `CARRID = 'AA'`) |
676
- | `--columns` | No | Comma-separated column names to display |
677
- | `--vertical` | No | Show data in vertical format (one field per line) |
678
- | `--compact` | No | Truncate values to fit columns |
679
- | `--json` | No | Output raw JSON only |
680
-
681
- ### Output
682
-
683
- **Default (first 6 columns shown with indicator):**
684
- ```
685
- 📊 Preview: SFLIGHT (Table)
686
-
687
- ┌──────────┬────────┬──────────┬───────────┬─────────┬─────────┐
688
- │ CARRID │ CONNID │ FLDATE │ PRICE │ CURRENCY│ PLANETYPE│
689
- ├──────────┼────────┼──────────┼───────────┼─────────┼─────────┤
690
- │ AA │ 0017 │ 20240201 │ 422.94 │ USD │ 747-400 │
691
- │ AA │ 0017 │ 20240202 │ 422.94 │ USD │ 747-400 │
692
- └──────────┴────────┴──────────┴───────────┴─────────┴─────────┘
693
-
694
- Showing 2 of 10 rows
695
- ⚠️ Note: 3 more columns hidden (SEATSMAX, SEATSOCC, PAYMENTSUM)
696
- Use --columns to select specific columns
697
- Use --json for full data
698
- ```
699
-
700
- **With WHERE Filter:**
701
- ```
702
- 📊 Preview: SFLIGHT (filtered)
703
-
704
- ┌──────────┬────────┬──────────┬─────────┐
705
- │ CARRID │ CONNID │ FLDATE │ PRICE │
706
- ├──────────┼────────┼──────────┼─────────┤
707
- │ AA │ 0017 │ 20240201 │ 422.94 │
708
- │ AA │ 0017 │ 20240202 │ 422.94 │
709
- └──────────┴────────┴──────────┴─────────┘
710
-
711
- WHERE: CARRID = 'AA'
712
- ```
713
-
714
- **Vertical Format (for wide tables):**
715
- ```
716
- 📊 Preview: SFLIGHT (1 of 10 rows, vertical)
717
-
718
- Row 1:
719
- ────────────────────────────────────────────────────────────
720
- CARRID: AA
721
- CONNID: 0017
722
- FLDATE: 20240201
723
- PRICE: 422.94
724
- CURRENCY: USD
725
- PLANETYPE: 747-400
726
- SEATSMAX: 400
727
- SEATSOCC: 350
728
- PAYMENTSUM: 145000
729
- ────────────────────────────────────────────────────────────
730
- ```
731
-
732
- ### JSON Output
733
- ```json
734
- {
735
- "SUCCESS": true,
736
- "COMMAND": "PREVIEW",
737
- "OBJECTS": [
738
- {
739
- "NAME": "SFLIGHT",
740
- "TYPE": "TABL",
741
- "TYPE_TEXT": "Table",
742
- "ROW_COUNT": 2,
743
- "TOTAL_ROWS": 10,
744
- "ROWS": [
745
- { "CARRID": "AA", "CONNID": "0017", "FLDATE": "20240201", "PRICE": "422.94", ... }
746
- ],
747
- "FIELDS": [
748
- { "FIELD": "CARRID", "TYPE": "CHAR", "LENGTH": 3 },
749
- { "FIELD": "PRICE", "TYPE": "CURR", "LENGTH": 16 }
750
- ],
751
- "COLUMNS_DISPLAYED": 6,
752
- "COLUMNS_HIDDEN": ["SEATSMAX", "SEATSOCC", "PAYMENTSUM"]
753
- }
754
- ],
755
- "SUMMARY": { "TOTAL_OBJECTS": 1, "TOTAL_ROWS": 2 },
756
- "ERROR": ""
757
- }
758
- ```
759
-
760
- ### Error Handling
761
-
762
- | Error | Message |
763
- |-------|---------|
764
- | Table not found | `Table not found: Z_NONEXISTENT` |
765
- | CDS View not found | `CDS View not found: Z_NONEXISTENT` |
766
- | Access denied | `Access denied to table: SFLIGHT` |
767
- | Invalid WHERE clause | `Invalid WHERE clause: <reason>` |
768
-
769
- ### Auto-Detection Rules
770
-
771
- | Object Name Pattern | Default Type |
772
- |---------------------|--------------|
773
- | `ZC_*` or `zc_*` | DDLS (CDS View) |
774
- | Other | TABL (Table) |
775
-
776
- ## Status Check
777
-
778
- ### Description
779
- Check if ABAP integration is configured for the current repository.
780
-
781
- ### Usage
782
- ```bash
783
- abapgit-agent status
784
- ```
785
-
786
- ### Output
787
- ```
788
- ✅ ABAP Git Agent is ENABLED
789
- Config location: /path/to/repo/.abapGitAgent
790
- ```
791
-
792
- Or if not configured:
793
- ```
794
- ❌ ABAP Git Agent is NOT configured
795
- ```
796
-
797
- ## Configuration
798
-
799
- ### File-based (.abapGitAgent)
800
- Create `.abapGitAgent` in repository root:
801
- ```json
802
- {
803
- "host": "your-sap-system.com",
804
- "sapport": 443,
805
- "client": "100",
806
- "user": "TECH_USER",
807
- "password": "your-password",
808
- "language": "EN",
809
- "gitUsername": "git-username",
810
- "gitPassword": "git-token"
811
- }
812
- ```
813
-
814
- ### Configuration Options
815
-
816
- | Option | Description | Default |
817
- |--------|-------------|---------|
818
- | `host` | SAP system hostname | Required |
819
- | `sapport` | SAP port (usually 443) | 443 |
820
- | `client` | SAP client number | 100 |
821
- | `user` | SAP username | Required |
822
- | `password` | SAP password | Required |
823
- | `language` | SAP language | EN |
824
- | `gitUsername` | Git username/token | Optional |
825
- | `gitPassword` | Git password/token | Optional |
826
- | `transport` | Default transport request for pull | Optional |
827
-
828
- ### Environment Variables
829
- ```bash
830
- export ABAP_HOST="your-sap-system.com"
831
- export ABAP_PORT=443
832
- export ABAP_CLIENT="100"
833
- export ABAP_USER="TECH_USER"
834
- export ABAP_PASSWORD="your-password"
835
- export ABAP_LANGUAGE="EN"
836
- export GIT_USERNAME="git-username"
837
- export GIT_PASSWORD="git-token"
838
- export ABAP_TRANSPORT="DEVK900001"
839
- ```
840
-
841
- ### Transport Request Precedence
842
-
843
- When running `pull` command, the transport request is determined in this order:
844
-
845
- | Priority | Source | Example |
846
- |----------|--------|---------|
847
- | 1 | CLI `--transport` argument | `--transport DEVK900001` |
848
- | 2 | Config file `transport` | `"transport": "DEVK900001"` |
849
- | 3 | Environment variable `ABAP_TRANSPORT` | `export ABAP_TRANSPORT="DEVK900001"` |
850
- | 4 (default) | Not set | abapGit creates/uses default |
851
-
852
- ## Troubleshooting
853
-
854
- **Pull fails with "Error updating where-used list":**
855
- - This means SYNTAX ERROR in the object
856
- - Run `abapgit-agent inspect --files <file>` for detailed errors
857
-
858
- **Pull shows "Failed Objects" > 0:**
859
- - Objects failed to activate - check the error messages
860
- - Fix syntax errors and pull again
861
-
862
- **Preview/View command fails:**
863
- - Check table/view exists in the ABAP system
864
- - Verify credentials in `.abapGitAgent`
865
-
866
- **"Table or view not found":**
867
- - Table may not exist or may have different name
868
- - Use `view` command to check available tables
869
-
870
- **Terminal width issues with preview:**
871
- - Use `--columns` to specify exact columns
872
- - Use `--vertical` for wide tables
873
-
874
- ## Development Workflow
875
-
876
- ### Exploring Unknown ABAP Objects
877
-
878
- **Check package structure:**
879
- ```bash
880
- abapgit-agent tree --package $MY_PACKAGE
881
- ```
882
-
883
- **Before working with an unfamiliar table, structure, class, or interface:**
884
-
885
- ```bash
886
- # Don't guess! Use view command to explore:
887
-
888
- # Check table structure
889
- abapgit-agent view --objects ZMY_TABLE --type TABL
890
-
891
- # Check structure components
892
- abapgit-agent view --objects ZMY_STRUCT --type STRU
893
-
894
- # Check class methods and interface
895
- abapgit-agent view --objects ZCL_UNKNOWN_CLASS
896
-
897
- # Check interface definition
898
- abapgit-agent view --objects ZIF_UNKNOWN_INTERFACE
899
-
900
- # Check data element type
901
- abapgit-agent view --objects ZMY_DTEL --type DTEL
902
-
903
- # JSON output for programmatic use
904
- abapgit-agent view --objects ZMY_TABLE --type TABL --json
905
- ```
906
-
907
- ### CLI Tool Development
908
-
909
- 1. Make changes to CLI code (JavaScript)
910
- 2. Test locally: `node bin/abapgit-agent pull`
911
- 3. Test against real ABAP system
912
- 4. Commit and push
913
-
914
- ### ABAP Backend Development
915
-
916
- 1. Make changes to ABAP backend (abap/ folder)
917
- 2. Pull only changed files (faster):
918
- ```bash
919
- abapgit-agent pull --files abap/zcl_my_class.clas.abap
920
- ```
921
- Or pull all files:
922
- ```bash
923
- abapgit-agent pull
924
- ```
925
- 3. Commit and push
926
- 4. Deploy changes via abapGit to your SAP system
927
-
928
- ### Fast Iteration Workflow
929
-
930
- For quick ABAP code changes:
931
- 1. Make small change to ABAP file
932
- 2. `git add <file> && git commit -m "fix"`
933
- 3. `abapgit-agent pull --files <file>` (seconds, not minutes)
934
- 4. Verify activation results
935
- 5. Repeat until done
936
-
937
- ## Creating CDS Views
938
-
939
- For guidelines on creating CDS views and CDS view entities, see **ABAP Code Generation** below.
940
-
941
- ## For ABAP Code Generation
942
-
943
- **NOTE**: This file is for developing the CLI tool itself. For guidelines on **generating ABAP code** for abapGit repositories, see `/abap/CLAUDE.md`. Copy that file to your ABAP repository root when setting up new projects.
944
-
945
- ## ABAP Unit Tests
946
-
947
- ### File Structure
948
- - Main class: `zcl_xxx.clas.abap`
949
- - Test class: `zcl_xxx.clas.testclasses.abap`
950
- - No separate XML needed for test classes
951
-
952
- ### XML Configuration
953
- Add `<WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>` to main class XML file:
954
- ```xml
955
- <VSEOCLASS>
956
- <CLSNAME>ZCL_ABGAGT_UTIL</CLSNAME>
957
- ...
958
- <WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>
959
- </VSEOCLASS>
960
- ```
961
-
962
- ### Test Class Naming
963
- - Short name: `ltcl_<name>` (e.g., `ltcl_util`, not `ltcl_abgagt_util_test`)
964
- - Must include `FINAL` keyword
965
- - **CRITICAL: Class name MUST NOT exceed 30 characters!**
966
- - Example: `ltcl_cmd_inspect` (18 chars) is OK
967
- - `ltcl_zcl_abgagt_command_infect` (32 chars) is NOT OK
968
-
969
- ### Test Class Declaration
970
- ```abap
971
- CLASS ltcl_util DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
972
- ```
973
-
974
- ### Test Methods
975
- - Must have `FOR TESTING` keyword
976
- - Can optionally include `RAISING <exception>`
977
- - **CRITICAL: Method names MUST NOT exceed 30 characters!**
978
- - Example: `test_exec_multi_files` (20 chars) is OK
979
- - `test_exec_multiple_files` (25 chars) is OK
980
- - `test_exec_multiple_files_with_long_name` (40 chars) is NOT OK
981
-
982
- ### Setup Method
983
- ```abap
984
- METHOD setup.
985
- mo_util = zcl_abgagt_util=>get_instance( ).
986
- ENDMETHOD.
987
- ```
988
-
989
- ### Assertions
990
- Use `CL_ABAP_UNIT_ASSERT` class:
991
- - `assert_equals( act = lv_act exp = lv_exp msg = 'message' )`
992
- - `assert_initial( act = lv_act msg = 'message' )`
993
- - `assert_not_initial( act = lv_act msg = 'message' )`
994
-
995
- ### Method Call Format
996
- - Instance methods: `mo_object->method( )`
997
- - Class/static methods: `zcl_class=>method( )`
998
-
999
- ### DATA() vs VALUE #() Rule
1000
- **When assigning to a typed variable, ABAP can infer the type from the target.**
1001
-
1002
- **CORRECT:**
1003
- ```abap
1004
- " When target has explicit type, VALUE #() infers from it
1005
- DATA lt_so_class TYPE RANGE OF seoaliases-clsname.
1006
- lt_so_class = VALUE #( ( sign = 'I' option = 'EQ' low = lv_value ) ).
1007
-
1008
- " Or append with inline VALUE
1009
- APPEND VALUE #( sign = 'I' option = 'EQ' low = lv_value ) TO lt_so_class.
1010
- ```
1011
-
1012
- **WRONG (untyped variable):**
1013
- ```abap
1014
- DATA(ls_range) = VALUE #( sign = 'I' option = 'EQ' low = lv_value ). " Type unknown!
1015
- ```
1016
-
1017
- ### Example Test Class
1018
- ```abap
1019
- *----------------------------------------------------------------------*
1020
- * CLASS ltcl_util DEFINITION
1021
- *----------------------------------------------------------------------*
1022
- CLASS ltcl_util DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
1023
-
1024
- PRIVATE SECTION.
1025
- METHODS setup.
1026
- DATA mo_util TYPE REF TO zcl_abgagt_util.
1027
-
1028
- METHODS parse_class_file FOR TESTING.
1029
-
1030
- ENDCLASS.
1031
-
1032
- *----------------------------------------------------------------------*
1033
- * CLASS ltcl_util IMPLEMENTATION
1034
- *----------------------------------------------------------------------*
1035
- CLASS ltcl_util IMPLEMENTATION.
1036
-
1037
- METHOD setup.
1038
- mo_util = zcl_abgagt_util=>get_instance( ).
1039
- ENDMETHOD.
1040
-
1041
- METHOD parse_class_file.
1042
- DATA lv_file TYPE string VALUE 'zcl_my_class.clas.abap'.
1043
- DATA lv_obj_type TYPE string.
1044
- DATA lv_obj_name TYPE string.
1045
-
1046
- mo_util->zif_abgagt_util~parse_file_to_object(
1047
- EXPORTING iv_file = lv_file
1048
- IMPORTING ev_obj_type = lv_obj_type
1049
- ev_obj_name = lv_obj_name ).
1050
-
1051
- cl_abap_unit_assert=>assert_equals(
1052
- act = lv_obj_type
1053
- exp = 'CLAS'
1054
- msg = 'Object type should be CLAS' ).
1055
- ENDMETHOD.
1056
-
1057
- ENDCLASS.
1058
- ```