Transpiler WIP
@abaplint/transpiler-cli instead of @abaplint/transpiler
raise conv_failed.
raising non class based exceptions is not implemented, and I dont think it will be anytime soon
suggest refactoring to a class based exception
conv_failed
Hmm, yeah, I don't remember why I did like that in the first place
Nice, it compiles !

Looks like an operator is missing ?
ro_parser.get().mt_components.set(await abap.Classes['ZCL_TEXT2TAB_UTILS'].describe_struct({i_struc: ro_parser.get().mo_struc_descr, i_is_deep: abap.builtin.boolc(abap.compare.initial(i_deep_provider) === false), i_ignore_nonflat: i_ignore_nonflat}));
if ((abap.compare.initial(i_amount_format)abap.compare.initial(i_amount_format.getOffset({offset: 1, length: 1})))) {
ro_parser.get().mv_amount_format.set(i_amount_format);
}
yea, looks like a simple upper/lower case problem

next problem: Void type: RS38L_FNAM
Perhaps type as TFDIR-FUNCNAME instead, TFDIR will probably be added to open-abap sometime. RS38L_FNAM is a strange data element name
Actually funcname DE is a good replacement. Part of SABP pacakge

TFDIR refers RS38L_FNAM too in fact ...
@larshp Trying to do this again ... May I ask for some assistance ? The message says something wrong with /ui2/cl_json.clas which is not used anyhow ... :/
anyhow, next problem to tackle is VERI_ALPHA, not really sure what to use instead
ideally something that is marked as released, https://abapedia.org/steampunk-2305-api/
update didn't help: same error:
$node transpiled/index.mjs
file:///.../text2tab/transpiled/%23ui2%23cl_json.clas.locals.mjs:281
lcl_parser.ty_data_tt = abap.types.TableFactory.construct(new abap.types.Structure({"parent": new abap.types.String({qualifiedName: "LCL_PARSER=>TY_DATA-PARENT"}), "name": new abap.types.String({qualifiedName: "LCL_PARSER=>TY_DATA-NAME"}), "full_name": new abap.types.String({qualifiedName: "LCL_PARSER=>TY_DATA-FULL_NAME"}), "value": new abap.types.String({qualifiedName: "LCL_PARSER=>TY_DATA-VALUE"}), "type": new abap.types.String({qualifiedName: "LCL_PARSER=>TY_DATA-TYPE"})}, "lcl_parser=>ty_data"), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "lcl_parser=>ty_data_tt");
^
TypeError: Cannot read properties of undefined (reading 'construct')
at file:///.../text2tab/transpiled/%23ui2%23cl_json.clas.locals.mjs:281:49
... And how do you see from it, that it is about VERI_ALPHA ?
:/ I guess the only way is to create own DOMA ...
ALPHA: the xml generation might be bugged and remove the conversion routine
package.json: latest @abaplint/runtime is 2.7.54
Added domain/dtel to "deps" but no effect - same error
try updating package.json to latest versions of the dependencies
Ah no, sorry (need to get rid of the package json in favor of script, it just makes things worse). But there is now another error
$node transpiled/index.mjs
Void type: FLOAT
OK, now it is some issue with conv_exit
ZCL_TEXT2TAB_PARSER: running ltcl_text2tab_parser_test->create
ZCL_TEXT2TAB_PARSER: running ltcl_text2tab_parser_test->apply_conv_exit
<ref *1> kernel_cx_assert [Error]
at cl_abap_unit_assert.assert_equals (file:///C:/Users/at/Documents/devs/Abap/text2tab/transpiled/cl_abap_unit_assert.clas.mjs:355:32)
at async ltcl_text2tab_parser_test.apply_conv_exit (file:///C:/Users/at/Documents/devs/Abap/text2tab/transpiled/zcl_text2tab_parser.clas.testclasses.mjs:312:5)
at async run (file:///C:/Users/at/Documents/devs/Abap/text2tab/transpiled/index.mjs:45:9) {
me: ABAPObject {
qualifiedName: undefined,
RTTIName: undefined,
value: [Circular *1]
},
previous: ABAPObject {
qualifiedName: 'CX_ROOT',
RTTIName: '\\CLASS=CX_ROOT',
value: undefined
},
textid: Character {
constant: false,
length: 32,
extra: {},
value: ' '
},
get_longtext: [AsyncFunction: if_message$get_longtext],
get_text: [AsyncFunction: if_message$get_text],
actual: String { value: '123', qualifiedName: 'STRING' },
expected: String { value: '0000000123', qualifiedName: 'STRING' },
msg: String {
value: "Expected '0000000123', got '123'",
qualifiedName: 'STRING'
},
EXTRA_CX: {
INTERNAL_FILENAME: 'cl_abap_unit_assert.clas.abap',
INTERNAL_LINE: 349
}
}
reproduced in unit test in https://github.com/open-abap/open-abap-core/pull/720
try again
Void type: SYS_CALLS, suggest using type abap_callstack instead
Hmmm
actual: String { value: '', qualifiedName: 'STRING' },
expected: String { value: '', qualifiedName: 'STRING' },
the code calls fail(), so there is no actual and expected,
suggest adding the error code to the text in:
anyhow, looks like there is a bug in cl_abap_datfm=>conv_date_ext_to_int,
https://github.com/open-abap/open-abap-core/blob/main/src/date_time/cl_abap_datfm.clas.abap
add the error code to the message in fail() ?
There is no code, but I added the input field/value pair. It's easy to identify the case now:
test_parse_negative( f = 'TDATE' v = '40.01.2015' err = 'XU' ). " Incorrect day
Critical Assertion Error: 'Parse field negative wrong code: TDATE = 40.01.2015 [DU]'
cl_abap_datfm=>conv_date_ext_to_int
Hmm, I'm passing the YYYYMMDD to it and requesting to use format YYYY.MM.DD. It work in abap, it kinds of ignore the absence of separators. And the main idea is that it validates the date.
I would probably try to adjust it ... if there were any guide on how to add to open-abap (I mean running unit test in particular) - https://github.com/open-abap/open-abap-core/blob/main/README.md
npm install && npm test
cl_abap_datfm: think I fixed it this morning, https://github.com/open-abap/open-abap-core/pull/726
there is a abaplint typing bug, which I might have time to look at tomorrow morning
Yeah, some compilation stuff
Error: check_syntax, Not a structure, type unknown, FieldChain, zcl_text2tab_serializer.clas.abap:369
check_syntax, Not a structure, type unknown, FieldChain, zcl_text2tab_serializer.clas.abap:371
unknown_types, Contains unknown, Type error, not a table type is_context-components, zcl_text2tab_serializer.clas.abap:170
this parts, https://github.com/sbcgua/text2tab/blob/29dbdb0d359d3f297176c5562b61cebdde398e5e/src/zcl_text2tab_parser.clas.abap#L615-L640, sets sy-subrc, suggest replacing with a normal variable, or raising directly where the error occurs
this will also make the code more Steampunk compatible
nice, next fix = https://github.com/abaplint/transpiler/pull/1291