@abaplint/runtime 2.11.54 → 2.11.56

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.
@@ -19,6 +19,7 @@ import { dynamicCallLookup } from "./dynamic_call_lookup";
19
19
  import { CharacterFactory } from "./character_factory";
20
20
  import { ABAPEventing } from "./abap_eventing";
21
21
  import { isLineNotFound } from "./is_line_not_found";
22
+ import { parametersCall } from "./parameters_call";
22
23
  export { RFC, types, DB, MemoryConsole };
23
24
  export type RuntimeDatabaseOptions = {
24
25
  schemaPrefix?: string;
@@ -74,6 +75,7 @@ export declare class ABAP {
74
75
  buildDbTableName: typeof buildDbTableName;
75
76
  ClassicError: typeof ClassicError;
76
77
  dynamicCallLookup: typeof dynamicCallLookup;
78
+ parametersCall: typeof parametersCall;
77
79
  eventing: ABAPEventing;
78
80
  IntegerFactory: typeof IntegerFactory;
79
81
  CharacterFactory: typeof CharacterFactory;
@@ -26,6 +26,7 @@ const dynamic_call_lookup_1 = require("./dynamic_call_lookup");
26
26
  const character_factory_1 = require("./character_factory");
27
27
  const abap_eventing_1 = require("./abap_eventing");
28
28
  const is_line_not_found_1 = require("./is_line_not_found");
29
+ const parameters_call_1 = require("./parameters_call");
29
30
  class ABAP {
30
31
  // global objects
31
32
  Classes = {};
@@ -54,6 +55,7 @@ class ABAP {
54
55
  buildDbTableName = prefix_1.buildDbTableName;
55
56
  ClassicError = classic_error_1.ClassicError;
56
57
  dynamicCallLookup = dynamic_call_lookup_1.dynamicCallLookup;
58
+ parametersCall = parameters_call_1.parametersCall;
57
59
  eventing = new abap_eventing_1.ABAPEventing();
58
60
  IntegerFactory = integer_factory_1.IntegerFactory;
59
61
  CharacterFactory = character_factory_1.CharacterFactory;
@@ -0,0 +1,2 @@
1
+ import { HashedTable, Table } from "./types";
2
+ export declare function parametersCall(method: (params: any) => Promise<any>, parameters: Table | HashedTable): Promise<void>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parametersCall = parametersCall;
4
+ async function parametersCall(method, parameters) {
5
+ const input = {};
6
+ let receiving = undefined;
7
+ for (const v of parameters.array()) {
8
+ const kind = v.get().kind.get();
9
+ if (kind === "") {
10
+ throw new Error("open-abap currently requires KIND to be set in PARAMETER-TABLE calls");
11
+ }
12
+ else if (kind === "R") {
13
+ receiving = v.get().value;
14
+ continue;
15
+ }
16
+ const name = v.get().name.get().toLowerCase().trimEnd();
17
+ const value = v.get().value.dereference();
18
+ input[name] = value;
19
+ }
20
+ const res = await method(input);
21
+ if (res !== undefined) {
22
+ receiving?.set(res);
23
+ }
24
+ }
25
+ //# sourceMappingURL=parameters_call.js.map
@@ -4,6 +4,7 @@ exports.createData = createData;
4
4
  const throw_error_1 = require("../throw_error");
5
5
  const types_1 = require("../types");
6
6
  function createData(target, options) {
7
+ // console.dir(options);
7
8
  if (target instanceof types_1.FieldSymbol) {
8
9
  createData(target.getPointer(), options);
9
10
  return;
@@ -18,7 +19,7 @@ function createData(target, options) {
18
19
  // @ts-ignore
19
20
  target.assign(new abap.types.Table(abap.DDIC[options.name.trimEnd()].type));
20
21
  }
21
- else if (options?.name) {
22
+ else if (options?.name !== undefined) {
22
23
  if (abap.DDIC[options.name.trimEnd()]) {
23
24
  target.assign(abap.DDIC[options.name.trimEnd()].type.clone());
24
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.11.54",
3
+ "version": "2.11.56",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",