All files / output zcl_abapgit_data_supporter.clas.mjs

83.54% Statements 66/79
58.33% Branches 7/12
54.54% Functions 6/11
83.54% Lines 66/79

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 67 68 69 70 71 72 73 74 75 76 77 78 791x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x           1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x             1x 1x 1x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_data_supporter.clas.abap
class zcl_abapgit_data_supporter {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_DATA_SUPPORTER';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_DATA_SUPPORTER"];
  static ATTRIBUTES = {"MT_SUPPORTED_OBJECTS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
  "name": new abap.types.Character(40, {})}, "zif_abapgit_data_supporter=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","NAME"]},"secondary":[]}, "zif_abapgit_data_supporter=>ty_objects");}, "visibility": "I", "is_constant": " ", "is_class": " "}};
  static METHODS = {"GET_SUPPORTED_OBJECTS": {"visibility": "I", "parameters": {}}};
  #mt_supported_objects;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "get_supported_objects": this.#get_supported_objects.bind(this),
    };
    this.#mt_supported_objects = abap.types.TableFactory.construct(new abap.types.Structure({
    "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
    "name": new abap.types.Character(40, {})}, "zif_abapgit_data_supporter=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","NAME"]},"secondary":[]}, "zif_abapgit_data_supporter=>ty_objects");
    this.FRIENDS_ACCESS_INSTANCE["mt_supported_objects"] = this.#mt_supported_objects;
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #get_supported_objects() {
    let lt_tables = abap.types.TableFactory.construct(new abap.types.Character(30, {"qualifiedName":"TABNAME","ddicName":"TABNAME","description":"TABNAME"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    let lv_tabname = new abap.types.Character(30, {"qualifiedName":"TABNAME","ddicName":"TABNAME","description":"TABNAME"});
    let ls_object = new abap.types.Structure({
    "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
    "name": new abap.types.Character(40, {})}, "zif_abapgit_data_supporter=>ty_object", undefined, {}, {});
    let li_exit = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_EXIT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_EXIT"});
    await abap.statements.select(lt_tables, {select: "SELECT \"dd02l\".\"tabname\" FROM " + abap.buildDbTableName("dd09l") + " JOIN " + abap.buildDbTableName("dd02l") + " ON \"dd09l\".\"tabname\" = dd02l~tabname AND \"dd09l\".\"as4local\" = dd02l~as4local AND \"dd09l\".\"as4vers\" = dd02l~as4vers WHERE \"dd02l\".\"tabclass\" = 'TRANSP' AND \"dd09l\".\"tabart\" = 'APPL2' AND \"dd09l\".\"as4user\" <> 'SAP' AND \"dd09l\".\"as4local\" = 'A' AND \"dd02l\".\"contflag\" = 'C' ORDER BY \"dd02l\".\"tabname\""});
    for await (const unique71 of abap.statements.loop(lt_tables)) {
      lv_tabname.set(unique71);
      ls_object.get().type.set(abap.Classes['ZIF_ABAPGIT_DATA_CONFIG'].zif_abapgit_data_config$c_data_type.get().tabu);
      ls_object.get().name.set(lv_tabname);
      abap.statements.insertInternal({data: ls_object, table: this.#mt_supported_objects});
    }
    li_exit.set((await abap.Classes['ZCL_ABAPGIT_EXIT'].get_instance()));
    await li_exit.get().zif_abapgit_exit$change_supported_data_objects({ct_objects: this.#mt_supported_objects});
  }
  async zif_abapgit_data_supporter$is_object_supported(INPUT) {
    let rv_supported = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let iv_type = INPUT?.iv_type;
    if (iv_type?.getQualifiedName === undefined || iv_type.getQualifiedName() !== "ZIF_ABAPGIT_DATA_CONFIG=>TY_DATA_TYPE") { iv_type = undefined; }
    if (iv_type === undefined) { iv_type = new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}).set(INPUT.iv_type); }
    let iv_name = INPUT?.iv_name;
    if (iv_name === undefined) { iv_name = new abap.types.Character(40, {}).set(INPUT.iv_name); }
    let fs_ls_object_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
    "name": new abap.types.Character(40, {})}, "zif_abapgit_data_supporter=>ty_object", undefined, {}, {}));
    if (abap.compare.initial(this.#mt_supported_objects)) {
      await this.#get_supported_objects();
    }
    abap.statements.readTable(this.#mt_supported_objects,{withTableKey: true,
      withKey: (i) => {return abap.compare.eq(i.type, iv_type) && abap.compare.eq(i.name, iv_name);},
      withKeyValue: [{key: (i) => {return i.type}, value: iv_type},{key: (i) => {return i.name}, value: iv_name}],
      usesTableLine: false,
      withKeySimple: {"type": iv_type,"name": iv_name}});
    if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      rv_supported.set(abap.builtin.abap_true);
    } else {
      for await (const unique72 of abap.statements.loop(this.#mt_supported_objects,{where: async (I) => {return abap.compare.eq(I.type, iv_type);},topEquals: {"type": iv_type}})) {
        fs_ls_object_.assign(unique72);
        if (abap.compare.cp(iv_name, fs_ls_object_.get().name)) {
          rv_supported.set(abap.builtin.abap_true);
          return rv_supported;
        }
      }
    }
    return rv_supported;
  }
}
abap.Classes['ZCL_ABAPGIT_DATA_SUPPORTER'] = zcl_abapgit_data_supporter;
export {zcl_abapgit_data_supporter};