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

100% Statements 16/16
100% Branches 0/0
100% Functions 1/1
100% Lines 16/16

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  1x 1x 1x     1x     50x   50x   50x       50x 50x   50x   50x   50x   50x   50x                           50x           50x      
import {IStatement} from "./_statement";
import {verNot, seq, opt, alt, per} from "../combi";
import {Source, FieldChain, Constant, Field, Modif, Dynamic, SimpleSource1, FieldSub} from "../expressions";
import {Version} from "../../../version";
import {IStatementRunnable} from "../statement_runnable";
 
export class SelectOption implements IStatement {
 
  public getMatcher(): IStatementRunnable {
    const sourc = alt(Constant, FieldChain);
 
    const to = seq("TO", sourc);
 
    const def = seq("DEFAULT",
                    sourc,
                    opt(to));
 
    const option = seq("OPTION", Field);
    const sign = seq("SIGN", Field);
 
    const memory = seq("MEMORY ID", SimpleSource1);
 
    const match = seq("MATCHCODE OBJECT", Field);
 
    const modif = seq("MODIF ID", Modif);
 
    const visible = seq("VISIBLE LENGTH", Source);
 
    const options = per(def,
                        option,
                        sign,
                        memory,
                        match,
                        visible,
                        modif,
                        "NO DATABASE SELECTION",
                        "LOWER CASE",
                        "NO-EXTENSION",
                        "NO INTERVALS",
                        "NO-DISPLAY",
                        "OBLIGATORY");
 
    const ret = seq("SELECT-OPTIONS",
                    FieldSub,
                    "FOR",
                    alt(FieldChain, Dynamic),
                    opt(options));
 
    return verNot(Version.Cloud, ret);
  }
 
}