@abaplint/runtime 1.7.15 → 1.7.19
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/build/src/compare/index.d.ts +1 -0
- package/build/src/compare/index.js +1 -0
- package/build/src/compare/np.d.ts +3 -0
- package/build/src/compare/np.js +9 -0
- package/build/src/index.d.ts +1 -0
- package/build/src/index.js +1 -0
- package/build/src/statements/create_data.d.ts +5 -1
- package/build/src/statements/create_data.js +22 -2
- package/build/src/statements/describe.js +3 -0
- package/build/src/statements/select.d.ts +2 -2
- package/build/src/statements/select.js +54 -14
- package/package.json +2 -2
|
@@ -27,6 +27,7 @@ __exportStar(require("./lt"), exports);
|
|
|
27
27
|
__exportStar(require("./ne"), exports);
|
|
28
28
|
__exportStar(require("./na"), exports);
|
|
29
29
|
__exportStar(require("./ns"), exports);
|
|
30
|
+
__exportStar(require("./np"), exports);
|
|
30
31
|
var in_1 = require("./in");
|
|
31
32
|
Object.defineProperty(exports, "in", { enumerable: true, get: function () { return in_1.compareIn; } });
|
|
32
33
|
//# sourceMappingURL=index.js.map
|
package/build/src/index.d.ts
CHANGED
package/build/src/index.js
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { DataReference } from "../types";
|
|
2
|
-
export
|
|
2
|
+
export interface ICreateDataOptions {
|
|
3
|
+
table?: boolean;
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function createData(target: DataReference, options?: ICreateDataOptions): void;
|
|
@@ -2,8 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createData = void 0;
|
|
4
4
|
const clone_1 = require("../clone");
|
|
5
|
-
function createData(target) {
|
|
6
|
-
|
|
5
|
+
function createData(target, options) {
|
|
6
|
+
if ((options === null || options === void 0 ? void 0 : options.name) && (options === null || options === void 0 ? void 0 : options.table)) {
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
if (abap.DDIC[options.name] === undefined) {
|
|
9
|
+
// todo, throw exception
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
target.assign(new abap.types.Table(abap.DDIC[options.name].type));
|
|
14
|
+
}
|
|
15
|
+
else if (options === null || options === void 0 ? void 0 : options.name) {
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
if (abap.DDIC[options.name] === undefined) {
|
|
18
|
+
// todo, throw exception
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
target.assign((0, clone_1.clone)(abap.DDIC[options.name].type));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
target.assign((0, clone_1.clone)(target.getType()));
|
|
26
|
+
}
|
|
7
27
|
}
|
|
8
28
|
exports.createData = createData;
|
|
9
29
|
//# sourceMappingURL=create_data.js.map
|
|
@@ -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
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Structure, Table } from "../types";
|
|
2
|
-
export declare function select(target: Structure | Table, select: string): void;
|
|
1
|
+
import { FieldSymbol, Structure, Table } from "../types";
|
|
2
|
+
export declare function select(target: Structure | Table | FieldSymbol, select: string): void;
|
|
@@ -4,23 +4,63 @@ 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
target.set(new types_1.Structure(result));
|
|
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) {
|
|
18
16
|
// @ts-ignore
|
|
19
|
-
abap.
|
|
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;
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
if (target instanceof types_1.FieldSymbol) {
|
|
22
24
|
// @ts-ignore
|
|
23
|
-
|
|
25
|
+
target = target.getPointer();
|
|
26
|
+
}
|
|
27
|
+
target.clear();
|
|
28
|
+
if (target instanceof types_1.Structure) {
|
|
29
|
+
if (((_a = res[0]) === null || _a === void 0 ? void 0 : _a.values[0]) === undefined) {
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const columns = res[0].columns;
|
|
35
|
+
const values = res[0].values[0];
|
|
36
|
+
const result = {};
|
|
37
|
+
for (const c of columns) {
|
|
38
|
+
result[c] = (0, clone_1.clone)(target.get()[c]).set(values.shift());
|
|
39
|
+
}
|
|
40
|
+
target.set(new types_1.Structure(result));
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (target instanceof types_1.Table) {
|
|
46
|
+
if (((_b = res[0]) === null || _b === void 0 ? void 0 : _b.values[0]) === undefined) {
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
for (const selectRow of res[0].values) {
|
|
52
|
+
const targetRow = (0, clone_1.clone)(target.getRowType());
|
|
53
|
+
const values = selectRow;
|
|
54
|
+
for (const c of res[0].columns) {
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
(_c = targetRow.get()[c]) === null || _c === void 0 ? void 0 : _c.set(values.shift());
|
|
57
|
+
}
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
abap.statements.insertInternal({ table: target, data: targetRow });
|
|
60
|
+
}
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
63
|
+
}
|
|
24
64
|
}
|
|
25
65
|
else {
|
|
26
66
|
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.19",
|
|
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
|
}
|