@abaplint/runtime 2.5.38 → 2.5.40
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/abap_regex.d.ts +4 -4
- package/build/src/abap_regex.js +18 -18
- package/build/src/binary_search.d.ts +5 -5
- package/build/src/binary_search.js +48 -48
- package/build/src/builtin/abs.d.ts +5 -5
- package/build/src/builtin/abs.js +17 -17
- package/build/src/builtin/boolc.d.ts +4 -4
- package/build/src/builtin/boolc.js +22 -22
- package/build/src/builtin/ceil.d.ts +5 -5
- package/build/src/builtin/ceil.js +17 -17
- package/build/src/builtin/concat_lines_of.d.ts +7 -7
- package/build/src/builtin/concat_lines_of.js +15 -15
- package/build/src/builtin/condense.d.ts +9 -9
- package/build/src/builtin/condense.js +28 -28
- package/build/src/builtin/contains.d.ts +12 -12
- package/build/src/builtin/contains.js +15 -15
- package/build/src/builtin/cos.d.ts +5 -5
- package/build/src/builtin/cos.js +22 -22
- package/build/src/builtin/count.d.ts +12 -12
- package/build/src/builtin/count.js +37 -37
- package/build/src/builtin/count_any_of.d.ts +8 -8
- package/build/src/builtin/count_any_of.js +17 -17
- package/build/src/builtin/escape.d.ts +7 -7
- package/build/src/builtin/escape.js +30 -30
- package/build/src/builtin/find.d.ts +13 -13
- package/build/src/builtin/find.js +57 -57
- package/build/src/builtin/floor.d.ts +5 -5
- package/build/src/builtin/floor.js +17 -17
- package/build/src/builtin/frac.d.ts +6 -6
- package/build/src/builtin/frac.js +40 -40
- package/build/src/builtin/index.d.ts +47 -47
- package/build/src/builtin/index.js +64 -64
- package/build/src/builtin/insert.d.ts +9 -9
- package/build/src/builtin/insert.js +15 -15
- package/build/src/builtin/ipow.d.ts +6 -6
- package/build/src/builtin/ipow.js +27 -27
- package/build/src/builtin/lines.d.ts +4 -4
- package/build/src/builtin/lines.js +8 -8
- package/build/src/builtin/match.d.ts +5 -5
- package/build/src/builtin/match.js +22 -22
- package/build/src/builtin/matches.d.ts +6 -6
- package/build/src/builtin/matches.js +29 -29
- package/build/src/builtin/nmax.d.ts +14 -14
- package/build/src/builtin/nmax.js +34 -34
- package/build/src/builtin/nmin.d.ts +14 -14
- package/build/src/builtin/nmin.js +34 -34
- package/build/src/builtin/numofchar.d.ts +5 -5
- package/build/src/builtin/numofchar.js +15 -15
- package/build/src/builtin/repeat.d.ts +6 -6
- package/build/src/builtin/repeat.js +9 -9
- package/build/src/builtin/replace.d.ts +13 -13
- package/build/src/builtin/replace.js +65 -65
- package/build/src/builtin/reverse.d.ts +5 -5
- package/build/src/builtin/reverse.js +16 -16
- package/build/src/builtin/round.d.ts +8 -8
- package/build/src/builtin/round.js +41 -41
- package/build/src/builtin/segment.d.ts +8 -8
- package/build/src/builtin/segment.js +32 -32
- package/build/src/builtin/shift_left.d.ts +9 -9
- package/build/src/builtin/shift_left.js +30 -30
- package/build/src/builtin/sign.d.ts +5 -5
- package/build/src/builtin/sign.js +17 -17
- package/build/src/builtin/sin.d.ts +5 -5
- package/build/src/builtin/sin.js +22 -22
- package/build/src/builtin/sqrt.d.ts +5 -5
- package/build/src/builtin/sqrt.js +22 -22
- package/build/src/builtin/strlen.d.ts +5 -5
- package/build/src/builtin/strlen.js +15 -15
- package/build/src/builtin/substring.d.ts +8 -8
- package/build/src/builtin/substring.js +28 -28
- package/build/src/builtin/substring_after.d.ts +6 -6
- package/build/src/builtin/substring_after.js +28 -28
- package/build/src/builtin/substring_before.d.ts +6 -6
- package/build/src/builtin/substring_before.js +28 -28
- package/build/src/builtin/sy.d.ts +2 -2
- package/build/src/builtin/sy.js +30 -30
- package/build/src/builtin/tan.d.ts +5 -5
- package/build/src/builtin/tan.js +22 -22
- package/build/src/builtin/to_lower.d.ts +4 -4
- package/build/src/builtin/to_lower.js +9 -9
- package/build/src/builtin/to_mixed.d.ts +9 -9
- package/build/src/builtin/to_mixed.js +48 -48
- package/build/src/builtin/to_upper.d.ts +4 -4
- package/build/src/builtin/to_upper.js +9 -9
- package/build/src/builtin/translate.d.ts +6 -6
- package/build/src/builtin/translate.js +19 -19
- package/build/src/builtin/trunc.d.ts +5 -5
- package/build/src/builtin/trunc.js +17 -17
- package/build/src/builtin/xstrlen.d.ts +5 -5
- package/build/src/builtin/xstrlen.js +13 -13
- package/build/src/classic_error.d.ts +6 -6
- package/build/src/classic_error.js +10 -10
- package/build/src/clone.d.ts +1 -1
- package/build/src/clone.js +37 -37
- package/build/src/compare/assigned.d.ts +2 -2
- package/build/src/compare/assigned.js +7 -7
- package/build/src/compare/between.d.ts +2 -2
- package/build/src/compare/between.js +9 -9
- package/build/src/compare/ca.d.ts +3 -3
- package/build/src/compare/ca.js +36 -36
- package/build/src/compare/cn.d.ts +3 -3
- package/build/src/compare/cn.js +8 -8
- package/build/src/compare/co.d.ts +4 -4
- package/build/src/compare/co.js +37 -37
- package/build/src/compare/cp.d.ts +4 -4
- package/build/src/compare/cp.js +48 -48
- package/build/src/compare/cs.d.ts +3 -3
- package/build/src/compare/cs.js +33 -33
- package/build/src/compare/eq.d.ts +4 -4
- package/build/src/compare/eq.js +134 -134
- package/build/src/compare/ge.d.ts +3 -3
- package/build/src/compare/ge.js +8 -8
- package/build/src/compare/gt.d.ts +4 -4
- package/build/src/compare/gt.js +107 -107
- package/build/src/compare/in.d.ts +4 -4
- package/build/src/compare/in.js +34 -34
- package/build/src/compare/index.d.ts +22 -22
- package/build/src/compare/index.js +40 -40
- package/build/src/compare/initial.d.ts +4 -4
- package/build/src/compare/initial.js +63 -63
- package/build/src/compare/instance_of.d.ts +2 -2
- package/build/src/compare/instance_of.js +7 -7
- package/build/src/compare/le.d.ts +3 -3
- package/build/src/compare/le.js +8 -8
- package/build/src/compare/lt.d.ts +4 -4
- package/build/src/compare/lt.js +8 -8
- package/build/src/compare/m.d.ts +3 -3
- package/build/src/compare/m.js +37 -37
- package/build/src/compare/na.d.ts +3 -3
- package/build/src/compare/na.js +8 -8
- package/build/src/compare/ne.d.ts +3 -3
- package/build/src/compare/ne.js +8 -8
- package/build/src/compare/np.d.ts +3 -3
- package/build/src/compare/np.js +8 -8
- package/build/src/compare/ns.d.ts +3 -3
- package/build/src/compare/ns.js +8 -8
- package/build/src/compare/o.d.ts +2 -2
- package/build/src/compare/o.js +28 -28
- package/build/src/compare/z.d.ts +2 -2
- package/build/src/compare/z.js +28 -28
- package/build/src/console.d.ts +7 -7
- package/build/src/console.js +21 -21
- package/build/src/context.d.ts +13 -13
- package/build/src/context.js +17 -17
- package/build/src/db/db.d.ts +55 -55
- package/build/src/db/db.js +2 -2
- package/build/src/expand_dynamic.d.ts +2 -2
- package/build/src/expand_dynamic.js +22 -22
- package/build/src/expand_in.d.ts +2 -2
- package/build/src/expand_in.js +24 -24
- package/build/src/index.d.ts +52 -52
- package/build/src/index.js +54 -54
- package/build/src/offset_length.d.ts +16 -16
- package/build/src/offset_length.js +78 -78
- package/build/src/operators/_bit_operations.d.ts +6 -6
- package/build/src/operators/_bit_operations.js +29 -29
- package/build/src/operators/_parse.d.ts +4 -4
- package/build/src/operators/_parse.js +45 -45
- package/build/src/operators/add.d.ts +4 -4
- package/build/src/operators/add.js +42 -42
- package/build/src/operators/bit-and.d.ts +2 -2
- package/build/src/operators/bit-and.js +18 -18
- package/build/src/operators/bit-not.d.ts +2 -2
- package/build/src/operators/bit-not.js +14 -14
- package/build/src/operators/bit-or.d.ts +2 -2
- package/build/src/operators/bit-or.js +18 -18
- package/build/src/operators/bit-xor.d.ts +2 -2
- package/build/src/operators/bit-xor.js +18 -18
- package/build/src/operators/concat.d.ts +4 -4
- package/build/src/operators/concat.js +35 -35
- package/build/src/operators/div.d.ts +4 -4
- package/build/src/operators/div.js +12 -12
- package/build/src/operators/divide.d.ts +4 -4
- package/build/src/operators/divide.js +16 -16
- package/build/src/operators/index.d.ts +12 -12
- package/build/src/operators/index.js +28 -28
- package/build/src/operators/minus.d.ts +4 -4
- package/build/src/operators/minus.js +41 -41
- package/build/src/operators/mod.d.ts +4 -4
- package/build/src/operators/mod.js +12 -12
- package/build/src/operators/multiply.d.ts +4 -4
- package/build/src/operators/multiply.js +29 -29
- package/build/src/operators/power.d.ts +4 -4
- package/build/src/operators/power.js +9 -9
- package/build/src/rfc.d.ts +25 -25
- package/build/src/rfc.js +2 -2
- package/build/src/statements/append.d.ts +13 -13
- package/build/src/statements/append.js +66 -66
- package/build/src/statements/assert.d.ts +1 -1
- package/build/src/statements/assert.js +9 -9
- package/build/src/statements/assign.d.ts +12 -12
- package/build/src/statements/assign.js +136 -136
- package/build/src/statements/call_function.d.ts +15 -15
- package/build/src/statements/call_function.js +35 -35
- package/build/src/statements/cast.d.ts +2 -2
- package/build/src/statements/cast.js +56 -56
- package/build/src/statements/clear.d.ts +4 -4
- package/build/src/statements/clear.js +7 -7
- package/build/src/statements/collect.d.ts +3 -3
- package/build/src/statements/collect.js +13 -13
- package/build/src/statements/commit.d.ts +1 -1
- package/build/src/statements/commit.js +7 -7
- package/build/src/statements/concatenate.d.ts +11 -11
- package/build/src/statements/concatenate.js +47 -47
- package/build/src/statements/condense.d.ts +4 -4
- package/build/src/statements/condense.js +15 -15
- package/build/src/statements/convert.d.ts +14 -14
- package/build/src/statements/convert.js +78 -78
- package/build/src/statements/create_data.d.ts +16 -16
- package/build/src/statements/create_data.js +154 -154
- package/build/src/statements/delete_database.d.ts +13 -13
- package/build/src/statements/delete_database.js +51 -51
- package/build/src/statements/delete_internal.d.ts +12 -12
- package/build/src/statements/delete_internal.js +106 -99
- package/build/src/statements/describe.d.ts +13 -13
- package/build/src/statements/describe.js +89 -89
- package/build/src/statements/find.d.ts +17 -17
- package/build/src/statements/find.js +173 -168
- package/build/src/statements/get_bit.d.ts +4 -4
- package/build/src/statements/get_bit.js +12 -12
- package/build/src/statements/get_locale.d.ts +2 -2
- package/build/src/statements/get_locale.js +8 -8
- package/build/src/statements/get_parameter.d.ts +2 -2
- package/build/src/statements/get_parameter.js +9 -9
- package/build/src/statements/get_run_time.d.ts +2 -2
- package/build/src/statements/get_run_time.js +16 -16
- package/build/src/statements/get_time.d.ts +9 -9
- package/build/src/statements/get_time.js +30 -30
- package/build/src/statements/index.d.ts +96 -96
- package/build/src/statements/index.js +115 -115
- package/build/src/statements/insert_database.d.ts +13 -13
- package/build/src/statements/insert_database.js +56 -56
- package/build/src/statements/insert_internal.d.ts +13 -13
- package/build/src/statements/insert_internal.js +113 -113
- package/build/src/statements/loop.d.ts +15 -15
- package/build/src/statements/loop.js +115 -115
- package/build/src/statements/message.d.ts +17 -17
- package/build/src/statements/message.js +89 -89
- package/build/src/statements/modify_database.d.ts +12 -12
- package/build/src/statements/modify_database.js +39 -39
- package/build/src/statements/modify_internal.d.ts +7 -7
- package/build/src/statements/modify_internal.js +29 -29
- package/build/src/statements/move_corresponding.d.ts +2 -2
- package/build/src/statements/move_corresponding.js +10 -10
- package/build/src/statements/overlay.d.ts +3 -3
- package/build/src/statements/overlay.js +16 -16
- package/build/src/statements/raise_event.d.ts +1 -1
- package/build/src/statements/raise_event.js +8 -8
- package/build/src/statements/read_report.d.ts +8 -8
- package/build/src/statements/read_report.js +14 -14
- package/build/src/statements/read_table.d.ts +22 -22
- package/build/src/statements/read_table.js +130 -130
- package/build/src/statements/replace.d.ts +13 -13
- package/build/src/statements/replace.js +60 -60
- package/build/src/statements/rollback.d.ts +1 -1
- package/build/src/statements/rollback.js +7 -7
- package/build/src/statements/select.d.ts +8 -8
- package/build/src/statements/select.js +77 -77
- package/build/src/statements/set_bit.d.ts +4 -4
- package/build/src/statements/set_bit.js +41 -41
- package/build/src/statements/set_handler.d.ts +3 -3
- package/build/src/statements/set_handler.js +8 -8
- package/build/src/statements/set_locale.d.ts +2 -2
- package/build/src/statements/set_locale.js +7 -7
- package/build/src/statements/shift.d.ts +12 -12
- package/build/src/statements/shift.js +113 -113
- package/build/src/statements/sort.d.ts +9 -9
- package/build/src/statements/sort.js +82 -82
- package/build/src/statements/split.d.ts +9 -9
- package/build/src/statements/split.js +38 -38
- package/build/src/statements/translate.d.ts +2 -2
- package/build/src/statements/translate.js +39 -39
- package/build/src/statements/update_database.d.ts +14 -14
- package/build/src/statements/update_database.js +53 -53
- package/build/src/statements/write.d.ts +17 -17
- package/build/src/statements/write.js +56 -56
- package/build/src/template_formatting.d.ts +14 -14
- package/build/src/template_formatting.js +82 -82
- package/build/src/throw_error.d.ts +1 -1
- package/build/src/throw_error.js +14 -14
- package/build/src/types/_abstract_type_data.d.ts +5 -5
- package/build/src/types/_abstract_type_data.js +2 -2
- package/build/src/types/_character.d.ts +11 -11
- package/build/src/types/_character.js +2 -2
- package/build/src/types/_date_helper.d.ts +2 -2
- package/build/src/types/_date_helper.js +40 -40
- package/build/src/types/_numeric.d.ts +5 -5
- package/build/src/types/_numeric.js +2 -2
- package/build/src/types/abap_object.d.ts +11 -11
- package/build/src/types/abap_object.js +32 -32
- package/build/src/types/character.d.ts +26 -26
- package/build/src/types/character.js +111 -111
- package/build/src/types/data_reference.d.ts +28 -28
- package/build/src/types/data_reference.js +88 -88
- package/build/src/types/date.d.ts +20 -20
- package/build/src/types/date.js +66 -66
- package/build/src/types/decfloat34.d.ts +11 -11
- package/build/src/types/decfloat34.js +45 -45
- package/build/src/types/field_symbol.d.ts +32 -32
- package/build/src/types/field_symbol.js +115 -115
- package/build/src/types/float.d.ts +15 -15
- package/build/src/types/float.js +74 -74
- package/build/src/types/hex.d.ts +20 -20
- package/build/src/types/hex.js +81 -81
- package/build/src/types/index.d.ts +17 -17
- package/build/src/types/index.js +33 -33
- package/build/src/types/integer.d.ts +15 -15
- package/build/src/types/integer.js +56 -56
- package/build/src/types/numc.d.ts +21 -21
- package/build/src/types/numc.js +48 -48
- package/build/src/types/packed.d.ts +19 -19
- package/build/src/types/packed.js +53 -53
- package/build/src/types/string.d.ts +19 -19
- package/build/src/types/string.js +86 -86
- package/build/src/types/structure.d.ts +23 -23
- package/build/src/types/structure.js +113 -113
- package/build/src/types/table.d.ts +55 -55
- package/build/src/types/table.js +220 -220
- package/build/src/types/time.d.ts +20 -20
- package/build/src/types/time.js +67 -67
- package/build/src/types/utc_long.d.ts +18 -18
- package/build/src/types/utc_long.js +26 -26
- package/build/src/types/xstring.d.ts +18 -18
- package/build/src/types/xstring.js +70 -70
- package/build/src/unit_test.d.ts +26 -26
- package/build/src/unit_test.js +75 -75
- package/package.json +2 -2
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readTable = void 0;
|
|
4
|
-
const binary_search_1 = require("../binary_search");
|
|
5
|
-
const compare_1 = require("../compare");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
function searchWithKey(arr, withKey, startIndex = 0) {
|
|
8
|
-
const isStructured = arr[0] instanceof types_1.Structure;
|
|
9
|
-
for (let index = startIndex; index < arr.length; index++) {
|
|
10
|
-
const a = arr[index];
|
|
11
|
-
const row = isStructured ? Object.assign({ table_line: a }, a.get()) : { table_line: a };
|
|
12
|
-
if (withKey(row) === true) {
|
|
13
|
-
return {
|
|
14
|
-
found: a,
|
|
15
|
-
foundIndex: index + 1,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
found: undefined,
|
|
21
|
-
foundIndex: 0,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
/////////////////
|
|
25
|
-
function readTable(table, options) {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
let found = undefined;
|
|
28
|
-
let foundIndex = 0;
|
|
29
|
-
const arr = table.array();
|
|
30
|
-
if (options === null || options === void 0 ? void 0 : options.index) {
|
|
31
|
-
let index = options.index;
|
|
32
|
-
if (typeof index !== "number") {
|
|
33
|
-
if (index instanceof types_1.FieldSymbol) {
|
|
34
|
-
if (index.getPointer() === undefined) {
|
|
35
|
-
throw new Error("GETWA_NOT_ASSIGNED");
|
|
36
|
-
}
|
|
37
|
-
index = index.getPointer();
|
|
38
|
-
}
|
|
39
|
-
if (index instanceof types_1.Float || index instanceof types_1.DecFloat34) {
|
|
40
|
-
index = index.getRaw();
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
index = index.get();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
found = arr[index - 1];
|
|
47
|
-
if (found) {
|
|
48
|
-
foundIndex = index;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
else if ((options === null || options === void 0 ? void 0 : options.binarySearch) === true
|
|
52
|
-
&& options.withKeyValue
|
|
53
|
-
&& options.withKey) {
|
|
54
|
-
// note: it currently only uses the first key field for binary search, todo
|
|
55
|
-
const first = options.withKeyValue[0];
|
|
56
|
-
const startIndex = (0, binary_search_1.binarySearchFromRow)(arr, 0, arr.length, first.key, first.value) - 1;
|
|
57
|
-
const searchResult = searchWithKey(arr, options.withKey, startIndex);
|
|
58
|
-
found = searchResult.found;
|
|
59
|
-
foundIndex = searchResult.foundIndex;
|
|
60
|
-
}
|
|
61
|
-
else if (options === null || options === void 0 ? void 0 : options.withKey) {
|
|
62
|
-
const searchResult = searchWithKey(arr, options.withKey);
|
|
63
|
-
found = searchResult.found;
|
|
64
|
-
foundIndex = searchResult.foundIndex;
|
|
65
|
-
}
|
|
66
|
-
else if (options === null || options === void 0 ? void 0 : options.from) {
|
|
67
|
-
if (options.from instanceof types_1.FieldSymbol) {
|
|
68
|
-
options.from = options.from.getPointer();
|
|
69
|
-
}
|
|
70
|
-
if (table instanceof types_1.FieldSymbol) {
|
|
71
|
-
table = table.getPointer();
|
|
72
|
-
}
|
|
73
|
-
if (table instanceof types_1.Table && options.from instanceof types_1.Structure) {
|
|
74
|
-
const keys = (_b = (_a = table.getOptions()) === null || _a === void 0 ? void 0 : _a.primaryKey) === null || _b === void 0 ? void 0 : _b.keyFields;
|
|
75
|
-
const isStructured = arr[0] instanceof types_1.Structure;
|
|
76
|
-
if (keys !== undefined && isStructured === true) {
|
|
77
|
-
// console.dir(keys);
|
|
78
|
-
// console.dir(options.from.get()[keys[0].toLowerCase()]);
|
|
79
|
-
for (const a of arr) {
|
|
80
|
-
foundIndex++;
|
|
81
|
-
let matches = true;
|
|
82
|
-
for (const k of keys) {
|
|
83
|
-
if ((0, compare_1.eq)(a.get()[k.toLowerCase()], options.from.get()[k.toLowerCase()]) === false) {
|
|
84
|
-
matches = false;
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (matches === true) {
|
|
89
|
-
found = a;
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (found === undefined) {
|
|
96
|
-
foundIndex = 0;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
throw new Error("runtime, readTable, unexpected input");
|
|
101
|
-
}
|
|
102
|
-
let subrc = found ? 0 : 4;
|
|
103
|
-
if (((options === null || options === void 0 ? void 0 : options.from) || (options === null || options === void 0 ? void 0 : options.binarySearch) === true || (options === null || options === void 0 ? void 0 : options.keyName) !== undefined)
|
|
104
|
-
&& subrc === 4) {
|
|
105
|
-
subrc = 8;
|
|
106
|
-
}
|
|
107
|
-
// @ts-ignore
|
|
108
|
-
abap.builtin.sy.get().subrc.set(subrc);
|
|
109
|
-
// @ts-ignore
|
|
110
|
-
abap.builtin.sy.get().tabix.set(foundIndex);
|
|
111
|
-
if (options.into && found) {
|
|
112
|
-
if (options.into instanceof types_1.DataReference && found instanceof types_1.DataReference) {
|
|
113
|
-
options.into.assign(found.getPointer());
|
|
114
|
-
}
|
|
115
|
-
else if (options.into instanceof types_1.DataReference) {
|
|
116
|
-
options.into.assign(found);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
options.into.set(found);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
else if (options.referenceInto && found) {
|
|
123
|
-
options.referenceInto.assign(found);
|
|
124
|
-
}
|
|
125
|
-
else if (options.assigning && found) {
|
|
126
|
-
options.assigning.assign(found);
|
|
127
|
-
}
|
|
128
|
-
return { subrc, foundIndex };
|
|
129
|
-
}
|
|
130
|
-
exports.readTable = readTable;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readTable = void 0;
|
|
4
|
+
const binary_search_1 = require("../binary_search");
|
|
5
|
+
const compare_1 = require("../compare");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
function searchWithKey(arr, withKey, startIndex = 0) {
|
|
8
|
+
const isStructured = arr[0] instanceof types_1.Structure;
|
|
9
|
+
for (let index = startIndex; index < arr.length; index++) {
|
|
10
|
+
const a = arr[index];
|
|
11
|
+
const row = isStructured ? Object.assign({ table_line: a }, a.get()) : { table_line: a };
|
|
12
|
+
if (withKey(row) === true) {
|
|
13
|
+
return {
|
|
14
|
+
found: a,
|
|
15
|
+
foundIndex: index + 1,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
found: undefined,
|
|
21
|
+
foundIndex: 0,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/////////////////
|
|
25
|
+
function readTable(table, options) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
let found = undefined;
|
|
28
|
+
let foundIndex = 0;
|
|
29
|
+
const arr = table.array();
|
|
30
|
+
if (options === null || options === void 0 ? void 0 : options.index) {
|
|
31
|
+
let index = options.index;
|
|
32
|
+
if (typeof index !== "number") {
|
|
33
|
+
if (index instanceof types_1.FieldSymbol) {
|
|
34
|
+
if (index.getPointer() === undefined) {
|
|
35
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
36
|
+
}
|
|
37
|
+
index = index.getPointer();
|
|
38
|
+
}
|
|
39
|
+
if (index instanceof types_1.Float || index instanceof types_1.DecFloat34) {
|
|
40
|
+
index = index.getRaw();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
index = index.get();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
found = arr[index - 1];
|
|
47
|
+
if (found) {
|
|
48
|
+
foundIndex = index;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if ((options === null || options === void 0 ? void 0 : options.binarySearch) === true
|
|
52
|
+
&& options.withKeyValue
|
|
53
|
+
&& options.withKey) {
|
|
54
|
+
// note: it currently only uses the first key field for binary search, todo
|
|
55
|
+
const first = options.withKeyValue[0];
|
|
56
|
+
const startIndex = (0, binary_search_1.binarySearchFromRow)(arr, 0, arr.length, first.key, first.value) - 1;
|
|
57
|
+
const searchResult = searchWithKey(arr, options.withKey, startIndex);
|
|
58
|
+
found = searchResult.found;
|
|
59
|
+
foundIndex = searchResult.foundIndex;
|
|
60
|
+
}
|
|
61
|
+
else if (options === null || options === void 0 ? void 0 : options.withKey) {
|
|
62
|
+
const searchResult = searchWithKey(arr, options.withKey);
|
|
63
|
+
found = searchResult.found;
|
|
64
|
+
foundIndex = searchResult.foundIndex;
|
|
65
|
+
}
|
|
66
|
+
else if (options === null || options === void 0 ? void 0 : options.from) {
|
|
67
|
+
if (options.from instanceof types_1.FieldSymbol) {
|
|
68
|
+
options.from = options.from.getPointer();
|
|
69
|
+
}
|
|
70
|
+
if (table instanceof types_1.FieldSymbol) {
|
|
71
|
+
table = table.getPointer();
|
|
72
|
+
}
|
|
73
|
+
if (table instanceof types_1.Table && options.from instanceof types_1.Structure) {
|
|
74
|
+
const keys = (_b = (_a = table.getOptions()) === null || _a === void 0 ? void 0 : _a.primaryKey) === null || _b === void 0 ? void 0 : _b.keyFields;
|
|
75
|
+
const isStructured = arr[0] instanceof types_1.Structure;
|
|
76
|
+
if (keys !== undefined && isStructured === true) {
|
|
77
|
+
// console.dir(keys);
|
|
78
|
+
// console.dir(options.from.get()[keys[0].toLowerCase()]);
|
|
79
|
+
for (const a of arr) {
|
|
80
|
+
foundIndex++;
|
|
81
|
+
let matches = true;
|
|
82
|
+
for (const k of keys) {
|
|
83
|
+
if ((0, compare_1.eq)(a.get()[k.toLowerCase()], options.from.get()[k.toLowerCase()]) === false) {
|
|
84
|
+
matches = false;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (matches === true) {
|
|
89
|
+
found = a;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (found === undefined) {
|
|
96
|
+
foundIndex = 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
throw new Error("runtime, readTable, unexpected input");
|
|
101
|
+
}
|
|
102
|
+
let subrc = found ? 0 : 4;
|
|
103
|
+
if (((options === null || options === void 0 ? void 0 : options.from) || (options === null || options === void 0 ? void 0 : options.binarySearch) === true || (options === null || options === void 0 ? void 0 : options.keyName) !== undefined)
|
|
104
|
+
&& subrc === 4) {
|
|
105
|
+
subrc = 8;
|
|
106
|
+
}
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
abap.builtin.sy.get().subrc.set(subrc);
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
abap.builtin.sy.get().tabix.set(foundIndex);
|
|
111
|
+
if (options.into && found) {
|
|
112
|
+
if (options.into instanceof types_1.DataReference && found instanceof types_1.DataReference) {
|
|
113
|
+
options.into.assign(found.getPointer());
|
|
114
|
+
}
|
|
115
|
+
else if (options.into instanceof types_1.DataReference) {
|
|
116
|
+
options.into.assign(found);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
options.into.set(found);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else if (options.referenceInto && found) {
|
|
123
|
+
options.referenceInto.assign(found);
|
|
124
|
+
}
|
|
125
|
+
else if (options.assigning && found) {
|
|
126
|
+
options.assigning.assign(found);
|
|
127
|
+
}
|
|
128
|
+
return { subrc, foundIndex };
|
|
129
|
+
}
|
|
130
|
+
exports.readTable = readTable;
|
|
131
131
|
//# sourceMappingURL=read_table.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ICharacter } from "../types/_character";
|
|
2
|
-
import { INumeric } from "../types/_numeric";
|
|
3
|
-
export
|
|
4
|
-
target: ICharacter;
|
|
5
|
-
sectionLength?: INumeric;
|
|
6
|
-
sectionOffset?: INumeric;
|
|
7
|
-
regex?: ICharacter;
|
|
8
|
-
all: boolean;
|
|
9
|
-
with: ICharacter;
|
|
10
|
-
of: ICharacter;
|
|
11
|
-
ignoringCase?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare function replace(input: replaceInput): void;
|
|
1
|
+
import { ICharacter } from "../types/_character";
|
|
2
|
+
import { INumeric } from "../types/_numeric";
|
|
3
|
+
export type replaceInput = {
|
|
4
|
+
target: ICharacter;
|
|
5
|
+
sectionLength?: INumeric;
|
|
6
|
+
sectionOffset?: INumeric;
|
|
7
|
+
regex?: ICharacter;
|
|
8
|
+
all: boolean;
|
|
9
|
+
with: ICharacter;
|
|
10
|
+
of: ICharacter;
|
|
11
|
+
ignoringCase?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function replace(input: replaceInput): void;
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replace = void 0;
|
|
4
|
-
const abap_regex_1 = require("../abap_regex");
|
|
5
|
-
const offset_length_1 = require("../offset_length");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
function replace(input) {
|
|
8
|
-
let temp = input.target.get();
|
|
9
|
-
const ignoreCase = input.ignoringCase === true ? "i" : "";
|
|
10
|
-
const allOccurrences = input.all === true ? "g" : "";
|
|
11
|
-
let search = undefined;
|
|
12
|
-
let found = false;
|
|
13
|
-
if (input.of) {
|
|
14
|
-
let inp = input.of.get();
|
|
15
|
-
if (inp.length === 0 && input.all === true) {
|
|
16
|
-
throw "REPLACE, zero length input";
|
|
17
|
-
}
|
|
18
|
-
found = temp.indexOf(inp) >= 0;
|
|
19
|
-
inp = abap_regex_1.ABAPRegExp.escapeRegExp(inp);
|
|
20
|
-
search = new RegExp(inp, ignoreCase + allOccurrences);
|
|
21
|
-
}
|
|
22
|
-
else if (input.regex) {
|
|
23
|
-
const regex = abap_regex_1.ABAPRegExp.convert(input.regex.get());
|
|
24
|
-
if (regex.length === 0 && input.all === true) {
|
|
25
|
-
throw "REPLACE, zero length input";
|
|
26
|
-
}
|
|
27
|
-
found = temp.match(regex) !== null;
|
|
28
|
-
search = new RegExp(regex, ignoreCase + allOccurrences);
|
|
29
|
-
}
|
|
30
|
-
else if (input.sectionLength && input.sectionOffset) {
|
|
31
|
-
new offset_length_1.OffsetLength(input.target, { length: input.sectionLength, offset: input.sectionOffset }).set(input.with);
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
abap.builtin.sy.get().subrc.set(0);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
throw "REPLACE, unexpected input";
|
|
38
|
-
}
|
|
39
|
-
let replace = "";
|
|
40
|
-
if (typeof input.with === "string") {
|
|
41
|
-
replace = input.with;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
if (input.with instanceof types_1.Character) {
|
|
45
|
-
replace = input.with.getTrimEnd();
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
replace = input.with.get();
|
|
49
|
-
}
|
|
50
|
-
replace = replace.replace(/\\\$/g, "$");
|
|
51
|
-
replace = replace.replace(/\\\{/g, "{");
|
|
52
|
-
replace = replace.replace(/\\\}/g, "}");
|
|
53
|
-
}
|
|
54
|
-
temp = temp.replace(search, replace);
|
|
55
|
-
const subrc = found ? 0 : 4;
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
abap.builtin.sy.get().subrc.set(subrc);
|
|
58
|
-
input.target.set(temp);
|
|
59
|
-
}
|
|
60
|
-
exports.replace = replace;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replace = void 0;
|
|
4
|
+
const abap_regex_1 = require("../abap_regex");
|
|
5
|
+
const offset_length_1 = require("../offset_length");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
function replace(input) {
|
|
8
|
+
let temp = input.target.get();
|
|
9
|
+
const ignoreCase = input.ignoringCase === true ? "i" : "";
|
|
10
|
+
const allOccurrences = input.all === true ? "g" : "";
|
|
11
|
+
let search = undefined;
|
|
12
|
+
let found = false;
|
|
13
|
+
if (input.of) {
|
|
14
|
+
let inp = input.of.get();
|
|
15
|
+
if (inp.length === 0 && input.all === true) {
|
|
16
|
+
throw "REPLACE, zero length input";
|
|
17
|
+
}
|
|
18
|
+
found = temp.indexOf(inp) >= 0;
|
|
19
|
+
inp = abap_regex_1.ABAPRegExp.escapeRegExp(inp);
|
|
20
|
+
search = new RegExp(inp, ignoreCase + allOccurrences);
|
|
21
|
+
}
|
|
22
|
+
else if (input.regex) {
|
|
23
|
+
const regex = abap_regex_1.ABAPRegExp.convert(input.regex.get());
|
|
24
|
+
if (regex.length === 0 && input.all === true) {
|
|
25
|
+
throw "REPLACE, zero length input";
|
|
26
|
+
}
|
|
27
|
+
found = temp.match(regex) !== null;
|
|
28
|
+
search = new RegExp(regex, ignoreCase + allOccurrences);
|
|
29
|
+
}
|
|
30
|
+
else if (input.sectionLength && input.sectionOffset) {
|
|
31
|
+
new offset_length_1.OffsetLength(input.target, { length: input.sectionLength, offset: input.sectionOffset }).set(input.with);
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
throw "REPLACE, unexpected input";
|
|
38
|
+
}
|
|
39
|
+
let replace = "";
|
|
40
|
+
if (typeof input.with === "string") {
|
|
41
|
+
replace = input.with;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (input.with instanceof types_1.Character) {
|
|
45
|
+
replace = input.with.getTrimEnd();
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
replace = input.with.get();
|
|
49
|
+
}
|
|
50
|
+
replace = replace.replace(/\\\$/g, "$");
|
|
51
|
+
replace = replace.replace(/\\\{/g, "{");
|
|
52
|
+
replace = replace.replace(/\\\}/g, "}");
|
|
53
|
+
}
|
|
54
|
+
temp = temp.replace(search, replace);
|
|
55
|
+
const subrc = found ? 0 : 4;
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
abap.builtin.sy.get().subrc.set(subrc);
|
|
58
|
+
input.target.set(temp);
|
|
59
|
+
}
|
|
60
|
+
exports.replace = replace;
|
|
61
61
|
//# sourceMappingURL=replace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function rollback(): void;
|
|
1
|
+
export declare function rollback(): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rollback = void 0;
|
|
4
|
-
function rollback() {
|
|
5
|
-
// todo
|
|
6
|
-
}
|
|
7
|
-
exports.rollback = rollback;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rollback = void 0;
|
|
4
|
+
function rollback() {
|
|
5
|
+
// todo
|
|
6
|
+
}
|
|
7
|
+
exports.rollback = rollback;
|
|
8
8
|
//# sourceMappingURL=rollback.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Context } from "../context";
|
|
2
|
-
import { SelectDatabaseOptions, SelectRuntimeOptions } from "../db/db";
|
|
3
|
-
import { FieldSymbol, Structure, Table } from "../types";
|
|
4
|
-
export declare class SelectDatabase {
|
|
5
|
-
private readonly context;
|
|
6
|
-
constructor(context: Context);
|
|
7
|
-
select(target: Structure | Table | FieldSymbol, input: SelectDatabaseOptions, runtimeOptions?: SelectRuntimeOptions): Promise<void>;
|
|
8
|
-
}
|
|
1
|
+
import { Context } from "../context";
|
|
2
|
+
import { SelectDatabaseOptions, SelectRuntimeOptions } from "../db/db";
|
|
3
|
+
import { FieldSymbol, Structure, Table } from "../types";
|
|
4
|
+
export declare class SelectDatabase {
|
|
5
|
+
private readonly context;
|
|
6
|
+
constructor(context: Context);
|
|
7
|
+
select(target: Structure | Table | FieldSymbol, input: SelectDatabaseOptions, runtimeOptions?: SelectRuntimeOptions): Promise<void>;
|
|
8
|
+
}
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SelectDatabase = void 0;
|
|
4
|
-
const clone_1 = require("../clone");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
class SelectDatabase {
|
|
7
|
-
constructor(context) {
|
|
8
|
-
this.context = context;
|
|
9
|
-
}
|
|
10
|
-
async select(target, input, runtimeOptions) {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
const { rows: rows } = await this.context.defaultDB().select(input);
|
|
13
|
-
if (target instanceof types_1.FieldSymbol) {
|
|
14
|
-
if (target.isAssigned() === false) {
|
|
15
|
-
throw new Error("GETWA_NOT_ASSIGNED");
|
|
16
|
-
}
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
target = target.getPointer();
|
|
19
|
-
}
|
|
20
|
-
if ((runtimeOptions === null || runtimeOptions === void 0 ? void 0 : runtimeOptions.appending) !== true) {
|
|
21
|
-
target === null || target === void 0 ? void 0 : target.clear();
|
|
22
|
-
}
|
|
23
|
-
if (rows.length === 0) {
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
abap.builtin.sy.get().subrc.set(4);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (target instanceof types_1.Structure) {
|
|
29
|
-
const result = {};
|
|
30
|
-
for (const column in rows[0]) {
|
|
31
|
-
if (rows[0][column] === null) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
result[column] = (0, clone_1.clone)(target.get()[column]).set(rows[0][column]);
|
|
35
|
-
}
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
abap.statements.moveCorresponding(new types_1.Structure(result), target);
|
|
38
|
-
}
|
|
39
|
-
else if (target instanceof types_1.Table) {
|
|
40
|
-
for (const row of rows) {
|
|
41
|
-
const targetRow = (0, clone_1.clone)(target.getRowType());
|
|
42
|
-
if (targetRow instanceof types_1.Structure) {
|
|
43
|
-
for (let columnName in row) {
|
|
44
|
-
columnName = columnName.toLowerCase();
|
|
45
|
-
if (row[columnName] === null) {
|
|
46
|
-
(_a = targetRow.get()[columnName]) === null || _a === void 0 ? void 0 : _a.clear();
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
(_b = targetRow.get()[columnName]) === null || _b === void 0 ? void 0 : _b.set(row[columnName]);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
const columnName = Object.keys(row)[0];
|
|
55
|
-
targetRow.set(row[columnName]);
|
|
56
|
-
}
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
abap.statements.insertInternal({ table: target, data: targetRow });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else if (target !== undefined) {
|
|
62
|
-
// its a simple type
|
|
63
|
-
target.set(rows[0][Object.keys(rows[0])[0]]);
|
|
64
|
-
}
|
|
65
|
-
if (target === undefined && rows.length === 1) {
|
|
66
|
-
// @ts-ignore
|
|
67
|
-
abap.builtin.sy.get().dbcnt.set(Object.values(rows[0])[0]);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
// @ts-ignore
|
|
71
|
-
abap.builtin.sy.get().dbcnt.set(rows.length);
|
|
72
|
-
}
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
abap.builtin.sy.get().subrc.set(0);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.SelectDatabase = SelectDatabase;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SelectDatabase = void 0;
|
|
4
|
+
const clone_1 = require("../clone");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
class SelectDatabase {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async select(target, input, runtimeOptions) {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const { rows: rows } = await this.context.defaultDB().select(input);
|
|
13
|
+
if (target instanceof types_1.FieldSymbol) {
|
|
14
|
+
if (target.isAssigned() === false) {
|
|
15
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
16
|
+
}
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
target = target.getPointer();
|
|
19
|
+
}
|
|
20
|
+
if ((runtimeOptions === null || runtimeOptions === void 0 ? void 0 : runtimeOptions.appending) !== true) {
|
|
21
|
+
target === null || target === void 0 ? void 0 : target.clear();
|
|
22
|
+
}
|
|
23
|
+
if (rows.length === 0) {
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
abap.builtin.sy.get().subrc.set(4);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (target instanceof types_1.Structure) {
|
|
29
|
+
const result = {};
|
|
30
|
+
for (const column in rows[0]) {
|
|
31
|
+
if (rows[0][column] === null) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
result[column] = (0, clone_1.clone)(target.get()[column]).set(rows[0][column]);
|
|
35
|
+
}
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
abap.statements.moveCorresponding(new types_1.Structure(result), target);
|
|
38
|
+
}
|
|
39
|
+
else if (target instanceof types_1.Table) {
|
|
40
|
+
for (const row of rows) {
|
|
41
|
+
const targetRow = (0, clone_1.clone)(target.getRowType());
|
|
42
|
+
if (targetRow instanceof types_1.Structure) {
|
|
43
|
+
for (let columnName in row) {
|
|
44
|
+
columnName = columnName.toLowerCase();
|
|
45
|
+
if (row[columnName] === null) {
|
|
46
|
+
(_a = targetRow.get()[columnName]) === null || _a === void 0 ? void 0 : _a.clear();
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
(_b = targetRow.get()[columnName]) === null || _b === void 0 ? void 0 : _b.set(row[columnName]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
const columnName = Object.keys(row)[0];
|
|
55
|
+
targetRow.set(row[columnName]);
|
|
56
|
+
}
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
abap.statements.insertInternal({ table: target, data: targetRow });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else if (target !== undefined) {
|
|
62
|
+
// its a simple type
|
|
63
|
+
target.set(rows[0][Object.keys(rows[0])[0]]);
|
|
64
|
+
}
|
|
65
|
+
if (target === undefined && rows.length === 1) {
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
abap.builtin.sy.get().dbcnt.set(Object.values(rows[0])[0]);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
abap.builtin.sy.get().dbcnt.set(rows.length);
|
|
72
|
+
}
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
abap.builtin.sy.get().subrc.set(0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.SelectDatabase = SelectDatabase;
|
|
78
78
|
//# sourceMappingURL=select.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hex, XString } from "../types";
|
|
2
|
-
import { ICharacter } from "../types/_character";
|
|
3
|
-
import { INumeric } from "../types/_numeric";
|
|
4
|
-
export declare function setBit(number: INumeric, hex: XString | Hex, val?: INumeric | ICharacter): void;
|
|
1
|
+
import { Hex, XString } from "../types";
|
|
2
|
+
import { ICharacter } from "../types/_character";
|
|
3
|
+
import { INumeric } from "../types/_numeric";
|
|
4
|
+
export declare function setBit(number: INumeric, hex: XString | Hex, val?: INumeric | ICharacter): void;
|