@abaplint/runtime 2.1.58 → 2.1.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.
@@ -6,6 +6,7 @@ export interface ICreateDataOptions {
6
6
  table?: boolean;
7
7
  name?: string;
8
8
  type?: PointerType;
9
+ typeName?: string;
9
10
  length?: INumeric;
10
11
  likeLineOf?: FieldSymbol | Table;
11
12
  like?: any;
@@ -31,6 +31,57 @@ function createData(target, options) {
31
31
  // @ts-ignore
32
32
  target.assign((0, clone_1.clone)(abap.DDIC[options.name].type));
33
33
  }
34
+ else if (options === null || options === void 0 ? void 0 : options.typeName) {
35
+ switch (options.typeName) {
36
+ case "C":
37
+ {
38
+ let length = 1;
39
+ if (options.length) {
40
+ length = options.length.get();
41
+ }
42
+ target.assign(new types_1.Character({ length: length }));
43
+ }
44
+ break;
45
+ case "X":
46
+ {
47
+ let length = 1;
48
+ if (options.length) {
49
+ length = options.length.get();
50
+ }
51
+ target.assign(new types_1.Hex({ length: length }));
52
+ }
53
+ break;
54
+ case "P":
55
+ {
56
+ let length = 1;
57
+ if (options.length) {
58
+ length = options.length.get();
59
+ }
60
+ target.assign(new types_1.Packed({ length: length }));
61
+ }
62
+ break;
63
+ case "F":
64
+ target.assign(new types_1.Float());
65
+ break;
66
+ case "D":
67
+ target.assign(new types_1.Date());
68
+ break;
69
+ case "T":
70
+ target.assign(new types_1.Time());
71
+ break;
72
+ case "I":
73
+ target.assign(new types_1.Integer());
74
+ break;
75
+ case "STRING":
76
+ target.assign(new types_1.String());
77
+ break;
78
+ case "XSTRING":
79
+ target.assign(new types_1.XString());
80
+ break;
81
+ default:
82
+ throw "CREATE DATA, unknown type " + options.typeName;
83
+ }
84
+ }
34
85
  else if (options === null || options === void 0 ? void 0 : options.type) {
35
86
  target.assign((0, clone_1.clone)(options.type));
36
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.1.58",
3
+ "version": "2.1.61",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",