@abaplint/runtime 1.7.15 → 1.7.16
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.
|
@@ -41,6 +41,9 @@ function describe(input) {
|
|
|
41
41
|
else if (input.field instanceof types_1.XString) {
|
|
42
42
|
input.type.set("y");
|
|
43
43
|
}
|
|
44
|
+
else if (input.field instanceof types_1.DecFloat34) {
|
|
45
|
+
input.type.set("e");
|
|
46
|
+
}
|
|
44
47
|
else if (input.field instanceof types_1.Structure) {
|
|
45
48
|
input.type.set("u");
|
|
46
49
|
}
|
|
@@ -4,23 +4,59 @@ exports.select = void 0;
|
|
|
4
4
|
const clone_1 = require("../clone");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
6
|
function select(target, select) {
|
|
7
|
-
var _a;
|
|
8
|
-
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
if (this.db === undefined) {
|
|
9
|
+
throw new Error("Runtime, database not initialized");
|
|
10
|
+
}
|
|
11
|
+
let res = undefined;
|
|
12
|
+
try {
|
|
13
|
+
res = this.db.exec(select);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
if (abap.Classes["CX_SY_DYNAMIC_OSQL_SEMANTICS"] !== undefined) {
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
throw new abap.Classes["CX_SY_DYNAMIC_OSQL_SEMANTICS"]();
|
|
20
|
+
}
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
9
23
|
target.clear();
|
|
10
|
-
if (target instanceof types_1.Structure
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
if (target instanceof types_1.Structure) {
|
|
25
|
+
if (((_a = res[0]) === null || _a === void 0 ? void 0 : _a.values[0]) === undefined) {
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const columns = res[0].columns;
|
|
31
|
+
const values = res[0].values[0];
|
|
32
|
+
const result = {};
|
|
33
|
+
for (const c of columns) {
|
|
34
|
+
result[c] = (0, clone_1.clone)(target.get()[c]).set(values.shift());
|
|
35
|
+
}
|
|
36
|
+
target.set(new types_1.Structure(result));
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
16
39
|
}
|
|
17
|
-
target.set(new types_1.Structure(result));
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
abap.builtin.sy.get().subrc.set(0);
|
|
20
40
|
}
|
|
21
|
-
else if (target instanceof types_1.
|
|
22
|
-
|
|
23
|
-
|
|
41
|
+
else if (target instanceof types_1.Table) {
|
|
42
|
+
if (((_b = res[0]) === null || _b === void 0 ? void 0 : _b.values[0]) === undefined) {
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
for (const selectRow of res[0].values) {
|
|
48
|
+
const targetRow = (0, clone_1.clone)(target.getRowType());
|
|
49
|
+
const values = selectRow;
|
|
50
|
+
for (const c of res[0].columns) {
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
(_c = targetRow.get()[c]) === null || _c === void 0 ? void 0 : _c.set(values.shift());
|
|
53
|
+
}
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
abap.statements.insertInternal({ table: target, data: targetRow });
|
|
56
|
+
}
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
59
|
+
}
|
|
24
60
|
}
|
|
25
61
|
else {
|
|
26
62
|
throw new Error("Runtime, SELECT todo");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.16",
|
|
4
4
|
"description": "Transpiler - Runtime",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/mocha": "^9.0.0",
|
|
36
36
|
"@types/sql.js": "^1.4.3",
|
|
37
37
|
"chai": "^4.3.4",
|
|
38
|
-
"mocha": "^9.1.
|
|
38
|
+
"mocha": "^9.1.4",
|
|
39
39
|
"source-map-support": "^0.5.21",
|
|
40
40
|
"typescript": "^4.5.4"
|
|
41
41
|
}
|