@linkup-ai/abap-ai 2.0.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/README.md +384 -0
- package/dist/adt-client.js +364 -0
- package/dist/cli/activate.js +113 -0
- package/dist/cli/init.js +333 -0
- package/dist/cli/remove.js +80 -0
- package/dist/cli/status.js +229 -0
- package/dist/cli/systems.js +68 -0
- package/dist/cli.js +81 -0
- package/dist/index.js +1318 -0
- package/dist/knowledge/abap/abap-dictionary.md +199 -0
- package/dist/knowledge/abap/abap-sql.md +296 -0
- package/dist/knowledge/abap/amdp.md +273 -0
- package/dist/knowledge/abap/clean-code.md +293 -0
- package/dist/knowledge/abap/cloud-background-processing.md +250 -0
- package/dist/knowledge/abap/cloud-communication.md +265 -0
- package/dist/knowledge/abap/cloud-development.md +176 -0
- package/dist/knowledge/abap/cloud-extensibility.md +252 -0
- package/dist/knowledge/abap/cloud-released-apis.md +261 -0
- package/dist/knowledge/abap/constructor-expressions.md +289 -0
- package/dist/knowledge/abap/enhancements.md +232 -0
- package/dist/knowledge/abap/exceptions.md +271 -0
- package/dist/knowledge/abap/internal-tables.md +205 -0
- package/dist/knowledge/abap/object-orientation.md +298 -0
- package/dist/knowledge/abap/performance.md +216 -0
- package/dist/knowledge/abap/rap-abstract-entities.md +206 -0
- package/dist/knowledge/abap/rap-business-events.md +216 -0
- package/dist/knowledge/abap/rap-draft.md +191 -0
- package/dist/knowledge/abap/rap-eml.md +453 -0
- package/dist/knowledge/abap/rap-end-to-end.md +486 -0
- package/dist/knowledge/abap/rap-feature-control.md +185 -0
- package/dist/knowledge/abap/rap-numbering.md +280 -0
- package/dist/knowledge/abap/rap-service-exposure.md +163 -0
- package/dist/knowledge/abap/rap-unmanaged.md +468 -0
- package/dist/knowledge/abap/string-processing.md +180 -0
- package/dist/knowledge/abap/unit-testing.md +303 -0
- package/dist/knowledge/abap-cds/access-control.md +241 -0
- package/dist/knowledge/abap-cds/annotations.md +331 -0
- package/dist/knowledge/abap-cds/associations.md +254 -0
- package/dist/knowledge/abap-cds/expressions.md +230 -0
- package/dist/knowledge/abap-cds/functions.md +245 -0
- package/dist/knowledge/abap-cds/metadata-extensions.md +294 -0
- package/dist/knowledge/cap/authentication.md +278 -0
- package/dist/knowledge/cap/cdl-syntax.md +247 -0
- package/dist/knowledge/cap/cql-queries.md +266 -0
- package/dist/knowledge/cap/deployment.md +343 -0
- package/dist/knowledge/cap/event-handlers.md +287 -0
- package/dist/knowledge/cap/fiori-integration.md +303 -0
- package/dist/knowledge/cap/service-definitions.md +287 -0
- package/dist/knowledge/fiori/annotations.md +347 -0
- package/dist/knowledge/fiori/deployment.md +340 -0
- package/dist/knowledge/fiori/fiori-elements.md +332 -0
- package/dist/knowledge/fiori/fiori-side-effects.md +107 -0
- package/dist/knowledge/fiori/fiori-valuelist.md +144 -0
- package/dist/knowledge/fiori/ui5-controllers.md +358 -0
- package/dist/knowledge/fiori/ui5-data-binding.md +311 -0
- package/dist/knowledge/fiori/ui5-fragments-dialogs.md +330 -0
- package/dist/knowledge/fiori/ui5-manifest.md +411 -0
- package/dist/knowledge/fiori/ui5-routing.md +303 -0
- package/dist/knowledge/fiori/ui5-xml-views.md +294 -0
- package/dist/logger.js +114 -0
- package/dist/system-profile.js +207 -0
- package/dist/tools/abap-doc.js +72 -0
- package/dist/tools/abapgit.js +161 -0
- package/dist/tools/activate.js +68 -0
- package/dist/tools/atc-check.js +117 -0
- package/dist/tools/auth-object.js +56 -0
- package/dist/tools/breakpoints.js +76 -0
- package/dist/tools/call-hierarchy.js +84 -0
- package/dist/tools/cds-annotations.js +98 -0
- package/dist/tools/cds-dependencies.js +65 -0
- package/dist/tools/check.js +47 -0
- package/dist/tools/code-completion.js +70 -0
- package/dist/tools/code-coverage.js +111 -0
- package/dist/tools/create-amdp.js +111 -0
- package/dist/tools/create-dcl.js +81 -0
- package/dist/tools/create-transport.js +38 -0
- package/dist/tools/create.js +285 -0
- package/dist/tools/data-preview.js +37 -0
- package/dist/tools/delete.js +45 -0
- package/dist/tools/deploy-bsp.js +298 -0
- package/dist/tools/discovery.js +59 -0
- package/dist/tools/element-info.js +93 -0
- package/dist/tools/enhancements.js +186 -0
- package/dist/tools/extract-method.js +44 -0
- package/dist/tools/function-group.js +59 -0
- package/dist/tools/knowledge.js +275 -0
- package/dist/tools/lock-object.js +75 -0
- package/dist/tools/message-class.js +67 -0
- package/dist/tools/navigate.js +80 -0
- package/dist/tools/number-range.js +57 -0
- package/dist/tools/object-documentation.js +43 -0
- package/dist/tools/object-structure.js +78 -0
- package/dist/tools/object-versions.js +57 -0
- package/dist/tools/package-contents.js +60 -0
- package/dist/tools/pretty-printer.js +35 -0
- package/dist/tools/publish-binding.js +49 -0
- package/dist/tools/quick-fix.js +69 -0
- package/dist/tools/read.js +167 -0
- package/dist/tools/refactor-rename.js +60 -0
- package/dist/tools/release-transport.js +24 -0
- package/dist/tools/released-apis.js +51 -0
- package/dist/tools/repository-tree.js +90 -0
- package/dist/tools/scaffold-rap.js +642 -0
- package/dist/tools/search.js +73 -0
- package/dist/tools/shared/data-format.js +101 -0
- package/dist/tools/sql-console.js +17 -0
- package/dist/tools/system-info.js +270 -0
- package/dist/tools/traces.js +66 -0
- package/dist/tools/transport-contents.js +83 -0
- package/dist/tools/transports.js +67 -0
- package/dist/tools/unit-test.js +135 -0
- package/dist/tools/where-used.js +59 -0
- package/dist/tools/write.js +101 -0
- package/package.json +49 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# UI5 Fragments & Dialogs — Fragment, Dialog, MessageBox, MessageToast, Popover
|
|
2
|
+
|
|
3
|
+
## Fragment Definition
|
|
4
|
+
|
|
5
|
+
```xml
|
|
6
|
+
<!-- fragments/CreateOrder.fragment.xml -->
|
|
7
|
+
<core:FragmentDefinition
|
|
8
|
+
xmlns="sap.m"
|
|
9
|
+
xmlns:core="sap.ui.core"
|
|
10
|
+
xmlns:l="sap.ui.layout">
|
|
11
|
+
|
|
12
|
+
<Dialog id="createDialog" title="Create Order" draggable="true"
|
|
13
|
+
contentWidth="500px">
|
|
14
|
+
<content>
|
|
15
|
+
<l:form:SimpleForm xmlns:form="sap.ui.layout.form"
|
|
16
|
+
editable="true" layout="ResponsiveGridLayout">
|
|
17
|
+
<form:content>
|
|
18
|
+
<Label text="Customer"/>
|
|
19
|
+
<Input id="customerInput" value="{newOrder>/CustomerID}"
|
|
20
|
+
required="true"/>
|
|
21
|
+
<Label text="Amount"/>
|
|
22
|
+
<Input id="amountInput" value="{newOrder>/Amount}" type="Number"/>
|
|
23
|
+
<Label text="Description"/>
|
|
24
|
+
<TextArea id="descInput" value="{newOrder>/Description}" rows="3"/>
|
|
25
|
+
</form:content>
|
|
26
|
+
</l:form:SimpleForm>
|
|
27
|
+
</content>
|
|
28
|
+
<beginButton>
|
|
29
|
+
<Button text="Create" type="Emphasized" press=".onCreateConfirm"/>
|
|
30
|
+
</beginButton>
|
|
31
|
+
<endButton>
|
|
32
|
+
<Button text="Cancel" press=".onCreateCancel"/>
|
|
33
|
+
</endButton>
|
|
34
|
+
</Dialog>
|
|
35
|
+
|
|
36
|
+
</core:FragmentDefinition>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Loading Fragment (Async — Required)
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
// In controller — load and open dialog
|
|
43
|
+
onOpenCreateDialog: function() {
|
|
44
|
+
var oView = this.getView();
|
|
45
|
+
|
|
46
|
+
if (!this._pCreateDialog) {
|
|
47
|
+
this._pCreateDialog = this.loadFragment({
|
|
48
|
+
name: "com.myapp.fragments.CreateOrder"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
this._pCreateDialog.then(function(oDialog) {
|
|
53
|
+
// Set model for new record
|
|
54
|
+
oView.setModel(new sap.ui.model.json.JSONModel({
|
|
55
|
+
CustomerID: "",
|
|
56
|
+
Amount: 0,
|
|
57
|
+
Description: ""
|
|
58
|
+
}), "newOrder");
|
|
59
|
+
|
|
60
|
+
oDialog.open();
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
onCreateConfirm: function() {
|
|
65
|
+
var oData = this.getView().getModel("newOrder").getData();
|
|
66
|
+
// ... create record via OData ...
|
|
67
|
+
this.byId("createDialog").close();
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
onCreateCancel: function() {
|
|
71
|
+
this.byId("createDialog").close();
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Fragment Lifecycle
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
// loadFragment adds fragment to view (auto-prefixes IDs, inherits models)
|
|
79
|
+
// Preferred over Fragment.load for view-integrated fragments
|
|
80
|
+
|
|
81
|
+
// Alternative: Fragment.load (standalone, no view integration)
|
|
82
|
+
sap.ui.core.Fragment.load({
|
|
83
|
+
id: oView.getId(),
|
|
84
|
+
name: "com.myapp.fragments.MyFragment",
|
|
85
|
+
controller: this
|
|
86
|
+
}).then(function(oFragment) {
|
|
87
|
+
oView.addDependent(oFragment); // MUST add as dependent for model inheritance
|
|
88
|
+
oFragment.open();
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Dialog — Simple Confirmation
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
sap.ui.require(["sap/m/MessageBox"], function(MessageBox) {
|
|
96
|
+
|
|
97
|
+
MessageBox.confirm("Delete this order?", {
|
|
98
|
+
title: "Confirm Delete",
|
|
99
|
+
onClose: function(oAction) {
|
|
100
|
+
if (oAction === MessageBox.Action.OK) {
|
|
101
|
+
// proceed with delete
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## MessageBox — All Types
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
// Error
|
|
113
|
+
MessageBox.error("Something went wrong", {
|
|
114
|
+
title: "Error",
|
|
115
|
+
actions: [MessageBox.Action.RETRY, MessageBox.Action.CLOSE],
|
|
116
|
+
onClose: function(sAction) {
|
|
117
|
+
if (sAction === MessageBox.Action.RETRY) {
|
|
118
|
+
// retry logic
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Warning
|
|
124
|
+
MessageBox.warning("This action cannot be undone");
|
|
125
|
+
|
|
126
|
+
// Information
|
|
127
|
+
MessageBox.information("Order has been submitted");
|
|
128
|
+
|
|
129
|
+
// Success
|
|
130
|
+
MessageBox.success("Order created successfully");
|
|
131
|
+
|
|
132
|
+
// Custom actions
|
|
133
|
+
MessageBox.show("Save changes before leaving?", {
|
|
134
|
+
title: "Unsaved Changes",
|
|
135
|
+
actions: ["Save", "Discard", MessageBox.Action.CANCEL],
|
|
136
|
+
emphasizedAction: "Save",
|
|
137
|
+
onClose: function(sAction) {
|
|
138
|
+
switch (sAction) {
|
|
139
|
+
case "Save": /* save */ break;
|
|
140
|
+
case "Discard": /* discard */ break;
|
|
141
|
+
case MessageBox.Action.CANCEL: /* stay */ break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## MessageToast — Quick Feedback
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
sap.ui.require(["sap/m/MessageToast"], function(MessageToast) {
|
|
151
|
+
MessageToast.show("Order saved successfully");
|
|
152
|
+
MessageToast.show("Copied to clipboard", { duration: 3000, width: "15em" });
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## MessageStrip — Inline Message
|
|
157
|
+
|
|
158
|
+
```xml
|
|
159
|
+
<MessageStrip text="Draft saved" type="Success" showIcon="true"
|
|
160
|
+
showCloseButton="true" close=".onStripClose"/>
|
|
161
|
+
|
|
162
|
+
<MessageStrip text="Missing required fields" type="Error" showIcon="true"
|
|
163
|
+
visible="{= ${view>/hasErrors}}"/>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Popover
|
|
167
|
+
|
|
168
|
+
```xml
|
|
169
|
+
<!-- fragments/InfoPopover.fragment.xml -->
|
|
170
|
+
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
|
|
171
|
+
<Popover id="infoPopover" title="Details" placement="Auto">
|
|
172
|
+
<content>
|
|
173
|
+
<VBox class="sapUiSmallMargin">
|
|
174
|
+
<Label text="Created By"/>
|
|
175
|
+
<Text text="{CreatedBy}"/>
|
|
176
|
+
<Label text="Created At"/>
|
|
177
|
+
<Text text="{CreatedAt}"/>
|
|
178
|
+
</VBox>
|
|
179
|
+
</content>
|
|
180
|
+
</Popover>
|
|
181
|
+
</core:FragmentDefinition>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
onShowInfo: function(oEvent) {
|
|
186
|
+
var oButton = oEvent.getSource();
|
|
187
|
+
var oView = this.getView();
|
|
188
|
+
|
|
189
|
+
if (!this._pInfoPopover) {
|
|
190
|
+
this._pInfoPopover = this.loadFragment({
|
|
191
|
+
name: "com.myapp.fragments.InfoPopover"
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
this._pInfoPopover.then(function(oPopover) {
|
|
196
|
+
oPopover.openBy(oButton);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Select Dialog (Value Help)
|
|
202
|
+
|
|
203
|
+
```js
|
|
204
|
+
onValueHelp: function() {
|
|
205
|
+
if (!this._pSelectDialog) {
|
|
206
|
+
this._pSelectDialog = this.loadFragment({
|
|
207
|
+
name: "com.myapp.fragments.CustomerSelect"
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
this._pSelectDialog.then(function(oDialog) {
|
|
211
|
+
oDialog.open();
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
```xml
|
|
217
|
+
<!-- fragments/CustomerSelect.fragment.xml -->
|
|
218
|
+
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
|
|
219
|
+
<SelectDialog id="customerSelectDialog"
|
|
220
|
+
title="Select Customer"
|
|
221
|
+
items="{/Customers}"
|
|
222
|
+
search=".onCustomerSearch"
|
|
223
|
+
confirm=".onCustomerSelected"
|
|
224
|
+
cancel=".onCustomerSelectCancel"
|
|
225
|
+
growing="true"
|
|
226
|
+
growingThreshold="20">
|
|
227
|
+
<StandardListItem title="{CustomerName}" description="{CustomerID}"
|
|
228
|
+
icon="sap-icon://customer"/>
|
|
229
|
+
</SelectDialog>
|
|
230
|
+
</core:FragmentDefinition>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
```js
|
|
234
|
+
onCustomerSearch: function(oEvent) {
|
|
235
|
+
var sValue = oEvent.getParameter("value");
|
|
236
|
+
var oFilter = new sap.ui.model.Filter("CustomerName", "Contains", sValue);
|
|
237
|
+
oEvent.getSource().getBinding("items").filter([oFilter]);
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
onCustomerSelected: function(oEvent) {
|
|
241
|
+
var oItem = oEvent.getParameter("selectedItem");
|
|
242
|
+
if (oItem) {
|
|
243
|
+
var sCustomerID = oItem.getBindingContext().getProperty("CustomerID");
|
|
244
|
+
this.byId("customerInput").setValue(sCustomerID);
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
onCustomerSelectCancel: function() {
|
|
249
|
+
// nothing to do — dialog auto-closes
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Table Select Dialog (Multi-Column Value Help)
|
|
254
|
+
|
|
255
|
+
```xml
|
|
256
|
+
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
|
|
257
|
+
<TableSelectDialog id="materialSelectDialog"
|
|
258
|
+
title="Select Material"
|
|
259
|
+
items="{/Materials}"
|
|
260
|
+
confirm=".onMaterialSelected"
|
|
261
|
+
search=".onMaterialSearch"
|
|
262
|
+
growing="true"
|
|
263
|
+
multiSelect="false">
|
|
264
|
+
<columns>
|
|
265
|
+
<Column><Text text="Material"/></Column>
|
|
266
|
+
<Column><Text text="Description"/></Column>
|
|
267
|
+
<Column hAlign="End"><Text text="Price"/></Column>
|
|
268
|
+
</columns>
|
|
269
|
+
<items>
|
|
270
|
+
<ColumnListItem>
|
|
271
|
+
<Text text="{MaterialID}"/>
|
|
272
|
+
<Text text="{Description}"/>
|
|
273
|
+
<ObjectNumber number="{Price}" unit="{Currency}"/>
|
|
274
|
+
</ColumnListItem>
|
|
275
|
+
</items>
|
|
276
|
+
</TableSelectDialog>
|
|
277
|
+
</core:FragmentDefinition>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Message Handling — sap.ui.core.message.MessageManager
|
|
281
|
+
|
|
282
|
+
```js
|
|
283
|
+
// Get message manager
|
|
284
|
+
var oMessageManager = sap.ui.getCore().getMessageManager();
|
|
285
|
+
|
|
286
|
+
// Register for messages (in onInit)
|
|
287
|
+
oMessageManager.registerObject(this.getView(), true);
|
|
288
|
+
this.getView().setModel(oMessageManager.getMessageModel(), "message");
|
|
289
|
+
|
|
290
|
+
// Add custom message
|
|
291
|
+
oMessageManager.addMessages(
|
|
292
|
+
new sap.ui.core.message.Message({
|
|
293
|
+
message: "Customer not found",
|
|
294
|
+
type: sap.ui.core.MessageType.Error,
|
|
295
|
+
target: "/CustomerID",
|
|
296
|
+
processor: this.getView().getModel()
|
|
297
|
+
})
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
// Remove all messages
|
|
301
|
+
oMessageManager.removeAllMessages();
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
```xml
|
|
305
|
+
<!-- MessagePopover button -->
|
|
306
|
+
<Button icon="sap-icon://message-popup" text="{message>/}"
|
|
307
|
+
press=".onMessagePopoverPress" type="Emphasized"/>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## Rules
|
|
311
|
+
- Always use `this.loadFragment()` (async) — `sap.ui.xmlfragment()` is deprecated
|
|
312
|
+
- `loadFragment` auto-prefixes IDs with view ID — use `this.byId("fragmentControlId")`
|
|
313
|
+
- `Fragment.load` requires manual `addDependent` for model inheritance
|
|
314
|
+
- Cache fragment promises (`this._pDialog`) — don't reload on every open
|
|
315
|
+
- Dialogs: always provide Cancel/Close action
|
|
316
|
+
- MessageBox for user decisions; MessageToast for quick confirmation
|
|
317
|
+
- SelectDialog for value help; TableSelectDialog for multi-column value help
|
|
318
|
+
- Use MessageManager for validation messages that integrate with Fiori message handling
|
|
319
|
+
|
|
320
|
+
## Anti-Patterns
|
|
321
|
+
| Anti-Pattern | Correct |
|
|
322
|
+
|---|---|
|
|
323
|
+
| `sap.ui.xmlfragment()` (sync, deprecated) | `this.loadFragment()` or `Fragment.load()` |
|
|
324
|
+
| Reloading fragment on every open | Cache: `if (!this._pDialog) { this._pDialog = ... }` |
|
|
325
|
+
| Fragment without `addDependent` (when using Fragment.load) | `oView.addDependent(oFragment)` for model inheritance |
|
|
326
|
+
| `alert()` or `console.log` for user feedback | MessageBox, MessageToast, MessageStrip |
|
|
327
|
+
| Dialog without Cancel button | Always provide escape path |
|
|
328
|
+
| `new Dialog()` in controller (programmatic) | Define in XML fragment, load async |
|
|
329
|
+
| Missing `growing` on SelectDialog | Use `growing="true"` for large datasets |
|
|
330
|
+
| Hardcoded text in MessageBox | Use i18n: `oBundle.getText("confirmDelete")` |
|