@abaplint/core 2.93.27 → 2.93.28

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.
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.27";
66
+ return "2.93.28";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -937,6 +937,9 @@ ${indentation}RAISE EXCEPTION ${uniqueName2}.`;
937
937
  if (sourceRef.findFirstExpression(Expressions.TableExpression)) {
938
938
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
939
939
  code = `ASSIGN ${sourceRef.concatTokens()} TO FIELD-SYMBOL(<${uniqueName}>).
940
+ IF sy-subrc <> 0.
941
+ RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
942
+ ENDIF.
940
943
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
941
944
  }
942
945
  else {
@@ -1473,16 +1476,36 @@ ${indentation} output = ${topTarget}.`;
1473
1476
  if (gby !== "") {
1474
1477
  gby = " GROUP BY ( " + gby + " )";
1475
1478
  }
1479
+ const fc = forLoop.findDirectExpression(Expressions.FieldChain);
1480
+ if (fc) {
1481
+ gby = " GROUP BY " + fc.concatTokens();
1482
+ }
1483
+ if (forLoop.findDirectTokenByText("ASCENDING")) {
1484
+ gby += " ASCENDING";
1485
+ }
1486
+ if (forLoop.findDirectTokenByText("DESCENDING")) {
1487
+ gby += " DESCENDING";
1488
+ }
1476
1489
  const groups = forLoop.findExpressionAfterToken("GROUPS");
1477
1490
  if (groups) {
1478
- gby += " INTO DATA(" + groups.concatTokens() + ")";
1491
+ const concat = groups.concatTokens();
1492
+ if (concat.startsWith("<")) {
1493
+ gby += " ASSIGNING FIELD-SYMBOL(" + concat + ")";
1494
+ }
1495
+ else {
1496
+ gby += " INTO DATA(" + concat + ")";
1497
+ }
1479
1498
  }
1480
1499
  let inGroup = "";
1481
1500
  if (forLoop.concatTokens().toUpperCase().includes(" IN GROUP ")) {
1482
1501
  inGroup = "-items";
1483
1502
  }
1503
+ let into = "INTO DATA";
1504
+ if (loopTargetField.startsWith("<")) {
1505
+ into = "ASSIGNING FIELD-SYMBOL";
1506
+ }
1484
1507
  // todo, also backup sy-index / sy-tabix here?
1485
- body += indentation + `LOOP AT ${loopSource}${inGroup} INTO DATA(${loopTargetField})${from}${to}${cond}${gby}.\n`;
1508
+ body += indentation + `LOOP AT ${loopSource}${inGroup} ${into}(${loopTargetField})${from}${to}${cond}${gby}.\n`;
1486
1509
  if (indexInto) {
1487
1510
  body += indentation + " DATA(" + indexInto + ") = sy-tabix.\n";
1488
1511
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.27",
3
+ "version": "2.93.28",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",