@abaplint/runtime
Version:
Transpiler - Runtime
25 lines • 886 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchNextCursor = fetchNextCursor;
const types_1 = require("../types");
const select_1 = require("./select");
async function fetchNextCursor(context, cursor, target, packageSize) {
if (target instanceof types_1.FieldSymbol) {
if (target.isAssigned() === false) {
throw new Error("GETWA_NOT_ASSIGNED");
}
// @ts-ignore
target = target.getPointer();
}
if (target instanceof types_1.Structure) {
packageSize = 1;
}
const result = await context.cursors[cursor].fetchNextCursor(packageSize);
if (result.rows.length === 0) {
abap.builtin.sy.get().subrc.set(4);
return;
}
abap.builtin.sy.get().subrc.set(0);
(0, select_1.rowsToTarget)(target, result.rows);
}
//# sourceMappingURL=fetch_next_cursor.js.map