@abaplint/runtime 2.3.37 → 2.3.39

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.
@@ -14,6 +14,11 @@ function assign(input) {
14
14
  // @ts-ignore
15
15
  input.dynamicSource = input.dynamicSource.get()[split[1].toLowerCase()];
16
16
  }
17
+ else if (input.dynamicSource instanceof types_1.DataReference) {
18
+ const [_before, after] = input.dynamicName.split("->");
19
+ // @ts-ignore
20
+ input.dynamicSource = input.dynamicSource.get()[after.toLowerCase()];
21
+ }
17
22
  else {
18
23
  // @ts-ignore
19
24
  abap.builtin.sy.get().subrc.set(4);
@@ -80,7 +80,7 @@ export declare class Statements {
80
80
  private readonly context;
81
81
  constructor(context: Context);
82
82
  deleteDatabase(table: string | ICharacter, options: IDeleteDatabaseOptions): Promise<void>;
83
- insertDatabase(table: string | ICharacter, options: IInsertDatabaseOptions): Promise<number>;
83
+ insertDatabase(table: string | ICharacter, options: IInsertDatabaseOptions): Promise<number | undefined>;
84
84
  message(options: IMessageOptions): Promise<void>;
85
85
  modifyDatabase(table: string | ICharacter, options: IModifyDatabaseOptions): Promise<void>;
86
86
  select(target: Structure | Table | FieldSymbol, select: SelectDatabaseOptions, runtimeOptions?: SelectRuntimeOptions): Promise<void>;
@@ -1,11 +1,12 @@
1
1
  import { Context } from "../context";
2
- import { Structure } from "../types";
2
+ import { Structure, Table } from "../types";
3
3
  import { ICharacter } from "../types/_character";
4
4
  export interface IInsertDatabaseOptions {
5
- values: Structure;
5
+ values?: Structure;
6
+ table?: Table;
6
7
  }
7
8
  export declare class InsertDatabase {
8
9
  private readonly context;
9
10
  constructor(context: Context);
10
- insertDatabase(table: string | ICharacter, options: IInsertDatabaseOptions): Promise<number>;
11
+ insertDatabase(table: string | ICharacter, options: IInsertDatabaseOptions): Promise<number | undefined>;
11
12
  }
@@ -8,6 +8,17 @@ class InsertDatabase {
8
8
  async insertDatabase(table, options) {
9
9
  const columns = [];
10
10
  const values = [];
11
+ if (options.values === undefined && options.table === undefined) {
12
+ throw "insertDatabase, wrong input";
13
+ }
14
+ if (options.table !== undefined) {
15
+ for (const row of options.table.array()) {
16
+ await this.insertDatabase(table, { values: row });
17
+ }
18
+ // todo, set sy-subrc
19
+ // todo, set sy-dbcnt
20
+ return;
21
+ }
11
22
  const structure = options.values.get();
12
23
  for (const k of Object.keys(structure)) {
13
24
  columns.push(k);
@@ -7,5 +7,5 @@ export declare class ABAPObject {
7
7
  get(): any;
8
8
  clear(): void;
9
9
  getQualifiedName(): string | undefined;
10
- set(value: ABAPObject | any): void;
10
+ set(value: ABAPObject | any): this;
11
11
  }
@@ -26,6 +26,7 @@ class ABAPObject {
26
26
  else {
27
27
  this.value = value;
28
28
  }
29
+ return this;
29
30
  }
30
31
  }
31
32
  exports.ABAPObject = ABAPObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.3.37",
3
+ "version": "2.3.39",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",