@abaplint/runtime 2.11.6 → 2.11.8
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/ca.js +0 -2
- package/build/src/compare/co.js +0 -2
- package/build/src/compare/cs.js +0 -2
- package/build/src/dynamic_call_lookup.js +4 -8
- package/build/src/operators/div.d.ts +1 -1
- package/build/src/operators/divide.d.ts +1 -1
- package/build/src/operators/mod.d.ts +1 -1
- package/build/src/operators/multiply.d.ts +1 -1
- package/build/src/operators/power.d.ts +1 -1
- package/build/src/prefix.js +0 -3
- package/build/src/statements/append.js +0 -2
- package/build/src/statements/assign.js +0 -14
- package/build/src/statements/call_function.js +0 -1
- package/build/src/statements/call_transaction.js +0 -6
- package/build/src/statements/cast.js +0 -2
- package/build/src/statements/create_data.js +0 -14
- package/build/src/statements/delete_database.js +0 -4
- package/build/src/statements/delete_internal.js +0 -3
- package/build/src/statements/describe.js +0 -1
- package/build/src/statements/fetch_next_cursor.js +0 -2
- package/build/src/statements/find.js +0 -3
- package/build/src/statements/get_parameter.js +0 -1
- package/build/src/statements/insert_database.js +0 -6
- package/build/src/statements/insert_internal.js +0 -4
- package/build/src/statements/loop.js +0 -3
- package/build/src/statements/message.js +0 -4
- package/build/src/statements/modify_internal.js +0 -1
- package/build/src/statements/read_report.js +0 -1
- package/build/src/statements/read_table.js +0 -2
- package/build/src/statements/replace.js +0 -2
- package/build/src/statements/select.js +0 -7
- package/build/src/statements/update_database.js +0 -3
- package/build/src/throw_error.js +1 -2
- package/build/src/types/data_reference.d.ts +1 -1
- package/build/src/types/field_symbol.d.ts +1 -1
- package/build/src/types/field_symbol.js +0 -3
- package/build/src/types/table.js +0 -2
- package/package.json +1 -1
package/build/src/compare/ca.js
CHANGED
|
@@ -32,13 +32,11 @@ function ca(left, right) {
|
|
|
32
32
|
let fdpos = 0;
|
|
33
33
|
for (const c of l) {
|
|
34
34
|
if (r.includes(c) === true) {
|
|
35
|
-
// @ts-ignore
|
|
36
35
|
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
37
36
|
return true;
|
|
38
37
|
}
|
|
39
38
|
fdpos++;
|
|
40
39
|
}
|
|
41
|
-
// @ts-ignore
|
|
42
40
|
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
43
41
|
return false;
|
|
44
42
|
}
|
package/build/src/compare/co.js
CHANGED
|
@@ -23,13 +23,11 @@ function co(left, right) {
|
|
|
23
23
|
let fdpos = 0;
|
|
24
24
|
for (const c of l) {
|
|
25
25
|
if (r.includes(c) === false) {
|
|
26
|
-
// @ts-ignore
|
|
27
26
|
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
28
27
|
return false;
|
|
29
28
|
}
|
|
30
29
|
fdpos++;
|
|
31
30
|
}
|
|
32
|
-
// @ts-ignore
|
|
33
31
|
abap.builtin.sy.get().fdpos.set(fdpos);
|
|
34
32
|
return true;
|
|
35
33
|
}
|
package/build/src/compare/cs.js
CHANGED
|
@@ -24,12 +24,10 @@ function cs(left, right) {
|
|
|
24
24
|
r = r.toUpperCase();
|
|
25
25
|
const index = l.indexOf(r);
|
|
26
26
|
if (index < 0) {
|
|
27
|
-
// @ts-ignore
|
|
28
27
|
abap.builtin.sy.get().fdpos.set(l.length);
|
|
29
28
|
return false;
|
|
30
29
|
}
|
|
31
30
|
else {
|
|
32
|
-
// @ts-ignore
|
|
33
31
|
abap.builtin.sy.get().fdpos.set(index);
|
|
34
32
|
return true;
|
|
35
33
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dynamicCallLookup = dynamicCallLookup;
|
|
4
|
+
const throw_error_1 = require("./throw_error");
|
|
4
5
|
function dynamicCallLookup(obj, methodName) {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
let name = typeof methodName === "string" ? methodName : methodName.get().toLowerCase().trimEnd();
|
|
7
|
+
name = name.replaceAll("~", "$").replaceAll("/", "$");
|
|
7
8
|
let ret = obj[name];
|
|
8
9
|
if (ret !== undefined) {
|
|
9
10
|
ret = ret.bind(obj);
|
|
@@ -14,12 +15,7 @@ function dynamicCallLookup(obj, methodName) {
|
|
|
14
15
|
ret = obj.FRIENDS_ACCESS_INSTANCE[name];
|
|
15
16
|
}
|
|
16
17
|
if (ret === undefined) {
|
|
17
|
-
|
|
18
|
-
if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'] === undefined) {
|
|
19
|
-
throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found";
|
|
20
|
-
}
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD']();
|
|
18
|
+
(0, throw_error_1.throwError)("CX_SY_DYN_CALL_ILLEGAL_METHOD");
|
|
23
19
|
}
|
|
24
20
|
return ret;
|
|
25
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Integer, Integer8 } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function div(left: INumeric | ICharacter | Integer8 | string | number, right: INumeric | Integer8 | ICharacter | string | number):
|
|
4
|
+
export declare function div(left: INumeric | ICharacter | Integer8 | string | number, right: INumeric | Integer8 | ICharacter | string | number): Integer8 | Integer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Float, Integer, Integer8 } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function divide(left: INumeric | ICharacter | Integer8 | string | number, right: INumeric | ICharacter | Integer8 | string | number):
|
|
4
|
+
export declare function divide(left: INumeric | ICharacter | Integer8 | string | number, right: INumeric | ICharacter | Integer8 | string | number): Float | Integer8 | Integer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Integer, Integer8 } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function mod(left: INumeric | ICharacter | string | Integer8 | number, right: INumeric | Integer8 | ICharacter | string | number):
|
|
4
|
+
export declare function mod(left: INumeric | ICharacter | string | Integer8 | number, right: INumeric | Integer8 | ICharacter | string | number): Integer8 | Integer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Float, Integer, Integer8 } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function multiply(left: INumeric | ICharacter | string | Integer8 | number, right: INumeric | ICharacter | string | Integer8 | number):
|
|
4
|
+
export declare function multiply(left: INumeric | ICharacter | string | Integer8 | number, right: INumeric | ICharacter | string | Integer8 | number): Float | Integer8 | Integer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Float, Integer8 } from "../types";
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function power(left: INumeric | ICharacter | Integer8 | string | number, right: INumeric | ICharacter | Integer8 | string | number):
|
|
4
|
+
export declare function power(left: INumeric | ICharacter | Integer8 | string | number, right: INumeric | ICharacter | Integer8 | string | number): Float | Integer8;
|
package/build/src/prefix.js
CHANGED
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildDbTableName = buildDbTableName;
|
|
4
4
|
function buildDbTableName(table) {
|
|
5
|
-
// @ts-ignore
|
|
6
5
|
let ret = `"${abap.dbo.tablePrefix + table.trimEnd().toLowerCase()}"`;
|
|
7
|
-
// @ts-ignore
|
|
8
6
|
if (abap.dbo.schemaPrefix !== "") {
|
|
9
|
-
// @ts-ignore
|
|
10
7
|
ret = `"${abap.dbo.schemaPrefix}".` + ret;
|
|
11
8
|
}
|
|
12
9
|
return ret;
|
|
@@ -18,7 +18,6 @@ function append(input) {
|
|
|
18
18
|
throw "APPEND, header, table";
|
|
19
19
|
}
|
|
20
20
|
input.source.append(input.source.getHeader());
|
|
21
|
-
// @ts-ignore
|
|
22
21
|
abap.builtin.sy.get().tabix.set(input.source.array().length);
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
@@ -60,7 +59,6 @@ function append(input) {
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
|
-
// @ts-ignore
|
|
64
62
|
abap.builtin.sy.get().tabix.set(input.target.array().length);
|
|
65
63
|
}
|
|
66
64
|
//# sourceMappingURL=append.js.map
|
|
@@ -22,7 +22,6 @@ function assign(input) {
|
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
const source = input.dynamicSource.get();
|
|
24
24
|
if (source === undefined) {
|
|
25
|
-
// @ts-ignore
|
|
26
25
|
abap.builtin.sy.get().subrc.set(4);
|
|
27
26
|
return;
|
|
28
27
|
}
|
|
@@ -31,40 +30,33 @@ function assign(input) {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
else {
|
|
34
|
-
// @ts-ignore
|
|
35
33
|
abap.builtin.sy.get().subrc.set(4);
|
|
36
34
|
return;
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
else if (input.dynamicName.includes("=>")) {
|
|
40
38
|
const split = input.dynamicName.split("=>");
|
|
41
|
-
// @ts-ignore
|
|
42
39
|
const clas = abap.Classes[split[0].toUpperCase()];
|
|
43
40
|
if (clas === undefined) {
|
|
44
|
-
// @ts-ignore
|
|
45
41
|
abap.builtin.sy.get().subrc.set(4);
|
|
46
42
|
return;
|
|
47
43
|
}
|
|
48
44
|
if (clas[split[1].toLowerCase()] !== undefined) {
|
|
49
45
|
input.target.assign(clas[split[1].toLowerCase()]);
|
|
50
|
-
// @ts-ignore
|
|
51
46
|
abap.builtin.sy.get().subrc.set(0);
|
|
52
47
|
return;
|
|
53
48
|
}
|
|
54
49
|
else if (clas[split[0].toLowerCase() + "$" + split[1].toLowerCase()] !== undefined) {
|
|
55
50
|
input.target.assign(clas[split[0].toLowerCase() + "$" + split[1].toLowerCase()]);
|
|
56
|
-
// @ts-ignore
|
|
57
51
|
abap.builtin.sy.get().subrc.set(0);
|
|
58
52
|
return;
|
|
59
53
|
}
|
|
60
54
|
}
|
|
61
55
|
if (input.dynamicSource) {
|
|
62
56
|
input.target.assign(input.dynamicSource);
|
|
63
|
-
// @ts-ignore
|
|
64
57
|
abap.builtin.sy.get().subrc.set(0);
|
|
65
58
|
}
|
|
66
59
|
else {
|
|
67
|
-
// @ts-ignore
|
|
68
60
|
abap.builtin.sy.get().subrc.set(4);
|
|
69
61
|
}
|
|
70
62
|
}
|
|
@@ -76,7 +68,6 @@ function assign(input) {
|
|
|
76
68
|
}
|
|
77
69
|
else if (!(input.source instanceof types_1.Structure)
|
|
78
70
|
&& !(input.source instanceof types_1.Table)) {
|
|
79
|
-
// @ts-ignore
|
|
80
71
|
abap.builtin.sy.get().subrc.set(4);
|
|
81
72
|
return;
|
|
82
73
|
}
|
|
@@ -113,12 +104,10 @@ function assign(input) {
|
|
|
113
104
|
}
|
|
114
105
|
if (result === undefined) {
|
|
115
106
|
// not a field in the structure
|
|
116
|
-
// @ts-ignore
|
|
117
107
|
abap.builtin.sy.get().subrc.set(4);
|
|
118
108
|
}
|
|
119
109
|
else {
|
|
120
110
|
input.target.assign(result);
|
|
121
|
-
// @ts-ignore
|
|
122
111
|
abap.builtin.sy.get().subrc.set(0);
|
|
123
112
|
}
|
|
124
113
|
}
|
|
@@ -130,11 +119,9 @@ function assign(input) {
|
|
|
130
119
|
throw new Error("GETWA_NOT_ASSIGNED");
|
|
131
120
|
}
|
|
132
121
|
input.target.assign(pnt);
|
|
133
|
-
// @ts-ignore
|
|
134
122
|
abap.builtin.sy.get().subrc.set(0);
|
|
135
123
|
}
|
|
136
124
|
else if (input.source === undefined) {
|
|
137
|
-
// @ts-ignore
|
|
138
125
|
abap.builtin.sy.get().subrc.set(4);
|
|
139
126
|
}
|
|
140
127
|
else {
|
|
@@ -147,7 +134,6 @@ function assign(input) {
|
|
|
147
134
|
}
|
|
148
135
|
input.target.assign(input.source);
|
|
149
136
|
}
|
|
150
|
-
// @ts-ignore
|
|
151
137
|
abap.builtin.sy.get().subrc.set(0);
|
|
152
138
|
}
|
|
153
139
|
}
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.callTransaction = callTransaction;
|
|
4
4
|
function callTransaction() {
|
|
5
|
-
// @ts-ignore
|
|
6
5
|
abap.builtin.sy.get().subrc.set(4);
|
|
7
|
-
// @ts-ignore
|
|
8
6
|
abap.builtin.sy.get().msgid.set("00");
|
|
9
|
-
// @ts-ignore
|
|
10
7
|
abap.builtin.sy.get().msgty.set("E");
|
|
11
|
-
// @ts-ignore
|
|
12
8
|
abap.builtin.sy.get().msgno.set("000");
|
|
13
|
-
// @ts-ignore
|
|
14
9
|
abap.builtin.sy.get().msgv1.set("CALL TRANSACTION");
|
|
15
|
-
// @ts-ignore
|
|
16
10
|
abap.builtin.sy.get().msgv2.set("not supported in open-abap");
|
|
17
11
|
}
|
|
18
12
|
//# sourceMappingURL=call_transaction.js.map
|
|
@@ -28,11 +28,9 @@ async function cast(target, source) {
|
|
|
28
28
|
if (target.getQualifiedName) {
|
|
29
29
|
targetName = target.getQualifiedName()?.toUpperCase();
|
|
30
30
|
}
|
|
31
|
-
// @ts-ignore
|
|
32
31
|
let targetClass = abap.Classes[targetName];
|
|
33
32
|
if (targetClass === undefined) {
|
|
34
33
|
// todo, for unit testing,
|
|
35
|
-
// @ts-ignore
|
|
36
34
|
targetClass = abap.Classes["PROG-ZFOOBAR-" + targetName];
|
|
37
35
|
}
|
|
38
36
|
if (targetClass?.INTERNAL_TYPE === "CLAS") {
|
|
@@ -12,7 +12,6 @@ function createData(target, options) {
|
|
|
12
12
|
throw new Error("CREATE_DATA_REFERENCE_EXPECTED");
|
|
13
13
|
}
|
|
14
14
|
if (options?.name && options?.table) {
|
|
15
|
-
// @ts-ignore
|
|
16
15
|
if (abap.DDIC[options.name.trimEnd()] === undefined) {
|
|
17
16
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
18
17
|
}
|
|
@@ -20,27 +19,21 @@ function createData(target, options) {
|
|
|
20
19
|
target.assign(new abap.types.Table(abap.DDIC[options.name.trimEnd()].type));
|
|
21
20
|
}
|
|
22
21
|
else if (options?.name) {
|
|
23
|
-
// @ts-ignore
|
|
24
22
|
if (abap.DDIC[options.name.trimEnd()]) {
|
|
25
|
-
// @ts-ignore
|
|
26
23
|
target.assign(abap.DDIC[options.name.trimEnd()].type.clone());
|
|
27
24
|
}
|
|
28
25
|
else if (options.name.includes("=>")) {
|
|
29
26
|
const [className, typeName] = options.name.trimEnd().toUpperCase().split("=>");
|
|
30
|
-
// @ts-ignore
|
|
31
27
|
if (abap.Classes[className] === undefined) {
|
|
32
28
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
33
29
|
}
|
|
34
|
-
// @ts-ignore
|
|
35
30
|
if (abap.Classes[className][typeName.toLowerCase()] === undefined) {
|
|
36
31
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
37
32
|
}
|
|
38
|
-
// @ts-ignore
|
|
39
33
|
target.assign(abap.Classes[className][typeName.toLowerCase()].clone());
|
|
40
34
|
}
|
|
41
35
|
else if (options.name.startsWith("\\TYPE=%")) {
|
|
42
36
|
// currently, only the runtime knows the references to the anonymous types
|
|
43
|
-
// @ts-ignore
|
|
44
37
|
const clas = abap.Classes["KERNEL_CREATE_DATA_HANDLE"];
|
|
45
38
|
if (clas === undefined) {
|
|
46
39
|
throw new Error("CreateData, kernel class missing");
|
|
@@ -76,11 +69,9 @@ function createData(target, options) {
|
|
|
76
69
|
target.assign(new types_1.Integer8());
|
|
77
70
|
}
|
|
78
71
|
else if (options.refTo === true) {
|
|
79
|
-
// @ts-ignore
|
|
80
72
|
if (abap.Classes[options.name.toUpperCase()] === undefined) {
|
|
81
73
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
82
74
|
}
|
|
83
|
-
// @ts-ignore
|
|
84
75
|
target.assign(new abap.types.ABAPObject({ qualifiedName: options.name, RTTIName: options.name }));
|
|
85
76
|
}
|
|
86
77
|
else {
|
|
@@ -158,22 +149,17 @@ function createData(target, options) {
|
|
|
158
149
|
target.assign(new types_1.UTCLong());
|
|
159
150
|
break;
|
|
160
151
|
default:
|
|
161
|
-
// @ts-ignore
|
|
162
152
|
if (abap.DDIC[options.typeName.trimEnd()]) {
|
|
163
|
-
// @ts-ignore
|
|
164
153
|
target.assign(abap.DDIC[options.typeName.trimEnd()].type.clone());
|
|
165
154
|
}
|
|
166
155
|
else if (options.typeName.includes("=>")) {
|
|
167
156
|
const [className, typeName] = options.typeName.toUpperCase().split("=>");
|
|
168
|
-
// @ts-ignore
|
|
169
157
|
if (abap.Classes[className] === undefined) {
|
|
170
158
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
171
159
|
}
|
|
172
|
-
// @ts-ignore
|
|
173
160
|
if (abap.Classes[className][typeName.toLowerCase().trimEnd()] === undefined) {
|
|
174
161
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
175
162
|
}
|
|
176
|
-
// @ts-ignore
|
|
177
163
|
target.assign(abap.Classes[className][typeName.toLowerCase().trimEnd()].clone());
|
|
178
164
|
}
|
|
179
165
|
else {
|
|
@@ -31,9 +31,7 @@ async function deleteDatabase(table, options, context) {
|
|
|
31
31
|
table: (0, prefix_1.buildDbTableName)(table),
|
|
32
32
|
where,
|
|
33
33
|
});
|
|
34
|
-
// @ts-ignore
|
|
35
34
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
36
|
-
// @ts-ignore
|
|
37
35
|
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
38
36
|
}
|
|
39
37
|
else {
|
|
@@ -41,9 +39,7 @@ async function deleteDatabase(table, options, context) {
|
|
|
41
39
|
table: (0, prefix_1.buildDbTableName)(table),
|
|
42
40
|
where: options.where || "",
|
|
43
41
|
});
|
|
44
|
-
// @ts-ignore
|
|
45
42
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
46
|
-
// @ts-ignore
|
|
47
43
|
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
48
44
|
}
|
|
49
45
|
}
|
|
@@ -22,13 +22,11 @@ async function deleteInternal(target, options) {
|
|
|
22
22
|
throw new Error("TABLE_INVALID_INDEX");
|
|
23
23
|
}
|
|
24
24
|
if (target.array()[options.index.get() - 1] === undefined) {
|
|
25
|
-
// @ts-ignore
|
|
26
25
|
abap.builtin.sy.get().subrc.set(4);
|
|
27
26
|
return;
|
|
28
27
|
}
|
|
29
28
|
else {
|
|
30
29
|
target.deleteIndex(options.index.get() - 1);
|
|
31
|
-
// @ts-ignore
|
|
32
30
|
abap.builtin.sy.get().subrc.set(0);
|
|
33
31
|
return;
|
|
34
32
|
}
|
|
@@ -78,7 +76,6 @@ async function deleteInternal(target, options) {
|
|
|
78
76
|
return;
|
|
79
77
|
}
|
|
80
78
|
for await (const i of (0, loop_1.loop)(target)) {
|
|
81
|
-
// @ts-ignore
|
|
82
79
|
index = abap.builtin.sy.get().tabix.get() - 1;
|
|
83
80
|
if (options?.where) {
|
|
84
81
|
const row = i instanceof types_1.Structure ? i.get() : { table_line: i };
|
|
@@ -16,11 +16,9 @@ async function fetchNextCursor(context, cursor, target, packageSize) {
|
|
|
16
16
|
}
|
|
17
17
|
const result = await context.cursors[cursor].fetchNextCursor(packageSize);
|
|
18
18
|
if (result.rows.length === 0) {
|
|
19
|
-
// @ts-ignore
|
|
20
19
|
abap.builtin.sy.get().subrc.set(4);
|
|
21
20
|
return;
|
|
22
21
|
}
|
|
23
|
-
// @ts-ignore
|
|
24
22
|
abap.builtin.sy.get().subrc.set(0);
|
|
25
23
|
(0, select_1.rowsToTarget)(target, result.rows);
|
|
26
24
|
}
|
|
@@ -15,7 +15,6 @@ function find(input, options) {
|
|
|
15
15
|
s = s.get();
|
|
16
16
|
}
|
|
17
17
|
if (s === "") {
|
|
18
|
-
// @ts-ignore
|
|
19
18
|
abap.builtin.sy.get().subrc.set(0);
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
@@ -117,11 +116,9 @@ function find(input, options) {
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
if (matches.length === 0) {
|
|
120
|
-
// @ts-ignore
|
|
121
119
|
abap.builtin.sy.get().subrc.set(4);
|
|
122
120
|
}
|
|
123
121
|
else {
|
|
124
|
-
// @ts-ignore
|
|
125
122
|
abap.builtin.sy.get().subrc.set(0);
|
|
126
123
|
}
|
|
127
124
|
if (matches[0]?.index !== undefined) {
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getParameter = getParameter;
|
|
4
4
|
function getParameter(_source, _target) {
|
|
5
5
|
// todo, additional logic? call ABAP kernel class?
|
|
6
|
-
// @ts-ignore
|
|
7
6
|
abap.builtin.sy.get().subrc.set(4);
|
|
8
7
|
}
|
|
9
8
|
//# sourceMappingURL=get_parameter.js.map
|
|
@@ -25,14 +25,10 @@ async function insertDatabase(table, options, context) {
|
|
|
25
25
|
let dbcnt = 0;
|
|
26
26
|
for (const row of options.table.array()) {
|
|
27
27
|
await insertDatabase(table, { values: row, connection: options.connection }, context);
|
|
28
|
-
// @ts-ignore
|
|
29
28
|
subrc = Math.max(subrc, abap.builtin.sy.get().subrc.get());
|
|
30
|
-
// @ts-ignore
|
|
31
29
|
dbcnt += abap.builtin.sy.get().dbcnt.get();
|
|
32
30
|
}
|
|
33
|
-
// @ts-ignore
|
|
34
31
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
35
|
-
// @ts-ignore
|
|
36
32
|
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
37
33
|
return;
|
|
38
34
|
}
|
|
@@ -58,9 +54,7 @@ async function insertDatabase(table, options, context) {
|
|
|
58
54
|
columns,
|
|
59
55
|
values,
|
|
60
56
|
});
|
|
61
|
-
// @ts-ignore
|
|
62
57
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
63
|
-
// @ts-ignore
|
|
64
58
|
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
65
59
|
return subrc;
|
|
66
60
|
}
|
|
@@ -60,9 +60,7 @@ function insertInternal(options) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
(0, read_table_1.readTable)(options.table, { withKey: compare, withKeyValue: withKeyValue, binarySearch: binary });
|
|
63
|
-
// @ts-ignore
|
|
64
63
|
if (abap.builtin.sy.get().subrc.get() === 0) {
|
|
65
|
-
// @ts-ignore
|
|
66
64
|
abap.builtin.sy.get().subrc.set(4);
|
|
67
65
|
return;
|
|
68
66
|
}
|
|
@@ -119,7 +117,6 @@ function insertInternal(options) {
|
|
|
119
117
|
if (options.referenceInto) {
|
|
120
118
|
options.referenceInto.assign(val);
|
|
121
119
|
}
|
|
122
|
-
// @ts-ignore
|
|
123
120
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
124
121
|
return;
|
|
125
122
|
}
|
|
@@ -133,7 +130,6 @@ function insertInternal(options) {
|
|
|
133
130
|
options.referenceInto.assign(val);
|
|
134
131
|
}
|
|
135
132
|
}
|
|
136
|
-
// @ts-ignore
|
|
137
133
|
abap.builtin.sy.get().subrc.set(0);
|
|
138
134
|
if (isSorted && !(options.table instanceof types_1.HashedTable)) {
|
|
139
135
|
// slow, but works for now
|
|
@@ -77,7 +77,6 @@ async function* loop(table, options) {
|
|
|
77
77
|
}
|
|
78
78
|
const length = table.getArrayLength();
|
|
79
79
|
if (length === 0) {
|
|
80
|
-
// @ts-ignore
|
|
81
80
|
abap.builtin.sy.get().subrc.set(4);
|
|
82
81
|
return;
|
|
83
82
|
}
|
|
@@ -109,7 +108,6 @@ async function* loop(table, options) {
|
|
|
109
108
|
continue;
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
|
-
// @ts-ignore
|
|
113
111
|
abap.builtin.sy.get().tabix.set(loopController.index + 1);
|
|
114
112
|
entered = true;
|
|
115
113
|
yield current;
|
|
@@ -122,7 +120,6 @@ async function* loop(table, options) {
|
|
|
122
120
|
}
|
|
123
121
|
finally {
|
|
124
122
|
table.unregisterLoop(loopController);
|
|
125
|
-
// @ts-ignore
|
|
126
123
|
abap.builtin.sy.get().subrc.set(entered ? 0 : 4);
|
|
127
124
|
}
|
|
128
125
|
}
|
|
@@ -17,7 +17,6 @@ function replace(text, w) {
|
|
|
17
17
|
}
|
|
18
18
|
const field = "msgv" + (i + 1);
|
|
19
19
|
if (i <= 3) {
|
|
20
|
-
// @ts-ignore
|
|
21
20
|
abap.builtin.sy.get()[field].set(replace);
|
|
22
21
|
}
|
|
23
22
|
text = text.replace(search, replace);
|
|
@@ -65,15 +64,12 @@ class MessageStatement {
|
|
|
65
64
|
msgty = msgty.get();
|
|
66
65
|
}
|
|
67
66
|
msgty = msgty?.toUpperCase();
|
|
68
|
-
// @ts-ignore
|
|
69
67
|
abap.builtin.sy.get().msgid.set(arbgb || "");
|
|
70
68
|
let msgnr = options.number;
|
|
71
69
|
if (msgnr !== undefined && typeof msgnr !== "string") {
|
|
72
70
|
msgnr = msgnr.get();
|
|
73
71
|
}
|
|
74
|
-
// @ts-ignore
|
|
75
72
|
abap.builtin.sy.get().msgno.set(msgnr || "");
|
|
76
|
-
// @ts-ignore
|
|
77
73
|
abap.builtin.sy.get().msgty.set(msgty);
|
|
78
74
|
let replaced = "";
|
|
79
75
|
if (options.text) {
|
|
@@ -47,7 +47,6 @@ function modifyInternal(table, options) {
|
|
|
47
47
|
(0, insert_internal_1.insertInternal)({ table, data: options.from });
|
|
48
48
|
}
|
|
49
49
|
const subrc = found ? 0 : 4;
|
|
50
|
-
// @ts-ignore
|
|
51
50
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
52
51
|
}
|
|
53
52
|
//# sourceMappingURL=modify_internal.js.map
|
|
@@ -262,9 +262,7 @@ function readTable(table, options) {
|
|
|
262
262
|
&& (options?.binarySearch === true || options?.keyName !== undefined)) {
|
|
263
263
|
subrc = 8;
|
|
264
264
|
}
|
|
265
|
-
// @ts-ignore
|
|
266
265
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
267
|
-
// @ts-ignore
|
|
268
266
|
abap.builtin.sy.get().tabix.set(foundIndex);
|
|
269
267
|
if (found) {
|
|
270
268
|
if (options.into) {
|
|
@@ -36,7 +36,6 @@ function replace(input) {
|
|
|
36
36
|
const before = input.target.getOffset({ length: input.sectionOffset });
|
|
37
37
|
const after = input.target.getOffset({ offset: input.sectionLength.get() + input.sectionOffset.get() });
|
|
38
38
|
(0, concatenate_1.concatenate)({ source: [before, input.with, after], target: input.target });
|
|
39
|
-
// @ts-ignore
|
|
40
39
|
abap.builtin.sy.get().subrc.set(0);
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
@@ -75,7 +74,6 @@ function replace(input) {
|
|
|
75
74
|
}
|
|
76
75
|
temp = temp.replace(search, rr);
|
|
77
76
|
const subrc = found ? 0 : 4;
|
|
78
|
-
// @ts-ignore
|
|
79
77
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
80
78
|
input.target.set(temp);
|
|
81
79
|
}
|
|
@@ -21,22 +21,17 @@ async function select(target, input, runtimeOptions, context) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
if (rows.length === 0) {
|
|
24
|
-
// @ts-ignore
|
|
25
24
|
abap.builtin.sy.get().dbcnt.set(0);
|
|
26
|
-
// @ts-ignore
|
|
27
25
|
abap.builtin.sy.get().subrc.set(4);
|
|
28
26
|
return;
|
|
29
27
|
}
|
|
30
28
|
rowsToTarget(target, rows);
|
|
31
29
|
if (target === undefined && rows.length === 1) {
|
|
32
|
-
// @ts-ignore
|
|
33
30
|
abap.builtin.sy.get().dbcnt.set(Object.values(rows[0])[0]);
|
|
34
31
|
}
|
|
35
32
|
else {
|
|
36
|
-
// @ts-ignore
|
|
37
33
|
abap.builtin.sy.get().dbcnt.set(rows.length);
|
|
38
34
|
}
|
|
39
|
-
// @ts-ignore
|
|
40
35
|
abap.builtin.sy.get().subrc.set(0);
|
|
41
36
|
}
|
|
42
37
|
function rowsToTarget(target, rows) {
|
|
@@ -48,7 +43,6 @@ function rowsToTarget(target, rows) {
|
|
|
48
43
|
}
|
|
49
44
|
result[column] = target.get()[column].clone().set(rows[0][column]);
|
|
50
45
|
}
|
|
51
|
-
// @ts-ignore
|
|
52
46
|
abap.statements.moveCorresponding(new types_1.Structure(result), target);
|
|
53
47
|
}
|
|
54
48
|
else if (target instanceof types_1.Table || target instanceof types_1.HashedTable) {
|
|
@@ -69,7 +63,6 @@ function rowsToTarget(target, rows) {
|
|
|
69
63
|
const columnName = Object.keys(row)[0];
|
|
70
64
|
targetRow.set(row[columnName]);
|
|
71
65
|
}
|
|
72
|
-
// @ts-ignore
|
|
73
66
|
abap.statements.insertInternal({ table: target, data: targetRow, noClone: true });
|
|
74
67
|
}
|
|
75
68
|
}
|
|
@@ -14,7 +14,6 @@ async function updateDatabase(table, options, context) {
|
|
|
14
14
|
if (typeof table !== "string") {
|
|
15
15
|
table = table.get();
|
|
16
16
|
}
|
|
17
|
-
// @ts-ignore
|
|
18
17
|
const keys = abap.DDIC[table.toUpperCase()].keyFields;
|
|
19
18
|
const where = [];
|
|
20
19
|
const set = [];
|
|
@@ -44,9 +43,7 @@ async function updateDatabase(table, options, context) {
|
|
|
44
43
|
where: where.join(" AND "),
|
|
45
44
|
set,
|
|
46
45
|
});
|
|
47
|
-
// @ts-ignore
|
|
48
46
|
abap.builtin.sy.get().subrc.set(subrc);
|
|
49
|
-
// @ts-ignore
|
|
50
47
|
abap.builtin.sy.get().dbcnt.set(dbcnt);
|
|
51
48
|
return subrc;
|
|
52
49
|
}
|
package/build/src/throw_error.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.throwError = throwError;
|
|
4
|
+
// todo: add possibility to pass parameters to the exception constructor
|
|
4
5
|
function throwError(name) {
|
|
5
|
-
// @ts-ignore
|
|
6
6
|
if (abap.Classes[name] !== undefined) {
|
|
7
|
-
// @ts-ignore
|
|
8
7
|
throw new abap.Classes[name]();
|
|
9
8
|
}
|
|
10
9
|
else {
|
|
@@ -22,7 +22,7 @@ export declare class DataReference {
|
|
|
22
22
|
get(): any;
|
|
23
23
|
array(): any;
|
|
24
24
|
getArrayLength(): any;
|
|
25
|
-
set(value: any): void |
|
|
25
|
+
set(value: any): void | Table | Structure | ABAPObject | Float | Integer8 | this;
|
|
26
26
|
getOffset(input: {
|
|
27
27
|
offset?: number | INumeric | Hex;
|
|
28
28
|
length?: number | INumeric | Hex;
|
|
@@ -18,7 +18,7 @@ export declare class FieldSymbol {
|
|
|
18
18
|
unassign(): void;
|
|
19
19
|
isAssigned(): boolean;
|
|
20
20
|
getPointer(): any;
|
|
21
|
-
dereference(): INumeric |
|
|
21
|
+
dereference(): INumeric | Table | ICharacter | Structure | ABAPObject | Float | import("./integer8").Integer8 | undefined;
|
|
22
22
|
clear(): void | Structure | undefined;
|
|
23
23
|
get(): any;
|
|
24
24
|
appendInitial(): import("./table").TableRowType | undefined;
|
|
@@ -65,19 +65,16 @@ class FieldSymbol {
|
|
|
65
65
|
return buf.toString("hex").toUpperCase();
|
|
66
66
|
}
|
|
67
67
|
else {
|
|
68
|
-
// @ts-ignore
|
|
69
68
|
const ret = new string_1.String().set(Buffer.from(this.pointer?.get(), "utf16le").toString("hex"));
|
|
70
69
|
return ret.get();
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
else {
|
|
74
|
-
// @ts-ignore
|
|
75
73
|
const ret = new string_1.String().set(Buffer.from(this.pointer?.get(), "hex").toString("utf16le"));
|
|
76
74
|
return ret.get();
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
else {
|
|
80
|
-
// @ts-ignore
|
|
81
78
|
return this.pointer?.get();
|
|
82
79
|
}
|
|
83
80
|
}
|
package/build/src/types/table.js
CHANGED
|
@@ -12,7 +12,6 @@ const sort_1 = require("../statements/sort");
|
|
|
12
12
|
const character_1 = require("./character");
|
|
13
13
|
const hex_1 = require("./hex");
|
|
14
14
|
const hex_uint8_1 = require("./hex_uint8");
|
|
15
|
-
// const FEATURE_SHARED_TABLES = true;
|
|
16
15
|
var TableAccessType;
|
|
17
16
|
(function (TableAccessType) {
|
|
18
17
|
TableAccessType["standard"] = "STANDARD";
|
|
@@ -500,7 +499,6 @@ class Table {
|
|
|
500
499
|
this.secondaryIndexes = {};
|
|
501
500
|
// note that this will clone the object
|
|
502
501
|
this.append(this.rowType);
|
|
503
|
-
// @ts-ignore
|
|
504
502
|
abap.builtin.sy.get().tabix.set(this.value.length);
|
|
505
503
|
return this.value[this.value.length - 1];
|
|
506
504
|
}
|