@abaplint/runtime 2.11.59 → 2.11.61
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.
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createData = createData;
|
|
4
4
|
const throw_error_1 = require("../throw_error");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
+
const tableOptions = { withHeader: false, keyType: types_1.TableKeyType.default };
|
|
6
7
|
function createData(target, options) {
|
|
7
8
|
// console.dir(options);
|
|
8
9
|
if (target instanceof types_1.FieldSymbol) {
|
|
@@ -16,8 +17,7 @@ function createData(target, options) {
|
|
|
16
17
|
if (abap.DDIC[options.name.trimEnd()] === undefined) {
|
|
17
18
|
(0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
target.assign(new abap.types.Table(abap.DDIC[options.name.trimEnd()].type));
|
|
20
|
+
target.assign(new abap.types.Table(abap.DDIC[options.name.trimEnd()].type, tableOptions));
|
|
21
21
|
}
|
|
22
22
|
else if (options?.name !== undefined) {
|
|
23
23
|
if (abap.DDIC[options.name.trimEnd()]) {
|
|
@@ -181,7 +181,12 @@ function createData(target, options) {
|
|
|
181
181
|
if (options.like instanceof types_1.FieldSymbol) {
|
|
182
182
|
options.like = options.like.getPointer();
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
if (options.table === true) {
|
|
185
|
+
target.assign(new abap.types.Table(options.like.clone(), tableOptions));
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
target.assign(options.like.clone());
|
|
189
|
+
}
|
|
185
190
|
}
|
|
186
191
|
else {
|
|
187
192
|
target.assign(target.getType()?.clone());
|
|
@@ -6,6 +6,7 @@ const table_1 = require("./table");
|
|
|
6
6
|
const _parse_1 = require("../operators/_parse");
|
|
7
7
|
const character_1 = require("./character");
|
|
8
8
|
const throw_error_1 = require("../throw_error");
|
|
9
|
+
const abap_object_1 = require("./abap_object");
|
|
9
10
|
class Structure {
|
|
10
11
|
value;
|
|
11
12
|
qualifiedName;
|
|
@@ -115,14 +116,21 @@ class Structure {
|
|
|
115
116
|
get() {
|
|
116
117
|
return this.value;
|
|
117
118
|
}
|
|
118
|
-
getCharacter() {
|
|
119
|
+
getCharacter(allowObject = false) {
|
|
119
120
|
let val = "";
|
|
120
121
|
for (const v in this.value) {
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
const foo = this.value[v];
|
|
123
|
+
if (foo instanceof Structure) {
|
|
124
|
+
val += foo.getCharacter(allowObject);
|
|
125
|
+
}
|
|
126
|
+
else if (foo instanceof abap_object_1.ABAPObject) {
|
|
127
|
+
if (allowObject === false) {
|
|
128
|
+
throw new Error("Structure getCharacter: unexpected ABAPObject");
|
|
129
|
+
}
|
|
130
|
+
val += foo.getInternalID();
|
|
123
131
|
}
|
|
124
132
|
else {
|
|
125
|
-
val +=
|
|
133
|
+
val += foo.get();
|
|
126
134
|
}
|
|
127
135
|
}
|
|
128
136
|
return val;
|
package/build/src/types/table.js
CHANGED
|
@@ -118,10 +118,10 @@ class HashedTable {
|
|
|
118
118
|
for (const k of this.options.primaryKey.keyFields) {
|
|
119
119
|
if (k === "TABLE_LINE") {
|
|
120
120
|
if (data instanceof structure_1.Structure) {
|
|
121
|
-
hash += k + ":" + data.getCharacter() + "|";
|
|
121
|
+
hash += k + ":" + data.getCharacter(true) + "|";
|
|
122
122
|
}
|
|
123
123
|
else if (data instanceof abap_object_1.ABAPObject) {
|
|
124
|
-
const moo =
|
|
124
|
+
const moo = data.getInternalID();
|
|
125
125
|
hash += k + ":" + moo + "|";
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
@@ -133,10 +133,10 @@ class HashedTable {
|
|
|
133
133
|
// @ts-ignore
|
|
134
134
|
let val = data.get()[k.toLowerCase()];
|
|
135
135
|
if (val instanceof structure_1.Structure) {
|
|
136
|
-
val = val.getCharacter();
|
|
136
|
+
val = val.getCharacter(true);
|
|
137
137
|
}
|
|
138
138
|
else if (val instanceof abap_object_1.ABAPObject) {
|
|
139
|
-
val =
|
|
139
|
+
val = val.getInternalID();
|
|
140
140
|
}
|
|
141
141
|
else {
|
|
142
142
|
val = val.get();
|
|
@@ -181,10 +181,10 @@ class HashedTable {
|
|
|
181
181
|
val = val.get();
|
|
182
182
|
}
|
|
183
183
|
else if (val instanceof abap_object_1.ABAPObject) {
|
|
184
|
-
val =
|
|
184
|
+
val = val.getInternalID();
|
|
185
185
|
}
|
|
186
186
|
else if (val instanceof structure_1.Structure) {
|
|
187
|
-
val = val.getCharacter();
|
|
187
|
+
val = val.getCharacter(true);
|
|
188
188
|
}
|
|
189
189
|
else {
|
|
190
190
|
// convert
|