sapbuddy-dsh 0.0.6 → 0.0.7

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 (55) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +12 -4
  3. package/defaults/AGENTS.md +114 -114
  4. package/defaults/connections.example.json +21 -21
  5. package/defaults/prompts/Memory.md +21 -21
  6. package/defaults/prompts/SYSTEM.md +110 -110
  7. package/defaults/settings.example.json +3 -3
  8. package/dist/sap-tools/adtManager.d.ts +11 -1
  9. package/dist/sap-tools/adtManager.js +176 -9
  10. package/dist/sap-tools/connections-store.js +4 -1
  11. package/dist/sap-tools/execution.js +1 -1
  12. package/dist/tools.js +5 -3
  13. package/package.json +5 -3
  14. package/skills/abap-code-review/SKILL.md +75 -75
  15. package/skills/abap-code-review/assets/report-template.html +142 -142
  16. package/skills/abap-code-review/references/checklist.md +114 -114
  17. package/skills/abap-explain/SKILL.md +126 -126
  18. package/skills/abap-templates/SKILL.md +764 -764
  19. package/skills/abap-wiki/SKILL.md +104 -104
  20. package/skills/clean-abap/SKILL.md +91 -91
  21. package/skills/clean-abap/references/CleanABAP_zh.md +4309 -4309
  22. package/skills/dev-write/SKILL.md +137 -137
  23. package/skills/sap-abap-skills/README.md +205 -205
  24. package/skills/sap-abap-skills/SKILL.md +498 -498
  25. package/skills/sap-abap-skills/references/abap-dictionary.md +211 -211
  26. package/skills/sap-abap-skills/references/abap-sql.md +588 -588
  27. package/skills/sap-abap-skills/references/amdp.md +279 -279
  28. package/skills/sap-abap-skills/references/authorization.md +149 -149
  29. package/skills/sap-abap-skills/references/bits-bytes.md +92 -92
  30. package/skills/sap-abap-skills/references/builtin-functions.md +373 -373
  31. package/skills/sap-abap-skills/references/cds-views.md +412 -412
  32. package/skills/sap-abap-skills/references/cloud-development.md +299 -299
  33. package/skills/sap-abap-skills/references/constructor-expressions.md +458 -458
  34. package/skills/sap-abap-skills/references/date-time.md +415 -415
  35. package/skills/sap-abap-skills/references/design-patterns.md +292 -292
  36. package/skills/sap-abap-skills/references/dynamic-programming.md +426 -426
  37. package/skills/sap-abap-skills/references/exceptions.md +432 -432
  38. package/skills/sap-abap-skills/references/generative-ai.md +180 -180
  39. package/skills/sap-abap-skills/references/internal-tables.md +578 -578
  40. package/skills/sap-abap-skills/references/numeric-operations.md +219 -219
  41. package/skills/sap-abap-skills/references/object-orientation.md +518 -518
  42. package/skills/sap-abap-skills/references/performance.md +428 -428
  43. package/skills/sap-abap-skills/references/program-flow.md +302 -302
  44. package/skills/sap-abap-skills/references/rap-eml.md +549 -549
  45. package/skills/sap-abap-skills/references/released-classes.md +308 -308
  46. package/skills/sap-abap-skills/references/sap-luw.md +203 -203
  47. package/skills/sap-abap-skills/references/skill-reference-guide.md +98 -98
  48. package/skills/sap-abap-skills/references/sql-hierarchies.md +180 -180
  49. package/skills/sap-abap-skills/references/string-processing.md +488 -488
  50. package/skills/sap-abap-skills/references/table-grouping.md +150 -150
  51. package/skills/sap-abap-skills/references/tool-guide.md +285 -285
  52. package/skills/sap-abap-skills/references/unit-testing.md +512 -512
  53. package/skills/sap-abap-skills/references/where-conditions.md +223 -223
  54. package/skills/sap-abap-skills/references/xml-json.md +315 -315
  55. package/skills/translate-workflow/SKILL.md +69 -69
@@ -1,180 +1,180 @@
1
- # ABAP SQL Hierarchies - Complete Reference
2
-
3
- **Source**: [https://github.com/SAP-samples/abap-cheat-sheets/blob/main/10_ABAP_SQL_Hierarchies.md](https://github.com/SAP-samples/abap-cheat-sheets/blob/main/10_ABAP_SQL_Hierarchies.md)
4
-
5
- > **Version Note**: SQL hierarchies require CTEs (`WITH`) which are available from **7.51+**.
6
- > `FINAL(...)` in code examples requires **7.50+** — replace with `DATA(...)` on 7.40.
7
- > Hierarchy navigators are available from **7.51+**.
8
-
9
- ---
10
-
11
- ## CTE Hierarchies
12
-
13
- Common Table Expressions can declare SQL hierarchies using `WITH HIERARCHY`.
14
-
15
- ### CDS Hierarchy as CTE Source
16
-
17
- ```abap
18
- WITH
19
- +tree AS
20
- ( SELECT FROM demo_cds_simple_tree( p_id = @root_id )
21
- FIELDS * )
22
- WITH HIERARCHY demo_cds_simple_tree
23
- SELECT FROM +tree
24
- FIELDS id, parent, name, hierarchy_rank,
25
- hierarchy_tree_size, hierarchy_level
26
- INTO TABLE @FINAL(cte_cds_result).
27
- ```
28
-
29
- ### HIERARCHY Generator as CTE Source
30
-
31
- ```abap
32
- WITH
33
- +tree AS
34
- ( SELECT FROM HIERARCHY(
35
- SOURCE demo_cds_simple_tree_view
36
- CHILD TO PARENT ASSOCIATION _tree
37
- START WHERE id = @root_id
38
- SIBLINGS ORDER BY id
39
- MULTIPLE PARENTS NOT ALLOWED ) AS asql_hierarchy
40
- FIELDS id, parent, name )
41
- WITH HIERARCHY asql_hierarchy
42
- SELECT FROM +tree
43
- FIELDS id, parent, hierarchy_distance
44
- INTO TABLE @FINAL(cte_asql_result).
45
- ```
46
-
47
- ### CTE with Internal Associations
48
-
49
- ```abap
50
- WITH
51
- +cte_simple_tree_source AS
52
- ( SELECT FROM demo_simple_tree
53
- FIELDS id, parent_id AS parent, name )
54
- WITH ASSOCIATIONS (
55
- JOIN TO MANY +cte_simple_tree_source AS _tree
56
- ON +cte_simple_tree_source~parent = _tree~id ),
57
- +tree AS
58
- ( SELECT FROM HIERARCHY(
59
- SOURCE +cte_simple_tree_source
60
- CHILD TO PARENT ASSOCIATION _tree
61
- START WHERE id = @root_id
62
- SIBLINGS ORDER BY id
63
- MULTIPLE PARENTS NOT ALLOWED ) AS cte_hierarchy
64
- FIELDS id, parent, name )
65
- WITH HIERARCHY cte_hierarchy
66
- SELECT FROM +tree
67
- FIELDS id, parent, hierarchy_rank
68
- INTO TABLE @FINAL(cte_cte_result).
69
- ```
70
-
71
- ---
72
-
73
- ## HIERARCHY Generator
74
-
75
- Create SQL hierarchies directly in ABAP:
76
-
77
- ```abap
78
- DATA root_id TYPE demo_cds_simple_tree_view-id.
79
-
80
- SELECT FROM HIERARCHY( SOURCE demo_cds_simple_tree_view
81
- CHILD TO PARENT ASSOCIATION _tree
82
- START WHERE id = @root_id
83
- SIBLINGS ORDER BY id
84
- MULTIPLE PARENTS NOT ALLOWED )
85
- FIELDS id, parent, name, hierarchy_rank,
86
- hierarchy_tree_size, hierarchy_parent_rank,
87
- hierarchy_level, hierarchy_is_cycle,
88
- hierarchy_is_orphan, node_id, parent_id
89
- INTO TABLE @FINAL(asql_cds_result).
90
- ```
91
-
92
- ### Key Parameters
93
-
94
- | Parameter | Description |
95
- |-----------|-------------|
96
- | `SOURCE` | Hierarchy source (CDS view or CTE) |
97
- | `CHILD TO PARENT ASSOCIATION` | Self-association for relationships |
98
- | `START WHERE` | Root node conditions |
99
- | `SIBLINGS ORDER BY` | Sort order for siblings |
100
- | `MULTIPLE PARENTS NOT ALLOWED` | Single/multiple parent control |
101
-
102
- ---
103
-
104
- ## Hierarchy Navigators
105
-
106
- ### HIERARCHY_DESCENDANTS
107
-
108
- ```abap
109
- SELECT FROM HIERARCHY_DESCENDANTS(
110
- SOURCE demo_cds_simple_tree( p_id = @root_id )
111
- START WHERE id = @sub_id )
112
- FIELDS id, parent_id, name, hierarchy_distance
113
- INTO TABLE @FINAL(descendants).
114
- ```
115
-
116
- ### HIERARCHY_ANCESTORS
117
-
118
- ```abap
119
- SELECT FROM HIERARCHY_ANCESTORS(
120
- SOURCE demo_cds_simple_tree( p_id = @root_id )
121
- START WHERE id = @max_id )
122
- FIELDS id, parent_id, name, hierarchy_distance
123
- INTO TABLE @FINAL(ancestors).
124
- ```
125
-
126
- ### HIERARCHY_SIBLINGS
127
-
128
- ```abap
129
- SELECT FROM HIERARCHY_SIBLINGS(
130
- SOURCE demo_cds_simple_tree( p_id = @root_id )
131
- START WHERE id = @sibl_id )
132
- FIELDS id, parent_id, name, hierarchy_sibling_distance
133
- INTO TABLE @FINAL(siblings).
134
- ```
135
-
136
- ### HIERARCHY_DESCENDANTS_AGGREGATE
137
-
138
- ```abap
139
- TYPES:
140
- BEGIN OF value,
141
- id TYPE i,
142
- amount TYPE p LENGTH 16 DECIMALS 2,
143
- END OF value.
144
-
145
- DATA value_tab TYPE SORTED TABLE OF value WITH UNIQUE KEY id.
146
-
147
- SELECT FROM HIERARCHY_DESCENDANTS_AGGREGATE(
148
- SOURCE demo_cds_simple_tree( p_id = @sub_id ) AS h
149
- JOIN @value_tab AS v
150
- ON v~id = h~id
151
- MEASURES SUM( v~amount ) AS amount_sum
152
- WHERE hierarchy_rank > 1
153
- WITH SUBTOTAL
154
- WITH BALANCE )
155
- FIELDS id, amount_sum, hierarchy_rank, hierarchy_aggregate_type
156
- INTO TABLE @FINAL(descendants_aggregate).
157
- ```
158
-
159
- ### Aggregate Parameters
160
-
161
- | Parameter | Description |
162
- |-----------|-------------|
163
- | `MEASURES` | Aggregate functions (SUM, COUNT, etc.) |
164
- | `WHERE` | Result set restrictions |
165
- | `WITH SUBTOTAL` | Sum of qualifying nodes |
166
- | `WITH BALANCE` | Sum of non-qualifying nodes |
167
-
168
- ---
169
-
170
- ## Implicit Hierarchy Columns
171
-
172
- | Column | Description |
173
- |--------|-------------|
174
- | `hierarchy_rank` | Position in traversal order |
175
- | `hierarchy_tree_size` | Count of descendants + self |
176
- | `hierarchy_parent_rank` | Rank of parent node |
177
- | `hierarchy_level` | Depth from root |
178
- | `hierarchy_is_cycle` | Cycle detection flag |
179
- | `hierarchy_is_orphan` | Orphan node flag |
180
- | `hierarchy_distance` | Distance from start node |
1
+ # ABAP SQL Hierarchies - Complete Reference
2
+
3
+ **Source**: [https://github.com/SAP-samples/abap-cheat-sheets/blob/main/10_ABAP_SQL_Hierarchies.md](https://github.com/SAP-samples/abap-cheat-sheets/blob/main/10_ABAP_SQL_Hierarchies.md)
4
+
5
+ > **Version Note**: SQL hierarchies require CTEs (`WITH`) which are available from **7.51+**.
6
+ > `FINAL(...)` in code examples requires **7.50+** — replace with `DATA(...)` on 7.40.
7
+ > Hierarchy navigators are available from **7.51+**.
8
+
9
+ ---
10
+
11
+ ## CTE Hierarchies
12
+
13
+ Common Table Expressions can declare SQL hierarchies using `WITH HIERARCHY`.
14
+
15
+ ### CDS Hierarchy as CTE Source
16
+
17
+ ```abap
18
+ WITH
19
+ +tree AS
20
+ ( SELECT FROM demo_cds_simple_tree( p_id = @root_id )
21
+ FIELDS * )
22
+ WITH HIERARCHY demo_cds_simple_tree
23
+ SELECT FROM +tree
24
+ FIELDS id, parent, name, hierarchy_rank,
25
+ hierarchy_tree_size, hierarchy_level
26
+ INTO TABLE @FINAL(cte_cds_result).
27
+ ```
28
+
29
+ ### HIERARCHY Generator as CTE Source
30
+
31
+ ```abap
32
+ WITH
33
+ +tree AS
34
+ ( SELECT FROM HIERARCHY(
35
+ SOURCE demo_cds_simple_tree_view
36
+ CHILD TO PARENT ASSOCIATION _tree
37
+ START WHERE id = @root_id
38
+ SIBLINGS ORDER BY id
39
+ MULTIPLE PARENTS NOT ALLOWED ) AS asql_hierarchy
40
+ FIELDS id, parent, name )
41
+ WITH HIERARCHY asql_hierarchy
42
+ SELECT FROM +tree
43
+ FIELDS id, parent, hierarchy_distance
44
+ INTO TABLE @FINAL(cte_asql_result).
45
+ ```
46
+
47
+ ### CTE with Internal Associations
48
+
49
+ ```abap
50
+ WITH
51
+ +cte_simple_tree_source AS
52
+ ( SELECT FROM demo_simple_tree
53
+ FIELDS id, parent_id AS parent, name )
54
+ WITH ASSOCIATIONS (
55
+ JOIN TO MANY +cte_simple_tree_source AS _tree
56
+ ON +cte_simple_tree_source~parent = _tree~id ),
57
+ +tree AS
58
+ ( SELECT FROM HIERARCHY(
59
+ SOURCE +cte_simple_tree_source
60
+ CHILD TO PARENT ASSOCIATION _tree
61
+ START WHERE id = @root_id
62
+ SIBLINGS ORDER BY id
63
+ MULTIPLE PARENTS NOT ALLOWED ) AS cte_hierarchy
64
+ FIELDS id, parent, name )
65
+ WITH HIERARCHY cte_hierarchy
66
+ SELECT FROM +tree
67
+ FIELDS id, parent, hierarchy_rank
68
+ INTO TABLE @FINAL(cte_cte_result).
69
+ ```
70
+
71
+ ---
72
+
73
+ ## HIERARCHY Generator
74
+
75
+ Create SQL hierarchies directly in ABAP:
76
+
77
+ ```abap
78
+ DATA root_id TYPE demo_cds_simple_tree_view-id.
79
+
80
+ SELECT FROM HIERARCHY( SOURCE demo_cds_simple_tree_view
81
+ CHILD TO PARENT ASSOCIATION _tree
82
+ START WHERE id = @root_id
83
+ SIBLINGS ORDER BY id
84
+ MULTIPLE PARENTS NOT ALLOWED )
85
+ FIELDS id, parent, name, hierarchy_rank,
86
+ hierarchy_tree_size, hierarchy_parent_rank,
87
+ hierarchy_level, hierarchy_is_cycle,
88
+ hierarchy_is_orphan, node_id, parent_id
89
+ INTO TABLE @FINAL(asql_cds_result).
90
+ ```
91
+
92
+ ### Key Parameters
93
+
94
+ | Parameter | Description |
95
+ |-----------|-------------|
96
+ | `SOURCE` | Hierarchy source (CDS view or CTE) |
97
+ | `CHILD TO PARENT ASSOCIATION` | Self-association for relationships |
98
+ | `START WHERE` | Root node conditions |
99
+ | `SIBLINGS ORDER BY` | Sort order for siblings |
100
+ | `MULTIPLE PARENTS NOT ALLOWED` | Single/multiple parent control |
101
+
102
+ ---
103
+
104
+ ## Hierarchy Navigators
105
+
106
+ ### HIERARCHY_DESCENDANTS
107
+
108
+ ```abap
109
+ SELECT FROM HIERARCHY_DESCENDANTS(
110
+ SOURCE demo_cds_simple_tree( p_id = @root_id )
111
+ START WHERE id = @sub_id )
112
+ FIELDS id, parent_id, name, hierarchy_distance
113
+ INTO TABLE @FINAL(descendants).
114
+ ```
115
+
116
+ ### HIERARCHY_ANCESTORS
117
+
118
+ ```abap
119
+ SELECT FROM HIERARCHY_ANCESTORS(
120
+ SOURCE demo_cds_simple_tree( p_id = @root_id )
121
+ START WHERE id = @max_id )
122
+ FIELDS id, parent_id, name, hierarchy_distance
123
+ INTO TABLE @FINAL(ancestors).
124
+ ```
125
+
126
+ ### HIERARCHY_SIBLINGS
127
+
128
+ ```abap
129
+ SELECT FROM HIERARCHY_SIBLINGS(
130
+ SOURCE demo_cds_simple_tree( p_id = @root_id )
131
+ START WHERE id = @sibl_id )
132
+ FIELDS id, parent_id, name, hierarchy_sibling_distance
133
+ INTO TABLE @FINAL(siblings).
134
+ ```
135
+
136
+ ### HIERARCHY_DESCENDANTS_AGGREGATE
137
+
138
+ ```abap
139
+ TYPES:
140
+ BEGIN OF value,
141
+ id TYPE i,
142
+ amount TYPE p LENGTH 16 DECIMALS 2,
143
+ END OF value.
144
+
145
+ DATA value_tab TYPE SORTED TABLE OF value WITH UNIQUE KEY id.
146
+
147
+ SELECT FROM HIERARCHY_DESCENDANTS_AGGREGATE(
148
+ SOURCE demo_cds_simple_tree( p_id = @sub_id ) AS h
149
+ JOIN @value_tab AS v
150
+ ON v~id = h~id
151
+ MEASURES SUM( v~amount ) AS amount_sum
152
+ WHERE hierarchy_rank > 1
153
+ WITH SUBTOTAL
154
+ WITH BALANCE )
155
+ FIELDS id, amount_sum, hierarchy_rank, hierarchy_aggregate_type
156
+ INTO TABLE @FINAL(descendants_aggregate).
157
+ ```
158
+
159
+ ### Aggregate Parameters
160
+
161
+ | Parameter | Description |
162
+ |-----------|-------------|
163
+ | `MEASURES` | Aggregate functions (SUM, COUNT, etc.) |
164
+ | `WHERE` | Result set restrictions |
165
+ | `WITH SUBTOTAL` | Sum of qualifying nodes |
166
+ | `WITH BALANCE` | Sum of non-qualifying nodes |
167
+
168
+ ---
169
+
170
+ ## Implicit Hierarchy Columns
171
+
172
+ | Column | Description |
173
+ |--------|-------------|
174
+ | `hierarchy_rank` | Position in traversal order |
175
+ | `hierarchy_tree_size` | Count of descendants + self |
176
+ | `hierarchy_parent_rank` | Rank of parent node |
177
+ | `hierarchy_level` | Depth from root |
178
+ | `hierarchy_is_cycle` | Cycle detection flag |
179
+ | `hierarchy_is_orphan` | Orphan node flag |
180
+ | `hierarchy_distance` | Distance from start node |