All files / src/abap/2_statements/statements submit.ts

100% Statements 67/67
100% Branches 1/1
100% Functions 1/1
100% Lines 67/67

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 671x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 1x
import {IStatement} from "./_statement";
import {verNot, str, seq, opt, per, alt, plus, optPrio} from "../combi";
import {Source, NamespaceSimpleName, Dynamic, AndReturn, FieldSub} from "../expressions";
import {Version} from "../../../version";
import {IStatementRunnable} from "../statement_runnable";
 
export class Submit implements IStatement {
 
  public getMatcher(): IStatementRunnable {
    const sign = seq("SIGN", Source);
    const eq = alt("=", "EQ", "IN", "NE", "CP", "GE", "LE", "INCL");
    const compare = seq(eq, Source);
    const between = seq("BETWEEN", Source, "AND", Source);
    const selectionTable = seq("WITH SELECTION-TABLE", Source);
    const awith = seq("WITH", FieldSub, alt(compare, between), optPrio(sign));
    const prog = alt(NamespaceSimpleName, Dynamic);
    const job = seq("VIA JOB", Source, "NUMBER", Source);
    const exporting = str("EXPORTING LIST TO MEMORY");
    const spool = seq("SPOOL PARAMETERS", Source);
    const archive = seq("ARCHIVE PARAMETERS", Source);
    const lineSize = seq("LINE-SIZE", Source);
    const lineCount = seq("LINE-COUNT", Source);
    const user = seq("USER", Source);
    const sset = seq("USING SELECTION-SET", Source);
    const ssetp = seq("USING SELECTION-SETS OF PROGRAM", Source);
    const uss = seq("USING SELECTION-SCREEN", Source);
    const free = seq("WITH FREE SELECTIONS", Source);
    const newList = seq("NEW LIST IDENTIFICATION", Source);
    const layout = seq("LAYOUT", Source);
    const cover = seq("SAP COVER PAGE", Source);
 
    const keep = seq("KEEP IN SPOOL", Source);
    const imm = seq("IMMEDIATELY", Source);
    const dest = seq("DESTINATION", Source);
    const language = seq("LANGUAGE", Source);
 
    const perm = per(plus(awith),
                     selectionTable,
                     spool,
                     lineSize,
                     lineCount,
                     archive,
                     user,
                     sset,
                     ssetp,
                     keep,
                     cover,
                     imm,
                     layout,
                     dest,
                     language,
                     free,
                     newList,
                     uss,
                     "TO SAP-SPOOL",
                     "WITHOUT SPOOL DYNPRO",
                     "VIA SELECTION-SCREEN",
                     exporting,
                     AndReturn,
                     job);
 
    const ret = seq("SUBMIT", prog, opt(perm));
 
    return verNot(Version.Cloud, ret);
  }
 
}