@abaplint/runtime 2.7.3 → 2.7.5
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.
|
@@ -27,7 +27,7 @@ function createData(target, options) {
|
|
|
27
27
|
target.assign((0, clone_1.clone)(abap.DDIC[options.name.trimEnd()].type));
|
|
28
28
|
}
|
|
29
29
|
else if (options.name.includes("=>")) {
|
|
30
|
-
const [className, typeName] = options.name.toUpperCase().split("=>");
|
|
30
|
+
const [className, typeName] = options.name.trimEnd().toUpperCase().split("=>");
|
|
31
31
|
// @ts-ignore
|
|
32
32
|
if (abap.Classes[className] === undefined) {
|
|
33
33
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
@@ -46,16 +46,16 @@ function createData(target, options) {
|
|
|
46
46
|
if (clas === undefined) {
|
|
47
47
|
throw new Error("CreateData, kernel class missing");
|
|
48
48
|
}
|
|
49
|
-
clas.anonymous({ name: options.name, dref: target });
|
|
49
|
+
clas.anonymous({ name: options.name.trimEnd(), dref: target });
|
|
50
50
|
}
|
|
51
|
-
else if (options.name === "ABAP_BOOL") {
|
|
51
|
+
else if (options.name.trimEnd() === "ABAP_BOOL") {
|
|
52
52
|
// ABAP_BOOL is special, its not part of the type pool, its built-into abaplint
|
|
53
53
|
target.assign(new types_1.Character(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" }));
|
|
54
54
|
}
|
|
55
|
-
else if (options.name === "STRING") {
|
|
55
|
+
else if (options.name.trimEnd() === "STRING") {
|
|
56
56
|
target.assign(new types_1.String());
|
|
57
57
|
}
|
|
58
|
-
else if (options.name === "I") {
|
|
58
|
+
else if (options.name.trimEnd() === "I") {
|
|
59
59
|
target.assign(new types_1.Integer());
|
|
60
60
|
}
|
|
61
61
|
else {
|
package/build/src/types/table.js
CHANGED
|
@@ -129,13 +129,22 @@ class HashedTable {
|
|
|
129
129
|
}
|
|
130
130
|
buildHashFromSimple(data) {
|
|
131
131
|
let hash = "";
|
|
132
|
+
const rowType = (0, clone_1.clone)(this.getRowType());
|
|
132
133
|
for (const k of this.options.primaryKey.keyFields) {
|
|
133
134
|
let val = data[k.toLowerCase()];
|
|
134
135
|
if (val instanceof structure_1.Structure) {
|
|
135
136
|
val = val.getCharacter();
|
|
136
137
|
}
|
|
137
138
|
else {
|
|
138
|
-
|
|
139
|
+
// convert to correct type, eg Chars have specific length, or rounding,
|
|
140
|
+
if (k === "TABLE_LINE") {
|
|
141
|
+
rowType.set(val.get());
|
|
142
|
+
val = rowType.get();
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
rowType.get()[k.toLowerCase()].set(val.get());
|
|
146
|
+
val = rowType.get()[k.toLowerCase()].get();
|
|
147
|
+
}
|
|
139
148
|
}
|
|
140
149
|
hash += k + ":" + val + "|";
|
|
141
150
|
}
|