@abaplint/runtime 2.13.47 → 2.13.48
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/statements/modify_database.js +8 -2
- package/build/src/statements/select.js +20 -3
- package/build/src/types/data_reference.d.ts +1 -1
- package/build/src/types/decfloat34.d.ts +1 -1
- package/build/src/types/decfloat34.js +3 -0
- package/build/src/types/float.js +2 -1
- package/build/src/types/integer.d.ts +2 -1
- package/build/src/types/integer.js +2 -1
- package/build/src/types/integer8.d.ts +2 -1
- package/build/src/types/integer8.js +2 -1
- package/build/src/types/packed.js +2 -1
- package/package.json +2 -2
|
@@ -12,12 +12,18 @@ async function modifyDatabase(table, options, context) {
|
|
|
12
12
|
options.values = options.values.getPointer();
|
|
13
13
|
}
|
|
14
14
|
if (options.table) {
|
|
15
|
+
let subrc = 0;
|
|
16
|
+
let dbcnt = 0;
|
|
15
17
|
for (const row of options.table.array()) {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
+
const insertSubrc = await (0, insert_database_1.insertDatabase)(table, { values: row }, context);
|
|
19
|
+
if (insertSubrc !== 0) {
|
|
18
20
|
await (0, update_database_1.updateDatabase)(table, { from: row }, context);
|
|
19
21
|
}
|
|
22
|
+
subrc = Math.max(subrc, abap.builtin.sy.get().subrc.get());
|
|
23
|
+
dbcnt += abap.builtin.sy.get().dbcnt.get();
|
|
20
24
|
}
|
|
25
|
+
abap.builtin.sy.get().subrc.set(subrc);
|
|
26
|
+
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
21
27
|
}
|
|
22
28
|
else if (options.values) {
|
|
23
29
|
const subrc = await (0, insert_database_1.insertDatabase)(table, { values: options.values }, context);
|
|
@@ -59,7 +59,12 @@ function rowsToTarget(target, rows) {
|
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
const columnName = Object.keys(row)[0];
|
|
62
|
-
|
|
62
|
+
if (row[columnName] === null) {
|
|
63
|
+
targetRow.clear();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
targetRow.set(row[columnName]);
|
|
67
|
+
}
|
|
63
68
|
}
|
|
64
69
|
abap.statements.insertInternal({ table: target, data: targetRow, noClone: true });
|
|
65
70
|
}
|
|
@@ -67,12 +72,24 @@ function rowsToTarget(target, rows) {
|
|
|
67
72
|
else if (Array.isArray(target)) {
|
|
68
73
|
for (let index = 0; index < target.length; index++) {
|
|
69
74
|
const element = target[index];
|
|
70
|
-
|
|
75
|
+
const value = rows[0][Object.keys(rows[0])[index]];
|
|
76
|
+
if (value === null) {
|
|
77
|
+
element.clear();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
element.set(value);
|
|
81
|
+
}
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
84
|
else if (target !== undefined) {
|
|
74
85
|
// its a simple type
|
|
75
|
-
|
|
86
|
+
const value = rows[0][Object.keys(rows[0])[0]];
|
|
87
|
+
if (value === null) {
|
|
88
|
+
target.clear();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
target.set(value);
|
|
92
|
+
}
|
|
76
93
|
}
|
|
77
94
|
}
|
|
78
95
|
//# sourceMappingURL=select.js.map
|
|
@@ -23,7 +23,7 @@ export declare class DataReference {
|
|
|
23
23
|
get(): any;
|
|
24
24
|
array(): any;
|
|
25
25
|
getArrayLength(): any;
|
|
26
|
-
set(value: any): void | Table | Structure | ABAPObject | Float | Integer8 |
|
|
26
|
+
set(value: any): void | Table | Structure | ABAPObject | Float | Integer8 | DecFloat34 | this;
|
|
27
27
|
getOffset(input: {
|
|
28
28
|
offset?: number | INumeric | Hex;
|
|
29
29
|
length?: number | INumeric | Hex;
|
|
@@ -5,7 +5,7 @@ export declare class DecFloat34 {
|
|
|
5
5
|
private value;
|
|
6
6
|
constructor();
|
|
7
7
|
clone(): DecFloat34;
|
|
8
|
-
set(value: INumeric | ICharacter | Hex | string | number): this;
|
|
8
|
+
set(value: INumeric | ICharacter | Hex | string | number | DecFloat34): this;
|
|
9
9
|
clear(): void;
|
|
10
10
|
getRaw(): number;
|
|
11
11
|
get(): string;
|
package/build/src/types/float.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.Float = void 0;
|
|
|
4
4
|
const hex_1 = require("./hex");
|
|
5
5
|
const xstring_1 = require("./xstring");
|
|
6
6
|
const integer8_1 = require("./integer8");
|
|
7
|
+
const decfloat34_1 = require("./decfloat34");
|
|
7
8
|
/*
|
|
8
9
|
function getNumberParts(x: number) {
|
|
9
10
|
if(isNaN(x)) {
|
|
@@ -63,7 +64,7 @@ class Float {
|
|
|
63
64
|
else if (value instanceof integer8_1.Integer8) {
|
|
64
65
|
this.value = Number(value.get());
|
|
65
66
|
}
|
|
66
|
-
else if (value instanceof Float) {
|
|
67
|
+
else if (value instanceof Float || value instanceof decfloat34_1.DecFloat34) {
|
|
67
68
|
this.value = value.getRaw();
|
|
68
69
|
}
|
|
69
70
|
else if (value instanceof hex_1.Hex || value instanceof xstring_1.XString) {
|
|
@@ -2,6 +2,7 @@ import { Float } from "./float";
|
|
|
2
2
|
import { Hex } from "./hex";
|
|
3
3
|
import { ICharacter } from "./_character";
|
|
4
4
|
import { INumeric } from "./_numeric";
|
|
5
|
+
import { DecFloat34 } from "./decfloat34";
|
|
5
6
|
export declare const DIGITS: RegExp;
|
|
6
7
|
export declare const MAX_INTEGER = 2147483647;
|
|
7
8
|
export declare const MIN_INTEGER = -2147483648;
|
|
@@ -21,7 +22,7 @@ export declare class Integer implements INumeric {
|
|
|
21
22
|
getQualifiedName(): string | undefined;
|
|
22
23
|
clone(): Integer;
|
|
23
24
|
setConstant(): this;
|
|
24
|
-
set(value: INumeric | ICharacter | Hex | string | number | Integer | Float): this;
|
|
25
|
+
set(value: INumeric | ICharacter | Hex | string | number | Integer | Float | DecFloat34): this;
|
|
25
26
|
clear(): void;
|
|
26
27
|
get(): number;
|
|
27
28
|
}
|
|
@@ -10,6 +10,7 @@ const integer8_1 = require("./integer8");
|
|
|
10
10
|
const hex_uint8_1 = require("./hex_uint8");
|
|
11
11
|
const character_1 = require("./character");
|
|
12
12
|
const string_1 = require("./string");
|
|
13
|
+
const decfloat34_1 = require("./decfloat34");
|
|
13
14
|
exports.DIGITS = new RegExp(/^\s*-?\+?\d+\.?\d* *$/i);
|
|
14
15
|
exports.MAX_INTEGER = 2147483647;
|
|
15
16
|
exports.MIN_INTEGER = -2147483648;
|
|
@@ -80,7 +81,7 @@ class Integer {
|
|
|
80
81
|
else if (value instanceof integer8_1.Integer8) {
|
|
81
82
|
this.set(Number(value.get()));
|
|
82
83
|
}
|
|
83
|
-
else if (value instanceof float_1.Float) {
|
|
84
|
+
else if (value instanceof float_1.Float || value instanceof decfloat34_1.DecFloat34) {
|
|
84
85
|
this.set(Math.round(value.getRaw()));
|
|
85
86
|
}
|
|
86
87
|
else if (value instanceof hex_1.Hex || value instanceof xstring_1.XString || value instanceof hex_uint8_1.HexUInt8) {
|
|
@@ -3,6 +3,7 @@ import { Hex } from "./hex";
|
|
|
3
3
|
import { ICharacter } from "./_character";
|
|
4
4
|
import { INumeric } from "./_numeric";
|
|
5
5
|
import { Integer } from "./integer";
|
|
6
|
+
import { DecFloat34 } from "./decfloat34";
|
|
6
7
|
export declare class Integer8 {
|
|
7
8
|
private value;
|
|
8
9
|
private readonly qualifiedName;
|
|
@@ -11,7 +12,7 @@ export declare class Integer8 {
|
|
|
11
12
|
});
|
|
12
13
|
clone(): Integer8;
|
|
13
14
|
getQualifiedName(): string | undefined;
|
|
14
|
-
set(value: INumeric | ICharacter | Hex | string | number | bigint | Integer8 | Integer | Float): this;
|
|
15
|
+
set(value: INumeric | ICharacter | Hex | string | number | bigint | Integer8 | Integer | Float | DecFloat34): this;
|
|
15
16
|
clear(): void;
|
|
16
17
|
get(): bigint;
|
|
17
18
|
}
|
|
@@ -9,6 +9,7 @@ const integer_1 = require("./integer");
|
|
|
9
9
|
const get_bit_1 = require("../statements/get_bit");
|
|
10
10
|
const character_1 = require("./character");
|
|
11
11
|
const hex_uint8_1 = require("./hex_uint8");
|
|
12
|
+
const decfloat34_1 = require("./decfloat34");
|
|
12
13
|
const digits = new RegExp(/^\s*-?\+?\d+\.?\d* *$/i);
|
|
13
14
|
class Integer8 {
|
|
14
15
|
value;
|
|
@@ -45,7 +46,7 @@ class Integer8 {
|
|
|
45
46
|
}
|
|
46
47
|
this.value = BigInt(value);
|
|
47
48
|
}
|
|
48
|
-
else if (value instanceof float_1.Float) {
|
|
49
|
+
else if (value instanceof float_1.Float || value instanceof decfloat34_1.DecFloat34) {
|
|
49
50
|
this.set(Math.round(value.getRaw()));
|
|
50
51
|
}
|
|
51
52
|
else if (value instanceof hex_1.Hex || value instanceof xstring_1.XString || value instanceof hex_uint8_1.HexUInt8) {
|
|
@@ -4,6 +4,7 @@ exports.Packed = void 0;
|
|
|
4
4
|
const float_1 = require("./float");
|
|
5
5
|
const throw_error_1 = require("../throw_error");
|
|
6
6
|
const integer8_1 = require("./integer8");
|
|
7
|
+
const decfloat34_1 = require("./decfloat34");
|
|
7
8
|
const digits = new RegExp(/^\s*-?\+?\d*\.?\d*(?:E[+-]?\d+)? *$/i);
|
|
8
9
|
function pow10(exp) {
|
|
9
10
|
return 10n ** BigInt(exp);
|
|
@@ -110,7 +111,7 @@ class Packed {
|
|
|
110
111
|
else if (value instanceof integer8_1.Integer8) {
|
|
111
112
|
this.value = value.get() * pow10(this.decimals);
|
|
112
113
|
}
|
|
113
|
-
else if (value instanceof float_1.Float) {
|
|
114
|
+
else if (value instanceof float_1.Float || value instanceof decfloat34_1.DecFloat34) {
|
|
114
115
|
this.value = this.numberToScaled(value.getRaw());
|
|
115
116
|
}
|
|
116
117
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.48",
|
|
4
4
|
"description": "Transpiler - Runtime",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/chai": "^4.3.20",
|
|
33
33
|
"@types/mocha": "^10.0.10",
|
|
34
|
-
"@types/node": "^24.13.
|
|
34
|
+
"@types/node": "^24.13.3",
|
|
35
35
|
"chai": "^4.5.0",
|
|
36
36
|
"mocha": "^11.7.6",
|
|
37
37
|
"source-map-support": "^0.5.21",
|