@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.
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +25 -2
- package/package.json +1 -1
package/build/src/registry.js
CHANGED
|
@@ -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
|
-
|
|
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}
|
|
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
|
}
|