transpiler icon indicating copy to clipboard operation
transpiler copied to clipboard

Transpiled programs do not run

Open sbcgua opened this issue 4 years ago • 5 comments

Source

report zexample.

start-of-selection.

  data lv_str type string.
  lv_str = 'Hello'.
  write lv_str.
  field-symbols <str> like lv_str.
  assign lv_str to <str>.
  write <str>.
  unassign <str>.

Transpiled to a program which does not run because of missing imports at the beginning

import runtime from "@abaplint/runtime";
global.abap = new runtime.ABAP();

And also when added, the program runs but does not output anything

sbcgua avatar Oct 14 '21 18:10 sbcgua

focusing on getting unit tests running

not sure how/if to handle selection screens in PROGs

larshp avatar Oct 15 '21 04:10 larshp

Prog are probably the first and quickest way to test something with the transpiler. This lowers barriers ... Well, I'll have a look. Seems that it just adding those 2 lines at the beginning

Selection screens, yeah ... that could be an issue ... maybe some lib for console forms (ncurses ...) ? Or a json with variants. Or running nano with default json before running program ... just a flow of thoughts

sbcgua avatar Oct 15 '21 13:10 sbcgua

just thoughts:

node transpiled.js -h
  - bukrs - company code
  - belnr - fin. document
  - budat - Doc. date

node transpiled.js bukrs=1000 budat=2021-09-12:2021-09-15

but this blocks the possibility to have some transpiler specific params, so maybe

node transpiled.js -s bukrs=1000\;budat=2021-09-12:2021-09-15
node transpiled.js -s bukrs=1000\;belnr=1,2,3

# help for sel screen params
node transpiled.js -s
  - bukrs - company code [char4,default=xyz]
  - belnr - fin. document [char10]
  - budat - Doc. date [date]

json

node transpiled.js -j selscreen.json
{
  "bukrs": "1000",
  "belnr": ["1","2"],
  "budat": { "low": "20210912", "high": "20210913" }
}

sbcgua avatar Oct 22 '21 19:10 sbcgua

yea 👍 pull requests welcome

larshp avatar Oct 22 '21 19:10 larshp

https://github.com/abaplint/transpiler/pull/958 merged

larshp avatar Oct 27 '22 08:10 larshp