transpiler
transpiler copied to clipboard
Transpiled programs do not run
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
focusing on getting unit tests running
not sure how/if to handle selection screens in PROGs
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
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" }
}
yea 👍 pull requests welcome
https://github.com/abaplint/transpiler/pull/958 merged