@abaplint/transpiler-cli 2.13.25 → 2.13.27

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.
Files changed (2) hide show
  1. package/build/bundle.js +432 -65
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -7524,6 +7524,7 @@ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules
7524
7524
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
7525
7525
  const integer_1 = __webpack_require__(/*! ./integer */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/integer.js");
7526
7526
  const sql_function_input_1 = __webpack_require__(/*! ./sql_function_input */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_function_input.js");
7527
+ const sql_case_1 = __webpack_require__(/*! ./sql_case */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_case.js");
7527
7528
  class SQLFunction extends combi_1.Expression {
7528
7529
  getRunnable() {
7529
7530
  const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("NUMC", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), "DATS", "FLTP", "INT2", "INT4", "INT8");
@@ -7531,7 +7532,8 @@ class SQLFunction extends combi_1.Expression {
7531
7532
  // note: the function names are not keywords, they are usually in lower case
7532
7533
  const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^abs$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
7533
7534
  // yea, 750 is correct, but it also works technically in version v740sp05
7534
- const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^cast$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
7535
+ const castInput = (0, combi_1.altPrio)(sql_case_1.SQLCase, sql_function_input_1.SQLFunctionInput);
7536
+ const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^cast$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), castInput, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
7535
7537
  const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^ceil$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
7536
7538
  const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^coalesce$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.optPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)));
7537
7539
  const concat = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^concat$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.tok)(tokens_1.WParenRightW)));
@@ -30472,7 +30474,9 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
30472
30474
  const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
30473
30475
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
30474
30476
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
30477
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
30475
30478
  const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
30479
+ const basic_2 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
30476
30480
  class Constant {
30477
30481
  runSyntax(node, input) {
30478
30482
  const basic = new basic_types_1.BasicTypes(input);
@@ -30480,14 +30484,29 @@ class Constant {
30480
30484
  if (found) {
30481
30485
  const val = basic.findValue(node);
30482
30486
  const meta = ["read_only" /* IdentifierMeta.ReadOnly */, "static" /* IdentifierMeta.Static */];
30487
+ if (this.isOnlyDigits(found.getName()) && this.allowOnlyDigitsName(node, input) === false) {
30488
+ const message = "not possible to have a name with only digits";
30489
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, found.getToken(), message));
30490
+ return new _typed_identifier_1.TypedIdentifier(found.getToken(), input.filename, basic_2.VoidType.get(_syntax_input_1.CheckSyntaxKey), meta, val);
30491
+ }
30483
30492
  return new _typed_identifier_1.TypedIdentifier(found.getToken(), input.filename, found.getType(), meta, val);
30484
30493
  }
30485
30494
  const fallback = node.findFirstExpression(Expressions.DefinitionName);
30486
30495
  if (fallback) {
30496
+ if (this.isOnlyDigits(fallback.concatTokens()) && this.allowOnlyDigitsName(node, input) === false) {
30497
+ const message = "not possible to have a name with only digits";
30498
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, fallback.getFirstToken(), message));
30499
+ }
30487
30500
  return new _typed_identifier_1.TypedIdentifier(fallback.getFirstToken(), input.filename, new basic_1.UnknownType("constant, fallback"));
30488
30501
  }
30489
30502
  throw new assert_error_1.AssertError("Statement Constant: unexpected structure");
30490
30503
  }
30504
+ isOnlyDigits(name) {
30505
+ return /^[0-9]+$/.test(name);
30506
+ }
30507
+ allowOnlyDigitsName(node, input) {
30508
+ return input.scope.isAnyOO() === false && node.getColon() !== undefined;
30509
+ }
30491
30510
  }
30492
30511
  exports.Constant = Constant;
30493
30512
  //# sourceMappingURL=constant.js.map
@@ -30902,6 +30921,11 @@ class Data {
30902
30921
  const dd = node.findFirstExpression(Expressions.DataDefinition);
30903
30922
  if (dd) {
30904
30923
  const id = data_definition_1.DataDefinition.runSyntax(dd, input);
30924
+ if (id && this.isOnlyDigits(id.getName()) && this.allowOnlyDigitsName(node, input) === false) {
30925
+ const message = "not possible to have a name with only digits";
30926
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, id.getToken(), message));
30927
+ return new _typed_identifier_1.TypedIdentifier(id.getToken(), input.filename, basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey));
30928
+ }
30905
30929
  if ((id === null || id === void 0 ? void 0 : id.getType().isGeneric()) === true
30906
30930
  && (id === null || id === void 0 ? void 0 : id.getType().containsVoid()) === false) {
30907
30931
  const message = "DATA definition cannot be generic, " + (name === null || name === void 0 ? void 0 : name.concatTokens());
@@ -30911,10 +30935,20 @@ class Data {
30911
30935
  return id;
30912
30936
  }
30913
30937
  if (name) {
30938
+ if (this.isOnlyDigits(name.concatTokens()) && this.allowOnlyDigitsName(node, input) === false) {
30939
+ const message = "not possible to have a name with only digits";
30940
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, name.getFirstToken(), message));
30941
+ }
30914
30942
  return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), input.filename, new unknown_type_1.UnknownType("data, fallback"));
30915
30943
  }
30916
30944
  return undefined;
30917
30945
  }
30946
+ isOnlyDigits(name) {
30947
+ return /^[0-9]+$/.test(name);
30948
+ }
30949
+ allowOnlyDigitsName(node, input) {
30950
+ return input.scope.isAnyOO() === false && node.getColon() !== undefined;
30951
+ }
30918
30952
  }
30919
30953
  exports.Data = Data;
30920
30954
  //# sourceMappingURL=data.js.map
@@ -46209,6 +46243,7 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
46209
46243
  super(name);
46210
46244
  this.parsed = [];
46211
46245
  this.texts = undefined;
46246
+ this.rawXMLCache = undefined;
46212
46247
  }
46213
46248
  static is(x) {
46214
46249
  return !!x && x instanceof ABAPObject;
@@ -46227,9 +46262,18 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
46227
46262
  setDirty() {
46228
46263
  this.syntaxResult = undefined;
46229
46264
  this.texts = undefined;
46265
+ this.textsTranslations = undefined;
46266
+ this.rawXMLCache = undefined;
46230
46267
  this.parsed = [];
46231
46268
  super.setDirty();
46232
46269
  }
46270
+ getParsedXML() {
46271
+ var _a, _b;
46272
+ if (this.rawXMLCache === undefined) {
46273
+ this.rawXMLCache = (_a = this.parseRaw2()) !== null && _a !== void 0 ? _a : null;
46274
+ }
46275
+ return (_b = this.rawXMLCache) !== null && _b !== void 0 ? _b : undefined;
46276
+ }
46233
46277
  getABAPFiles() {
46234
46278
  return this.parsed;
46235
46279
  }
@@ -46260,29 +46304,69 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
46260
46304
  }
46261
46305
  return undefined;
46262
46306
  }
46263
- getTexts() {
46307
+ getTextSymbols() {
46308
+ var _a;
46264
46309
  if (this.texts === undefined) {
46265
- this.findTexts(this.parseRaw2());
46310
+ this.findTexts(this.getParsedXML());
46266
46311
  }
46267
- return this.texts;
46312
+ return (_a = this.texts["I"]) !== null && _a !== void 0 ? _a : {};
46313
+ }
46314
+ getTextElements() {
46315
+ if (this.texts === undefined) {
46316
+ this.findTexts(this.getParsedXML());
46317
+ }
46318
+ const result = {};
46319
+ for (const elements of Object.values(this.texts)) {
46320
+ Object.assign(result, elements);
46321
+ }
46322
+ return result;
46323
+ }
46324
+ getTextElementsTranslations() {
46325
+ if (this.textsTranslations === undefined) {
46326
+ this.findTextsTranslations(this.getParsedXML());
46327
+ }
46328
+ return this.textsTranslations;
46268
46329
  }
46269
46330
  findTexts(parsed) {
46270
- var _a, _b, _c, _d;
46331
+ var _a, _b, _c, _d, _e, _f, _g;
46271
46332
  this.texts = {};
46272
46333
  if (((_d = (_c = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.TPOOL) === null || _d === void 0 ? void 0 : _d.item) === undefined) {
46273
46334
  return;
46274
46335
  }
46275
46336
  for (const t of (0, xml_utils_1.xmlToArray)(parsed.abapGit["asx:abap"]["asx:values"].TPOOL.item)) {
46276
- if ((t === null || t === void 0 ? void 0 : t.ID) === "I") {
46277
- if (t.KEY === undefined) {
46278
- throw new Error("findTexts, undefined");
46279
- }
46280
- const key = t.KEY;
46281
- if (key === undefined) {
46282
- continue;
46337
+ const id = (_e = t.ID) === null || _e === void 0 ? void 0 : _e.toUpperCase();
46338
+ if (id === undefined) {
46339
+ continue;
46340
+ }
46341
+ if (id !== "R" && t.KEY === undefined) {
46342
+ continue;
46343
+ }
46344
+ const key = (_g = ((_f = t.KEY) !== null && _f !== void 0 ? _f : t.ID)) === null || _g === void 0 ? void 0 : _g.toUpperCase();
46345
+ if (key === undefined) {
46346
+ continue;
46347
+ }
46348
+ if (this.texts[id] === undefined) {
46349
+ this.texts[id] = {};
46350
+ }
46351
+ this.texts[id][key] = { entry: t.ENTRY ? (0, xml_utils_1.unescape)(t.ENTRY) : "", maxLength: parseInt(t.LENGTH, 10) };
46352
+ }
46353
+ }
46354
+ findTextsTranslations(parsed) {
46355
+ var _a, _b, _c, _d, _e, _f, _g;
46356
+ this.textsTranslations = [];
46357
+ const values = (_d = (_c = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.I18N_TPOOL) === null || _d === void 0 ? void 0 : _d.item;
46358
+ if (values === undefined) {
46359
+ return;
46360
+ }
46361
+ for (const langItem of (0, xml_utils_1.xmlToArray)(values)) {
46362
+ const textElements = {};
46363
+ for (const item of (0, xml_utils_1.xmlToArray)((_e = langItem.TEXTPOOL) === null || _e === void 0 ? void 0 : _e.item)) {
46364
+ const key = (_g = ((_f = item.KEY) !== null && _f !== void 0 ? _f : item.ID)) === null || _g === void 0 ? void 0 : _g.toUpperCase();
46365
+ if (key !== undefined) {
46366
+ textElements[key] = { entry: (0, xml_utils_1.unescape)(item.ENTRY), maxLength: parseInt(item.LENGTH, 10) };
46283
46367
  }
46284
- this.texts[key.toUpperCase()] = t.ENTRY ? (0, xml_utils_1.unescape)(t.ENTRY) : "";
46285
46368
  }
46369
+ this.textsTranslations.push({ language: langItem.LANGUAGE, textElements });
46286
46370
  }
46287
46371
  }
46288
46372
  }
@@ -48411,6 +48495,7 @@ exports.DataElement = void 0;
48411
48495
  const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
48412
48496
  const ddic_1 = __webpack_require__(/*! ../ddic */ "./node_modules/@abaplint/core/build/src/ddic.js");
48413
48497
  const Types = __webpack_require__(/*! ../abap/types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
48498
+ const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "./node_modules/@abaplint/core/build/src/xml_utils.js");
48414
48499
  class DataElement extends _abstract_object_1.AbstractObject {
48415
48500
  constructor() {
48416
48501
  super(...arguments);
@@ -48446,6 +48531,16 @@ class DataElement extends _abstract_object_1.AbstractObject {
48446
48531
  this.parse();
48447
48532
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.texts;
48448
48533
  }
48534
+ getTextMaxLengths() {
48535
+ var _a;
48536
+ this.parse();
48537
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.textMaxLengths;
48538
+ }
48539
+ getTextsTranslations() {
48540
+ var _a;
48541
+ this.parse();
48542
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.textsTranslations;
48543
+ }
48449
48544
  parseType(reg) {
48450
48545
  var _a;
48451
48546
  const references = [];
@@ -48505,7 +48600,7 @@ class DataElement extends _abstract_object_1.AbstractObject {
48505
48600
  return lookup.type;
48506
48601
  }
48507
48602
  parse() {
48508
- var _a, _b, _c;
48603
+ var _a, _b, _c, _d, _e, _f, _g;
48509
48604
  if (this.parsedXML !== undefined) {
48510
48605
  return { updated: false, runtime: 0 };
48511
48606
  }
@@ -48529,7 +48624,24 @@ class DataElement extends _abstract_object_1.AbstractObject {
48529
48624
  long: dd04v === null || dd04v === void 0 ? void 0 : dd04v.SCRTEXT_L,
48530
48625
  heading: dd04v === null || dd04v === void 0 ? void 0 : dd04v.REPTEXT,
48531
48626
  },
48627
+ textMaxLengths: {
48628
+ short: dd04v === null || dd04v === void 0 ? void 0 : dd04v.SCRLEN1,
48629
+ medium: dd04v === null || dd04v === void 0 ? void 0 : dd04v.SCRLEN2,
48630
+ long: dd04v === null || dd04v === void 0 ? void 0 : dd04v.SCRLEN3,
48631
+ heading: dd04v === null || dd04v === void 0 ? void 0 : dd04v.HEADLEN,
48632
+ },
48532
48633
  };
48634
+ this.parsedXML.textsTranslations = [];
48635
+ for (const item of (0, xml_utils_1.xmlToArray)((_g = (_f = (_e = (_d = parsed.abapGit) === null || _d === void 0 ? void 0 : _d["asx:abap"]) === null || _e === void 0 ? void 0 : _e["asx:values"]) === null || _f === void 0 ? void 0 : _f.DD04_TEXTS) === null || _g === void 0 ? void 0 : _g.item)) {
48636
+ this.parsedXML.textsTranslations.push({
48637
+ language: item.DDLANGUAGE,
48638
+ description: item.DDTEXT,
48639
+ short: item.SCRTEXT_S,
48640
+ medium: item.SCRTEXT_M,
48641
+ long: item.SCRTEXT_L,
48642
+ heading: item.REPTEXT,
48643
+ });
48644
+ }
48533
48645
  const end = Date.now();
48534
48646
  return { updated: true, runtime: end - start };
48535
48647
  }
@@ -48690,7 +48802,7 @@ class Domain extends _abstract_object_1.AbstractObject {
48690
48802
  });
48691
48803
  }
48692
48804
  parse() {
48693
- var _a, _b, _c, _d, _e, _f, _g;
48805
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
48694
48806
  if (this.parsedXML) {
48695
48807
  return { updated: false, runtime: 0 };
48696
48808
  }
@@ -48712,6 +48824,15 @@ class Domain extends _abstract_object_1.AbstractObject {
48712
48824
  };
48713
48825
  values.push(value);
48714
48826
  }
48827
+ const dd07v_texts = (0, xml_utils_1.xmlToArray)((_l = (_k = (_j = (_h = parsed.abapGit) === null || _h === void 0 ? void 0 : _h["asx:abap"]) === null || _j === void 0 ? void 0 : _j["asx:values"]) === null || _k === void 0 ? void 0 : _k.DD07_TEXTS) === null || _l === void 0 ? void 0 : _l.item);
48828
+ const translationValues = [];
48829
+ for (const dd07v of dd07v_texts) {
48830
+ const value = {
48831
+ language: dd07v === null || dd07v === void 0 ? void 0 : dd07v.DDLANGUAGE,
48832
+ description: dd07v === null || dd07v === void 0 ? void 0 : dd07v.DDTEXT,
48833
+ };
48834
+ translationValues.push(value);
48835
+ }
48715
48836
  this.parsedXML = {
48716
48837
  description: dd01v === null || dd01v === void 0 ? void 0 : dd01v.DDTEXT,
48717
48838
  datatype: dd01v === null || dd01v === void 0 ? void 0 : dd01v.DATATYPE,
@@ -48719,6 +48840,7 @@ class Domain extends _abstract_object_1.AbstractObject {
48719
48840
  conversionExit: dd01v === null || dd01v === void 0 ? void 0 : dd01v.CONVEXIT,
48720
48841
  decimals: dd01v === null || dd01v === void 0 ? void 0 : dd01v.DECIMALS,
48721
48842
  values: values,
48843
+ valuesTranslations: translationValues,
48722
48844
  };
48723
48845
  const end = Date.now();
48724
48846
  return { updated: true, runtime: end - start };
@@ -48727,6 +48849,10 @@ class Domain extends _abstract_object_1.AbstractObject {
48727
48849
  var _a, _b;
48728
48850
  return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : [];
48729
48851
  }
48852
+ getFixedValuesTranslations() {
48853
+ var _a, _b;
48854
+ return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.valuesTranslations) !== null && _b !== void 0 ? _b : [];
48855
+ }
48730
48856
  }
48731
48857
  exports.Domain = Domain;
48732
48858
  //# sourceMappingURL=domain.js.map
@@ -49395,7 +49521,8 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
49395
49521
  }
49396
49522
  return undefined;
49397
49523
  }
49398
- getTexts() {
49524
+ getTextSymbols() {
49525
+ var _a;
49399
49526
  if (this.texts === undefined) {
49400
49527
  const found = this.findTextFile();
49401
49528
  if (found === undefined) {
@@ -49404,7 +49531,7 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
49404
49531
  const parsed = new fast_xml_parser_1.XMLParser({ parseTagValue: false, ignoreAttributes: true, trimValues: false }).parse(found.getRaw());
49405
49532
  this.findTexts(parsed);
49406
49533
  }
49407
- return this.texts;
49534
+ return (_a = this.texts["I"]) !== null && _a !== void 0 ? _a : {};
49408
49535
  }
49409
49536
  /////////////////////////////////
49410
49537
  parseXML() {
@@ -50697,6 +50824,11 @@ class MessageClass extends _abstract_object_1.AbstractObject {
50697
50824
  this.parseXML();
50698
50825
  return this.xml;
50699
50826
  }
50827
+ getTextsTranslations() {
50828
+ var _a;
50829
+ this.parseXML();
50830
+ return (_a = this.xml) === null || _a === void 0 ? void 0 : _a.textsTranslations;
50831
+ }
50700
50832
  setDirty() {
50701
50833
  this.xml = undefined;
50702
50834
  super.setDirty();
@@ -50719,7 +50851,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
50719
50851
  }
50720
50852
  /////////////////////////////////
50721
50853
  parseXML() {
50722
- var _a, _b, _c, _d, _e, _f, _g, _h;
50854
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
50723
50855
  if (this.xml !== undefined) {
50724
50856
  return;
50725
50857
  }
@@ -50727,6 +50859,7 @@ class MessageClass extends _abstract_object_1.AbstractObject {
50727
50859
  topName: undefined,
50728
50860
  description: undefined,
50729
50861
  parsedMessages: [],
50862
+ textsTranslations: [],
50730
50863
  };
50731
50864
  const parsed = super.parseRaw2();
50732
50865
  if (parsed === undefined) {
@@ -50741,6 +50874,13 @@ class MessageClass extends _abstract_object_1.AbstractObject {
50741
50874
  for (const msg of (0, xml_utils_1.xmlToArray)(t100.T100)) {
50742
50875
  this.xml.parsedMessages.push(new message_1.Message(msg.MSGNR, (0, xml_utils_1.unescape)(msg.TEXT), msg.ARBGB));
50743
50876
  }
50877
+ const t100_texts = (_k = (_j = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _j === void 0 ? void 0 : _j["asx:abap"]["asx:values"]) === null || _k === void 0 ? void 0 : _k.T100_TEXTS;
50878
+ if (t100_texts === undefined) {
50879
+ return;
50880
+ }
50881
+ for (const item of (0, xml_utils_1.xmlToArray)(t100_texts === null || t100_texts === void 0 ? void 0 : t100_texts.item)) {
50882
+ this.xml.textsTranslations.push({ language: item.SPRSL, number: item.MSGNR, text: (0, xml_utils_1.unescape)(item.TEXT) });
50883
+ }
50744
50884
  }
50745
50885
  }
50746
50886
  exports.MessageClass = MessageClass;
@@ -52004,7 +52144,7 @@ class Program extends _abap_object_1.ABAPObject {
52004
52144
  description = t.ENTRY ? (0, xml_utils_1.unescape)(t.ENTRY) : "";
52005
52145
  }
52006
52146
  else if ((t === null || t === void 0 ? void 0 : t.ID) === "S" && t.KEY !== undefined) {
52007
- selectionTexts[t.KEY.toUpperCase()] = t.ENTRY ? (0, xml_utils_1.unescape)(t.ENTRY) : "";
52147
+ selectionTexts[t.KEY.toUpperCase()] = { entry: t.ENTRY ? (0, xml_utils_1.unescape)(t.ENTRY) : "", maxLength: parseInt(t.LENGTH, 10) };
52008
52148
  }
52009
52149
  }
52010
52150
  const dynpros = (0, _dynpros_1.parseDynpros)(parsed);
@@ -54117,6 +54257,7 @@ exports.TechnicalJobDefinition = TechnicalJobDefinition;
54117
54257
  Object.defineProperty(exports, "__esModule", ({ value: true }));
54118
54258
  exports.Transaction = void 0;
54119
54259
  const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "./node_modules/@abaplint/core/build/src/objects/_abstract_object.js");
54260
+ const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "./node_modules/@abaplint/core/build/src/xml_utils.js");
54120
54261
  class Transaction extends _abstract_object_1.AbstractObject {
54121
54262
  getType() {
54122
54263
  return "TRAN";
@@ -54146,22 +54287,30 @@ class Transaction extends _abstract_object_1.AbstractObject {
54146
54287
  this.parse();
54147
54288
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
54148
54289
  }
54290
+ getTextsTranslations() {
54291
+ var _a;
54292
+ this.parse();
54293
+ return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.textsTranslations;
54294
+ }
54149
54295
  parse() {
54150
- var _a, _b, _c;
54296
+ var _a, _b, _c, _d, _e, _f;
54151
54297
  if (this.parsedXML) {
54152
54298
  return { updated: false, runtime: 0 };
54153
54299
  }
54154
54300
  const start = Date.now();
54155
54301
  this.parsedXML = {};
54156
54302
  const parsed = super.parseRaw2();
54157
- if (parsed === undefined
54158
- || parsed.abapGit === undefined
54159
- || parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
54303
+ const values = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"];
54304
+ if (values === undefined) {
54160
54305
  return { updated: false, runtime: 0 };
54161
54306
  }
54162
- this.parsedXML.description = (_a = parsed.abapGit["asx:abap"]["asx:values"].TSTCT) === null || _a === void 0 ? void 0 : _a.TTEXT;
54163
- this.parsedXML.programName = (_b = parsed.abapGit["asx:abap"]["asx:values"].TSTC) === null || _b === void 0 ? void 0 : _b.PGMNA;
54164
- this.parsedXML.cinfo = (_c = parsed.abapGit["asx:abap"]["asx:values"].TSTC) === null || _c === void 0 ? void 0 : _c.CINFO;
54307
+ this.parsedXML.description = (_c = values.TSTCT) === null || _c === void 0 ? void 0 : _c.TTEXT;
54308
+ this.parsedXML.programName = (_d = values.TSTC) === null || _d === void 0 ? void 0 : _d.PGMNA;
54309
+ this.parsedXML.cinfo = (_e = values.TSTC) === null || _e === void 0 ? void 0 : _e.CINFO;
54310
+ this.parsedXML.textsTranslations = [];
54311
+ for (const item of (0, xml_utils_1.xmlToArray)((_f = values.I18N_TPOOL) === null || _f === void 0 ? void 0 : _f.TSTCT)) {
54312
+ this.parsedXML.textsTranslations.push({ language: item.SPRSL, description: item.TTEXT });
54313
+ }
54165
54314
  const end = Date.now();
54166
54315
  return { updated: true, runtime: end - start };
54167
54316
  }
@@ -55222,7 +55371,7 @@ class Registry {
55222
55371
  }
55223
55372
  static abaplintVersion() {
55224
55373
  // magic, see build script "version.sh"
55225
- return "2.119.19";
55374
+ return "2.119.24";
55226
55375
  }
55227
55376
  getDDICReferences() {
55228
55377
  return this.ddicReferences;
@@ -59076,6 +59225,7 @@ class CheckTextElements {
59076
59225
  return this;
59077
59226
  }
59078
59227
  run(obj) {
59228
+ var _a;
59079
59229
  if (!(obj instanceof _abap_object_1.ABAPObject)) {
59080
59230
  return [];
59081
59231
  }
@@ -59095,18 +59245,19 @@ class CheckTextElements {
59095
59245
  // todo, this only checks the first main
59096
59246
  mainName = mains[0];
59097
59247
  const main1 = this.reg.findObjectForFile(this.reg.getFileByName(mains[0]));
59098
- texts = main1.getTexts();
59248
+ texts = main1.getTextSymbols();
59099
59249
  }
59100
59250
  else {
59101
- texts = obj.getTexts();
59251
+ texts = obj.getTextSymbols();
59102
59252
  }
59103
59253
  }
59104
59254
  for (const e of expressions) {
59255
+ const mainNameSuffix = mainName !== undefined && mainName.toLowerCase() !== file.getFilename().toLowerCase() ? ", " + mainName : "";
59105
59256
  if (e.get() instanceof Expressions.TextElement) {
59106
59257
  const token = e.findFirstExpression(Expressions.TextElementKey).getFirstToken();
59107
59258
  const key = token.getStr().toUpperCase();
59108
59259
  if (texts[key] === undefined) {
59109
- const message = `Text element "${key}" not found` + (mainName ? ", " + mainName : "");
59260
+ const message = `Text element "${key}" not found` + mainNameSuffix;
59110
59261
  output.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity));
59111
59262
  }
59112
59263
  }
@@ -59115,12 +59266,12 @@ class CheckTextElements {
59115
59266
  const token = e.findFirstExpression(Expressions.TextElementKey).getFirstToken();
59116
59267
  const code = e.getFirstToken().getStr();
59117
59268
  const key = token.getStr().toUpperCase();
59118
- let found = texts[key];
59119
- if (found && code.startsWith("'")) {
59269
+ let found = (_a = texts[key]) === null || _a === void 0 ? void 0 : _a.entry;
59270
+ if (found !== undefined && code.startsWith("'")) {
59120
59271
  found = found.replace(/'/g, "''");
59121
59272
  }
59122
59273
  if (found === undefined) {
59123
- const message = `Text element "${key}" not found` + (mainName ? ", " + mainName : "");
59274
+ const message = `Text element "${key}" not found` + mainNameSuffix;
59124
59275
  output.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity));
59125
59276
  }
59126
59277
  else if (code !== "'" + found + "'"
@@ -65504,25 +65655,54 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
65504
65655
  * @uniqueItems true
65505
65656
  */
65506
65657
  this.recommendations = [
65658
+ { name: "CALCULATE_HASH_FOR_CHAR", replace: "use CL_ABAP_MESSAGE_DIGEST" },
65507
65659
  { name: "CALCULATE_HASH_FOR_RAW", replace: "use CL_ABAP_HMAC or CL_ABAP_MESSAGE_DIGEST" },
65508
65660
  { name: "CCU_TIMESTAMP_DIFFERENCE", replace: "use CL_ABAP_TSTMP" },
65661
+ { name: "CLPB_EXPORT", replace: "use CL_GUI_FRONTEND_SERVICES" },
65662
+ { name: "CLPB_IMPORT", replace: "use CL_GUI_FRONTEND_SERVICES" },
65509
65663
  { name: "CONVERT_DATE_TO_EXTERNAL", replace: "use CL_ABAP_DATFM" },
65510
65664
  { name: "CONVERT_TIME_INPUT", replace: "use CL_ABAP_TIMEFM" },
65665
+ { name: "DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65511
65666
  { name: "ECATT_CONV_XSTRING_TO_STRING", replace: "use CL_BINARY_CONVERT" },
65512
65667
  { name: "F4_FILENAME", replace: "use CL_GUI_FRONTEND_SERVICES" },
65513
65668
  { name: "FUNCTION_EXISTS", replace: "surround with try-catch CX_SY_DYN_CALL_ILLEGAL_METHOD instead" },
65669
+ { name: "GUI_CREATE_DIRECTORY", replace: "use CL_GUI_FRONTEND_SERVICES" },
65670
+ { name: "GUI_DELETE_FILE", replace: "use CL_GUI_FRONTEND_SERVICES" },
65514
65671
  { name: "GUI_DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65672
+ { name: "GUI_EXEC", replace: "use CL_GUI_FRONTEND_SERVICES" },
65673
+ { name: "GUI_FB_USAGE", replace: "use CL_GUI_FRONTEND_SERVICES" },
65674
+ { name: "GUI_FILE_LOAD_DIALOG", replace: "use CL_GUI_FRONTEND_SERVICES" },
65675
+ { name: "GUI_FILE_SAVE_DIALOG", replace: "use CL_GUI_FRONTEND_SERVICES" },
65676
+ { name: "GUI_GET_DESKTOP_INFO", replace: "use CL_GUI_FRONTEND_SERVICES" },
65677
+ { name: "GUI_GET_FILE_INFO", replace: "use CL_GUI_FRONTEND_SERVICES" },
65678
+ { name: "GUI_GET_REGVALUE", replace: "use CL_GUI_FRONTEND_SERVICES" },
65679
+ { name: "GUI_MULTIPLE_FILE_LOAD_DIALOG", replace: "use CL_GUI_FRONTEND_SERVICES" },
65680
+ { name: "GUI_REMOVE_DIRECTORY", replace: "use CL_GUI_FRONTEND_SERVICES" },
65681
+ { name: "GUI_RUN", replace: "use CL_GUI_FRONTEND_SERVICES" },
65682
+ { name: "GUI_SET_REGVALUE", replace: "use CL_GUI_FRONTEND_SERVICES" },
65515
65683
  { name: "GUI_UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65684
+ { name: "GUI_VSS_DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65685
+ { name: "GUI_VSS_UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65516
65686
  { name: "GUID_CREATE", replace: "use CL_SYSTEM_UUID" },
65517
65687
  { name: "IGN_TIMESTAMP_DIFFERENCE", replace: "use CL_ABAP_TSTMP" },
65518
65688
  { name: "IGN_TIMESTAMP_PLUSMINUS", replace: "use CL_ABAP_TSTMP" },
65519
65689
  { name: "ISM_SD_GET_PRICING_CONDITIONS", replace: "use CL_PRC_RESULT_FACTORY as per note 2220005" },
65520
65690
  { name: "JOB_CREATE", replace: "use CL_BP_ABAP_JOB" },
65521
65691
  { name: "JOB_SUBMIT", replace: "use CL_BP_ABAP_JOB" },
65692
+ { name: "MD5_CALCULATE_HASH_FOR_CHAR", replace: "use CL_ABAP_MESSAGE_DIGEST" },
65693
+ { name: "MD5_CALCULATE_HASH_FOR_RAW", replace: "use CL_ABAP_MESSAGE_DIGEST" },
65694
+ { name: "POPUP_TO_CONFIRM_LOSS_OF_DATA", replace: "use POPUP_TO_CONFIRM" },
65522
65695
  { name: "POPUP_TO_CONFIRM_STEP", replace: "use POPUP_TO_CONFIRM" },
65696
+ { name: "POPUP_TO_CONFIRM_WITH_MESSAGE", replace: "use POPUP_TO_CONFIRM" },
65697
+ { name: "POPUP_TO_CONFIRM_WITH_VALUE", replace: "use POPUP_TO_CONFIRM" },
65698
+ { name: "POPUP_TO_CONFIRM_WITH_VALUE_2", replace: "use POPUP_TO_CONFIRM" },
65523
65699
  { name: "POPUP_TO_DECIDE", replace: "use POPUP_TO_CONFIRM" },
65700
+ { name: "POPUP_TO_DECIDE_INFO", replace: "use POPUP_TO_CONFIRM" },
65701
+ { name: "POPUP_TO_DECIDE_WITH_MESSAGE", replace: "use POPUP_TO_CONFIRM" },
65524
65702
  { name: "POPUP_TO_GET_VALUE", replace: "use POPUP_GET_VALUES" },
65525
65703
  { name: "QF05_RANDOM_INTEGER", replace: "use CL_ABAP_RANDOM_INT" },
65704
+ { name: "REGISTRY_GET", replace: "use CL_GUI_FRONTEND_SERVICES" },
65705
+ { name: "REGISTRY_SET", replace: "use CL_GUI_FRONTEND_SERVICES" },
65526
65706
  { name: "REUSE_ALV_GRID_DISPLAY", replace: "use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID" },
65527
65707
  { name: "ROUND", replace: "use built in function: round()" },
65528
65708
  { name: "SAPGUI_PROGRESS_INDICATOR", replace: "use CL_PROGRESS_INDICATOR" },
@@ -65532,7 +65712,17 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
65532
65712
  { name: "SSFC_BASE64_DECODE", replace: "use class CL_HTTP_UTILITY methods" },
65533
65713
  { name: "SSFC_BASE64_ENCODE", replace: "use class CL_HTTP_UTILITY methods" },
65534
65714
  { name: "SUBST_GET_FILE_LIST", replace: "see note 1686357" },
65715
+ { name: "SYSTEM_GET_UNIQUE_ID", replace: "use CL_SYSTEM_UUID" },
65716
+ { name: "SYSTEM_UUID_C_CREATE", replace: "use CL_SYSTEM_UUID" },
65717
+ { name: "UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65718
+ { name: "WS_DOWNLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65719
+ { name: "WS_EXECUTE", replace: "use CL_GUI_FRONTEND_SERVICES" },
65535
65720
  { name: "WS_FILENAME_GET", replace: "use CL_GUI_FRONTEND_SERVICES" },
65721
+ { name: "WS_FILE_ATTRIB", replace: "use CL_GUI_FRONTEND_SERVICES" },
65722
+ { name: "WS_FILE_COPY", replace: "use CL_GUI_FRONTEND_SERVICES" },
65723
+ { name: "WS_FILE_DELETE", replace: "use CL_GUI_FRONTEND_SERVICES" },
65724
+ { name: "WS_QUERY", replace: "use CL_GUI_FRONTEND_SERVICES" },
65725
+ { name: "WS_UPLOAD", replace: "use CL_GUI_FRONTEND_SERVICES" },
65536
65726
  ];
65537
65727
  }
65538
65728
  }
@@ -77095,7 +77285,29 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
77095
77285
  this.check(name, n, file);
77096
77286
  }
77097
77287
  }
77288
+ else if (r.referenceType === _reference_1.ReferenceType.ConstructorReference
77289
+ && r.position.getStart().isAfter(start)
77290
+ && r.position.getEnd().isBefore(end)
77291
+ && r.resolved instanceof types_1.ClassDefinition) {
77292
+ const method = this.findConstructor(r.resolved, scope);
77293
+ for (const name of (method === null || method === void 0 ? void 0 : method.getRaising()) || []) {
77294
+ this.check(name, n, file);
77295
+ }
77296
+ }
77297
+ }
77298
+ }
77299
+ findConstructor(def, scope) {
77300
+ for (const method of def.getMethodDefinitions().getAll()) {
77301
+ if (method instanceof types_1.MethodDefinition && method.getName().toUpperCase() === "CONSTRUCTOR") {
77302
+ return method;
77303
+ }
77304
+ }
77305
+ const sup = def.getSuperClass();
77306
+ if (sup === undefined) {
77307
+ return undefined;
77098
77308
  }
77309
+ const superDefinition = scope === null || scope === void 0 ? void 0 : scope.findClassDefinition(sup);
77310
+ return superDefinition ? this.findConstructor(superDefinition, scope) : undefined;
77099
77311
  }
77100
77312
  addFromTryStructure(s) {
77101
77313
  if (this.sinked === undefined) {
@@ -79444,9 +79656,16 @@ exports.XMLConsistency = exports.XMLConsistencyConf = void 0;
79444
79656
  const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
79445
79657
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
79446
79658
  const Objects = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
79659
+ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
79447
79660
  const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
79448
79661
  const fast_xml_parser_1 = __webpack_require__(/*! fast-xml-parser */ "./node_modules/fast-xml-parser/lib/fxp.cjs");
79662
+ const severity_1 = __webpack_require__(/*! ../severity */ "./node_modules/@abaplint/core/build/src/severity.js");
79449
79663
  class XMLConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {
79664
+ constructor() {
79665
+ super(...arguments);
79666
+ /** Problem severity for text and translation length checks */
79667
+ this.textAndTranslationLengthSeverity = severity_1.Severity.Error;
79668
+ }
79450
79669
  }
79451
79670
  exports.XMLConsistencyConf = XMLConsistencyConf;
79452
79671
  class XMLConsistency {
@@ -79457,7 +79676,11 @@ class XMLConsistency {
79457
79676
  return {
79458
79677
  key: "xml_consistency",
79459
79678
  title: "XML consistency",
79460
- shortDescription: `Checks the consistency of main XML files, eg. naming for CLAS and INTF objects`,
79679
+ shortDescription: `Checks the consistency of main XML files`,
79680
+ extendedInformation: `Checks:
79681
+ * XML is well-formed and parseable
79682
+ * Naming for CLAS and INTF objects
79683
+ * Texts and translations do not exceed maximum allowed length.`,
79461
79684
  tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.Syntax],
79462
79685
  };
79463
79686
  }
@@ -79471,7 +79694,6 @@ class XMLConsistency {
79471
79694
  return this;
79472
79695
  }
79473
79696
  run(obj) {
79474
- var _a, _b;
79475
79697
  const issues = [];
79476
79698
  const file = obj.getXMLFile();
79477
79699
  if (file === undefined) {
@@ -79486,37 +79708,166 @@ class XMLConsistency {
79486
79708
  }
79487
79709
  // todo, have some XML validation in each object?
79488
79710
  if (obj instanceof Objects.Class) {
79489
- const name = obj.getNameFromXML();
79490
- if (name === undefined) {
79491
- issues.push(issue_1.Issue.atRow(file, 1, "Name undefined in XML", this.getMetadata().key, this.conf.severity));
79492
- }
79493
- else if (obj.getDescription() && obj.getDescription().length > 60) {
79494
- issues.push(issue_1.Issue.atRow(file, 1, "Description too long", this.getMetadata().key, this.conf.severity));
79495
- }
79496
- else if (name !== obj.getName().toUpperCase()) {
79497
- issues.push(issue_1.Issue.atRow(file, 1, "Name in XML does not match object", this.getMetadata().key, this.conf.severity));
79498
- }
79499
- else if (((_a = obj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getStructure()) !== undefined && obj.getClassDefinition() === undefined) {
79500
- issues.push(issue_1.Issue.atRow(file, 1, "Class matching XML name not found in ABAP file", this.getMetadata().key, this.conf.severity));
79501
- }
79711
+ issues.push(...this.runClass(obj, file));
79502
79712
  }
79503
79713
  else if (obj instanceof Objects.Interface) {
79504
- const name = obj.getNameFromXML();
79505
- if (name === undefined) {
79506
- issues.push(issue_1.Issue.atRow(file, 1, "Name undefined in XML", this.getMetadata().key, this.conf.severity));
79507
- }
79508
- else if (obj.getDescription() && obj.getDescription().length > 60) {
79509
- issues.push(issue_1.Issue.atRow(file, 1, "Description too long", this.getMetadata().key, this.conf.severity));
79714
+ issues.push(...this.runInterface(obj, file));
79715
+ }
79716
+ else if (obj instanceof Objects.DataElement) {
79717
+ issues.push(...this.runDataElement(obj, file));
79718
+ }
79719
+ else if (obj instanceof Objects.Domain) {
79720
+ issues.push(...this.runDomain(obj, file));
79721
+ }
79722
+ else if (obj instanceof Objects.Transaction) {
79723
+ issues.push(...this.runTransaction(obj, file));
79724
+ }
79725
+ else if (obj instanceof Objects.MessageClass) {
79726
+ issues.push(...this.runMessageClass(obj, file));
79727
+ }
79728
+ if (obj instanceof _abap_object_1.ABAPObject) {
79729
+ issues.push(...this.runTextPool(obj, file));
79730
+ }
79731
+ return issues;
79732
+ }
79733
+ runClass(obj, file) {
79734
+ var _a;
79735
+ const issues = [];
79736
+ const name = obj.getNameFromXML();
79737
+ if (name === undefined) {
79738
+ issues.push(issue_1.Issue.atRow(file, 1, "Name undefined in XML", this.getMetadata().key, this.conf.severity));
79739
+ }
79740
+ else if (obj.getDescription() && obj.getDescription().length > 60) {
79741
+ issues.push(issue_1.Issue.atRow(file, 1, "Description too long", this.getMetadata().key, this.conf.severity));
79742
+ }
79743
+ else if (name !== obj.getName().toUpperCase()) {
79744
+ issues.push(issue_1.Issue.atRow(file, 1, "Name in XML does not match object", this.getMetadata().key, this.conf.severity));
79745
+ }
79746
+ else if (((_a = obj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getStructure()) !== undefined && obj.getClassDefinition() === undefined) {
79747
+ issues.push(issue_1.Issue.atRow(file, 1, "Class matching XML name not found in ABAP file", this.getMetadata().key, this.conf.severity));
79748
+ }
79749
+ return issues;
79750
+ }
79751
+ runTextPool(obj, file) {
79752
+ const issues = [];
79753
+ const push = (issue) => { if (issue) {
79754
+ issues.push(issue);
79755
+ } };
79756
+ for (const [key, el] of Object.entries(obj.getTextElements())) {
79757
+ push(this.checkTextLength(file, `ENTRY[${key}]`, el.entry, el.maxLength));
79758
+ }
79759
+ for (const translation of obj.getTextElementsTranslations()) {
79760
+ for (const [key, el] of Object.entries(translation.textElements)) {
79761
+ push(this.checkTextLength(file, `ENTRY[${key}]`, el.entry, el.maxLength, translation.language));
79510
79762
  }
79511
- else if (name !== obj.getName().toUpperCase()) {
79512
- issues.push(issue_1.Issue.atRow(file, 1, "Name in XML does not match object", this.getMetadata().key, this.conf.severity));
79763
+ }
79764
+ return issues;
79765
+ }
79766
+ runInterface(obj, file) {
79767
+ var _a;
79768
+ const issues = [];
79769
+ const name = obj.getNameFromXML();
79770
+ if (name === undefined) {
79771
+ issues.push(issue_1.Issue.atRow(file, 1, "Name undefined in XML", this.getMetadata().key, this.conf.severity));
79772
+ }
79773
+ else if (obj.getDescription() && obj.getDescription().length > 60) {
79774
+ issues.push(issue_1.Issue.atRow(file, 1, "Description too long", this.getMetadata().key, this.conf.severity));
79775
+ }
79776
+ else if (name !== obj.getName().toUpperCase()) {
79777
+ issues.push(issue_1.Issue.atRow(file, 1, "Name in XML does not match object", this.getMetadata().key, this.conf.severity));
79778
+ }
79779
+ else if (obj.getDefinition() !== undefined && ((_a = obj.getDefinition()) === null || _a === void 0 ? void 0 : _a.getName().toUpperCase()) !== name.toUpperCase()) {
79780
+ issues.push(issue_1.Issue.atRow(file, 1, "Interface matching XML name not found in ABAP file", this.getMetadata().key, this.conf.severity));
79781
+ }
79782
+ return issues;
79783
+ }
79784
+ checkTextLength(file, fieldName, text, maxLength, lang) {
79785
+ if (text === undefined || maxLength === undefined) {
79786
+ return undefined;
79787
+ }
79788
+ const max = typeof maxLength === "number" ? maxLength : parseInt(maxLength, 10);
79789
+ if (text.length > max) {
79790
+ const prefix = lang ? `[${lang}] ` : "";
79791
+ return issue_1.Issue.atRow(file, 1, `${prefix}${fieldName} "${text}" exceeds maximum length of ${max} characters (actual: ${text.length})`, this.getMetadata().key, this.conf.textAndTranslationLengthSeverity);
79792
+ }
79793
+ return undefined;
79794
+ }
79795
+ runDataElement(obj, file) {
79796
+ var _a;
79797
+ const issues = [];
79798
+ const texts = obj.getTexts();
79799
+ const maxLengths = obj.getTextMaxLengths();
79800
+ for (const issue of [
79801
+ this.checkTextLength(file, "DDTEXT", obj.getDescription(), 60),
79802
+ this.checkTextLength(file, "SCRTEXT_S", texts === null || texts === void 0 ? void 0 : texts.short, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.short),
79803
+ this.checkTextLength(file, "SCRTEXT_M", texts === null || texts === void 0 ? void 0 : texts.medium, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.medium),
79804
+ this.checkTextLength(file, "SCRTEXT_L", texts === null || texts === void 0 ? void 0 : texts.long, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.long),
79805
+ this.checkTextLength(file, "REPTEXT", texts === null || texts === void 0 ? void 0 : texts.heading, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.heading),
79806
+ ]) {
79807
+ if (issue) {
79808
+ issues.push(issue);
79513
79809
  }
79514
- else if (obj.getDefinition() !== undefined && ((_b = obj.getDefinition()) === null || _b === void 0 ? void 0 : _b.getName().toUpperCase()) !== name.toUpperCase()) {
79515
- issues.push(issue_1.Issue.atRow(file, 1, "Interface matching XML name not found in ABAP file", this.getMetadata().key, this.conf.severity));
79810
+ }
79811
+ for (const translation of (_a = obj.getTextsTranslations()) !== null && _a !== void 0 ? _a : []) {
79812
+ const lang = translation.language;
79813
+ for (const issue of [
79814
+ this.checkTextLength(file, "DDTEXT", translation.description, 60, lang),
79815
+ this.checkTextLength(file, "SCRTEXT_S", translation.short, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.short, lang),
79816
+ this.checkTextLength(file, "SCRTEXT_M", translation.medium, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.medium, lang),
79817
+ this.checkTextLength(file, "SCRTEXT_L", translation.long, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.long, lang),
79818
+ this.checkTextLength(file, "REPTEXT", translation.heading, maxLengths === null || maxLengths === void 0 ? void 0 : maxLengths.heading, lang),
79819
+ ]) {
79820
+ if (issue) {
79821
+ issues.push(issue);
79822
+ }
79516
79823
  }
79517
79824
  }
79518
79825
  return issues;
79519
79826
  }
79827
+ runDomain(obj, file) {
79828
+ var _a, _b;
79829
+ const maxTextLength = 60;
79830
+ const issues = [];
79831
+ const push = (issue) => { if (issue) {
79832
+ issues.push(issue);
79833
+ } };
79834
+ push(this.checkTextLength(file, "DDTEXT", obj.getDescription(), maxTextLength));
79835
+ for (const fixedValue of (_a = obj.getFixedValues()) !== null && _a !== void 0 ? _a : []) {
79836
+ push(this.checkTextLength(file, "DDTEXT", fixedValue.description, maxTextLength, fixedValue.language));
79837
+ }
79838
+ for (const translationFixedValue of (_b = obj.getFixedValuesTranslations()) !== null && _b !== void 0 ? _b : []) {
79839
+ push(this.checkTextLength(file, "DDTEXT", translationFixedValue.description, maxTextLength, translationFixedValue.language));
79840
+ }
79841
+ return issues;
79842
+ }
79843
+ runTransaction(obj, file) {
79844
+ var _a;
79845
+ const maxTextLength = 36;
79846
+ const issues = [];
79847
+ const push = (issue) => { if (issue) {
79848
+ issues.push(issue);
79849
+ } };
79850
+ push(this.checkTextLength(file, "TTEXT", obj.getDescription(), maxTextLength));
79851
+ for (const translation of (_a = obj.getTextsTranslations()) !== null && _a !== void 0 ? _a : []) {
79852
+ push(this.checkTextLength(file, "TTEXT", translation.description, maxTextLength, translation.language));
79853
+ }
79854
+ return issues;
79855
+ }
79856
+ runMessageClass(obj, file) {
79857
+ var _a;
79858
+ const maxTextLength = 73;
79859
+ const issues = [];
79860
+ const push = (issue) => { if (issue) {
79861
+ issues.push(issue);
79862
+ } };
79863
+ for (const msg of obj.getMessages()) {
79864
+ push(this.checkTextLength(file, `TEXT[${msg.getNumber()}]`, msg.getMessage(), maxTextLength));
79865
+ }
79866
+ for (const translation of (_a = obj.getTextsTranslations()) !== null && _a !== void 0 ? _a : []) {
79867
+ push(this.checkTextLength(file, `TEXT[${translation.number}]`, translation.text, maxTextLength, translation.language));
79868
+ }
79869
+ return issues;
79870
+ }
79520
79871
  }
79521
79872
  exports.XMLConsistency = XMLConsistency;
79522
79873
  //# sourceMappingURL=xml_consistency.js.map
@@ -80724,17 +81075,21 @@ class DatabaseSetup {
80724
81075
  insert.push(...populateTables.insertWWWPARAMS(obj));
80725
81076
  }
80726
81077
  else if (obj instanceof abaplint.Objects.Class
80727
- || obj instanceof abaplint.Objects.Interface) {
81078
+ || obj instanceof abaplint.Objects.Interface
81079
+ || obj instanceof abaplint.Objects.Program) {
80728
81080
  if (options?.populateTables?.reposrc !== false) {
80729
81081
  insert.push(populateTables.insertREPOSRC(obj));
80730
81082
  }
80731
- if (options?.populateTables?.seosubco !== false) {
81083
+ if ((obj instanceof abaplint.Objects.Class || obj instanceof abaplint.Objects.Interface)
81084
+ && options?.populateTables?.seosubco !== false) {
80732
81085
  insert.push(...populateTables.insertSEOSUBCO(obj));
80733
81086
  }
80734
- if (options?.populateTables?.seosubcodf !== false) {
81087
+ if ((obj instanceof abaplint.Objects.Class || obj instanceof abaplint.Objects.Interface)
81088
+ && options?.populateTables?.seosubcodf !== false) {
80735
81089
  insert.push(...populateTables.insertSEOSUBCODF(obj));
80736
81090
  }
80737
- if (options?.populateTables?.seosubcotx !== false) {
81091
+ if ((obj instanceof abaplint.Objects.Class || obj instanceof abaplint.Objects.Interface)
81092
+ && options?.populateTables?.seosubcotx !== false) {
80738
81093
  insert.push(...populateTables.insertSEOSUBCOTX(obj));
80739
81094
  }
80740
81095
  }
@@ -91647,7 +92002,7 @@ class ReadReportTranspiler {
91647
92002
  if (stateNode) {
91648
92003
  options.push("state: " + new expressions_1.SourceTranspiler().transpile(stateNode, traversal).getCode());
91649
92004
  }
91650
- return new chunk_1.Chunk().appendString(`abap.statements.readReport(`)
92005
+ return new chunk_1.Chunk().appendString(`await abap.statements.readReport(`)
91651
92006
  .appendChunk(reportChunk)
91652
92007
  .appendString(", {" + options.join(",") + "}")
91653
92008
  .appendString(");");
@@ -92186,12 +92541,19 @@ class SelectTranspiler {
92186
92541
  if (orderBy) {
92187
92542
  select += new expressions_1.SQLOrderByTranspiler().transpile(orderBy, traversal).getCode();
92188
92543
  }
92544
+ const fieldListDynamics = new Set(fieldList.findAllExpressionsRecursive(abaplint.Expressions.Dynamic));
92189
92545
  for (const d of node.findAllExpressionsRecursive(abaplint.Expressions.Dynamic)) {
92190
92546
  const chain = d.findFirstExpression(abaplint.Expressions.FieldChain);
92191
92547
  if (chain) {
92192
- const code = new expressions_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();
92193
92548
  const search = d.concatTokens();
92194
- select = select.replace(search, `" + ${code} + "`);
92549
+ if (fieldListDynamics.has(d)) {
92550
+ const code = new expressions_1.FieldChainTranspiler(false).transpile(chain, traversal).getCode();
92551
+ select = select.replace(search, `" + ${this.dynamicSelectList(code)} + "`);
92552
+ }
92553
+ else {
92554
+ const code = new expressions_1.FieldChainTranspiler(true).transpile(chain, traversal).getCode();
92555
+ select = select.replace(search, `" + ${code} + "`);
92556
+ }
92195
92557
  }
92196
92558
  }
92197
92559
  const concat = node.concatTokens().toUpperCase();
@@ -92253,6 +92615,11 @@ class SelectTranspiler {
92253
92615
  }
92254
92616
  return { table: tabl, keys };
92255
92617
  }
92618
+ dynamicSelectList(code) {
92619
+ return `(${code} instanceof abap.types.Table || ${code} instanceof abap.types.HashedTable`
92620
+ + ` ? (${code}.array().length === 0 ? "*" : ${code}.array().map(row => row.get()).join(", "))`
92621
+ + ` : ${code}.get())`;
92622
+ }
92256
92623
  isWhereExpression(node, expression) {
92257
92624
  // check if previous token before sqlCond is "WHERE". It could also be "ON" in case of join condition
92258
92625
  let prevToken;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.13.25",
3
+ "version": "2.13.27",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/core": "^2.119.19",
31
- "@abaplint/transpiler": "^2.13.25",
30
+ "@abaplint/core": "^2.119.24",
31
+ "@abaplint/transpiler": "^2.13.27",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.12.2",
34
34
  "@types/progress": "^2.0.7",