All files / output zcl_abapgit_data_utils.clas.mjs

50.43% Statements 175/347
48.78% Branches 20/41
15.78% Functions 6/38
50.43% Lines 175/347

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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 3471x 1x 1x 1x 1x 1x 1x 1x 1x 1x       1x 1x       1x 1x             1x 1x 1x 1x 1x 1x             1x       1x     1x 2x 2x 2x 2x         2x 2x 2x 2x 1x     1x 6x 6x 6x 6x         6x 6x 6x 6x 1x     1x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 22x 21x 22x 1x 1x 1x 1x 1x     1x 22x 1x   21x 21x 21x 21x 21x 21x 21x 21x 21x 21x 55x 55x 55x 55x 21x 22x   22x 21x 21x 22x 21x 22x             21x 22x 1x     1x 3x 3x 3x 3x 3x 2x 3x 1x 1x     1x 3x 3x 1x     1x                                                       1x     1x                             1x     1x                             1x     1x                                                                 1x     1x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x                           25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x                   25x     25x 100x 100x 100x 33x 33x 67x 67x 67x 67x 25x     25x 25x 25x 1x 1x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_data_utils.clas.abap
class zcl_abapgit_data_utils {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_DATA_UTILS';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"GET_TABLE_CONTFLAG": {"visibility": "I", "parameters": {"RV_CONTFLAG": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"zcl_abapgit_data_utils=>ty_contflag"});}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character();}, "is_optional": " "}}},
  "BUILD_TABLE_ITAB": {"visibility": "U", "parameters": {"RR_DATA": {"type": () => {return new abap.types.DataReference(new abap.types.Character(4));}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character(40, {});}, "is_optional": " "}}},
  "BUILD_DATA_FILENAME": {"visibility": "U", "parameters": {"RV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_CONFIG": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
  "name": new abap.types.Character(40, {}),
  "skip_initial": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
  "where": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE")}, "zif_abapgit_data_config=>ty_config", undefined, {}, {});}, "is_optional": " "}}},
  "BUILD_CONFIG_FILENAME": {"visibility": "U", "parameters": {"RV_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_CONFIG": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
  "name": new abap.types.Character(40, {}),
  "skip_initial": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
  "where": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE")}, "zif_abapgit_data_config=>ty_config", undefined, {}, {});}, "is_optional": " "}}},
  "JUMP": {"visibility": "U", "parameters": {"IS_ITEM": {"type": () => {return new abap.types.Structure({
  "obj_type": new abap.types.Character(4, {}),
  "obj_name": new abap.types.Character(40, {}),
  "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
  "srcsystem": new abap.types.Character(5, {}),
  "origlang": new abap.types.Character(1, {}),
  "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
  "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});}, "is_optional": " "}}},
  "DOES_TABLE_EXIST": {"visibility": "U", "parameters": {"RV_EXISTS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character(40, {});}, "is_optional": " "}}},
  "IS_CUSTOMIZING_TABLE": {"visibility": "U", "parameters": {"RV_CUSTOMIZING": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character(40, {});}, "is_optional": " "}}},
  "IS_APPLICATION_TABLE": {"visibility": "U", "parameters": {"RV_APPLICATION": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character(40, {});}, "is_optional": " "}}},
  "LIST_KEY_FIELDS": {"visibility": "U", "parameters": {"RT_NAMES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(30, {"qualifiedName":"abap_compname"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_data_utils=>ty_names");}, "is_optional": " "}, "IV_NAME": {"type": () => {return new abap.types.Character(40, {});}, "is_optional": " "}}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async build_config_filename(INPUT) {
    return zcl_abapgit_data_utils.build_config_filename(INPUT);
  }
  static async build_config_filename(INPUT) {
    let rv_filename = new abap.types.String({qualifiedName: "STRING"});
    let is_config = INPUT?.is_config;
    if (is_config?.getQualifiedName === undefined || is_config.getQualifiedName() !== "ZIF_ABAPGIT_DATA_CONFIG=>TY_CONFIG") { is_config = undefined; }
    if (is_config === undefined) { is_config = new abap.types.Structure({
    "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
    "name": new abap.types.Character(40, {}),
    "skip_initial": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "where": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE")}, "zif_abapgit_data_config=>ty_config", undefined, {}, {}).set(INPUT.is_config); }
    rv_filename.set(abap.builtin.to_lower({val: abap.operators.concat(new abap.types.String().set(`${abap.templateFormatting(is_config.get().name)}.${abap.templateFormatting(abap.Classes['ZIF_ABAPGIT_DATA_CONFIG'].zif_abapgit_data_config$c_config)}`),new abap.types.String().set(`.${abap.templateFormatting(abap.Classes['ZIF_ABAPGIT_DATA_CONFIG'].zif_abapgit_data_config$c_default_format)}`))}));
    abap.statements.replace({target: rv_filename, all: true, with: abap.CharacterFactory.get(1, '#'), of: abap.CharacterFactory.get(1, '/')});
    return rv_filename;
  }
  async build_data_filename(INPUT) {
    return zcl_abapgit_data_utils.build_data_filename(INPUT);
  }
  static async build_data_filename(INPUT) {
    let rv_filename = new abap.types.String({qualifiedName: "STRING"});
    let is_config = INPUT?.is_config;
    if (is_config?.getQualifiedName === undefined || is_config.getQualifiedName() !== "ZIF_ABAPGIT_DATA_CONFIG=>TY_CONFIG") { is_config = undefined; }
    if (is_config === undefined) { is_config = new abap.types.Structure({
    "type": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_data_config=>ty_data_type"}),
    "name": new abap.types.Character(40, {}),
    "skip_initial": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "where": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE")}, "zif_abapgit_data_config=>ty_config", undefined, {}, {}).set(INPUT.is_config); }
    rv_filename.set(abap.builtin.to_lower({val: abap.operators.concat(new abap.types.String().set(`${abap.templateFormatting(is_config.get().name)}.${abap.templateFormatting(is_config.get().type)}`),new abap.types.String().set(`.${abap.templateFormatting(abap.Classes['ZIF_ABAPGIT_DATA_CONFIG'].zif_abapgit_data_config$c_default_format)}`))}));
    abap.statements.replace({target: rv_filename, all: true, with: abap.CharacterFactory.get(1, '#'), of: abap.CharacterFactory.get(1, '/')});
    return rv_filename;
  }
  async build_table_itab(INPUT) {
    return zcl_abapgit_data_utils.build_table_itab(INPUT);
  }
  static async build_table_itab(INPUT) {
    let rr_data = new abap.types.DataReference(new abap.types.Character(4));
    let iv_name = INPUT?.iv_name;
    if (iv_name === undefined) { iv_name = new abap.types.Character(40, {}).set(INPUT.iv_name); }
    let lo_type = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TYPEDESCR", RTTIName: "\\CLASS=CL_ABAP_TYPEDESCR"});
    let lo_data = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_STRUCTDESCR", RTTIName: "\\CLASS=CL_ABAP_STRUCTDESCR"});
    let lo_table = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TABLEDESCR", RTTIName: "\\CLASS=CL_ABAP_TABLEDESCR"});
    let lt_keys = abap.types.TableFactory.construct(new abap.types.Structure({
    "components": abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.String({qualifiedName: "NAME"})}, "abap_table_keycompdescr", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "abap_table_keydescr-components"),
    "name": new abap.types.String({qualifiedName: "NAME"}),
    "is_primary": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "access_kind": new abap.types.String({qualifiedName: "ACCESS_KIND"}),
    "is_unique": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "key_kind": new abap.types.String({qualifiedName: "KEY_KIND"})}, "abap_table_keydescr", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "abap_table_keydescr_tab");
    let lt_names = abap.types.TableFactory.construct(new abap.types.Character(30, {"qualifiedName":"abap_compname"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_data_utils=>ty_names");
    let fs_lv_name_ = new abap.types.FieldSymbol(new abap.types.Character(30, {"qualifiedName":"abap_compname"}));
    let fs_ls_key_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "components": abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.String({qualifiedName: "NAME"})}, "abap_table_keycompdescr", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "abap_table_keydescr-components"),
    "name": new abap.types.String({qualifiedName: "NAME"}),
    "is_primary": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "access_kind": new abap.types.String({qualifiedName: "ACCESS_KIND"}),
    "is_unique": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "key_kind": new abap.types.String({qualifiedName: "KEY_KIND"})}, "abap_table_keydescr", undefined, {}, {}));
    let fs_ls_component_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "name": new abap.types.String({qualifiedName: "NAME"})}, "abap_table_keycompdescr", undefined, {}, {}));
    try {
      lo_type.set(await abap.Classes['CL_ABAP_STRUCTDESCR'].describe_by_name({p_name: iv_name}));
      abap.builtin.sy.get().subrc.set(0);
    } catch (e) {
      if (e.classic) {
          switch (e.classic.toUpperCase()) {
          case "TYPE_NOT_FOUND": abap.builtin.sy.get().subrc.set(1); break;
            }
        } else {
            throw e;
        }
      }
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Table ${abap.templateFormatting(iv_name)} not found for data serialization`)});
      }
      try {
        await abap.statements.cast(lo_data, lo_type);
        if (abap.compare.eq((await lo_data.get().is_ddic_type()), abap.builtin.abap_true)) {
          lt_names.set((await this.list_key_fields({iv_name: iv_name})));
          fs_ls_key_.assign(lt_keys.appendInitial());
          fs_ls_key_.get().access_kind.set(abap.Classes['CL_ABAP_TABLEDESCR'].tablekind_hashed);
          fs_ls_key_.get().key_kind.set(abap.Classes['CL_ABAP_TABLEDESCR'].keydefkind_user);
          fs_ls_key_.get().is_primary.set(abap.builtin.abap_true);
          fs_ls_key_.get().is_unique.set(abap.builtin.abap_true);
          for await (const unique72 of abap.statements.loop(lt_names)) {
            fs_lv_name_.assign(unique72);
            fs_ls_component_.assign(fs_ls_key_.get().components.appendInitial());
            fs_ls_component_.get().name.set(fs_lv_name_);
          }
        }
        if (abap.compare.eq(abap.builtin.lines({val: lt_names}), abap.IntegerFactory.get(0))) {
          lo_table.set((await abap.Classes['CL_ABAP_TABLEDESCR'].get({type: lo_data})));
        } else {
          lo_table.set((await abap.Classes['CL_ABAP_TABLEDESCR'].get_with_keys({p_line_type: lo_data, p_keys: lt_keys})));
        }
        if (abap.Classes['KERNEL_CREATE_DATA_HANDLE'] === undefined) throw new Error("CreateData, kernel class missing");
        await abap.Classes['KERNEL_CREATE_DATA_HANDLE'].call({handle: lo_table, dref: rr_data});
      } catch (e) {
        if ((abap.Classes['CX_ROOT'] && e instanceof abap.Classes['CX_ROOT'])) {
          await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Error creating internal table for data serialization`)});
        } else {
          throw e;
        }
      }
      return rr_data;
    }
    async does_table_exist(INPUT) {
      return zcl_abapgit_data_utils.does_table_exist(INPUT);
    }
    static async does_table_exist(INPUT) {
      let rv_exists = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
      let iv_name = INPUT?.iv_name;
      if (iv_name === undefined) { iv_name = new abap.types.Character(40, {}).set(INPUT.iv_name); }
      try {
        await this.build_table_itab({iv_name: iv_name});
        rv_exists.set(abap.builtin.abap_true);
      } catch (e) {
        if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) {
        } else {
          throw e;
        }
      }
      return rv_exists;
    }
    async get_table_contflag(INPUT) {
      return zcl_abapgit_data_utils.get_table_contflag(INPUT);
    }
    static async get_table_contflag(INPUT) {
      let rv_contflag = new abap.types.Character(1, {"qualifiedName":"zcl_abapgit_data_utils=>ty_contflag"});
      let iv_name = INPUT?.iv_name;
      let lo_table = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
      let lo_content = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
      let lo_delivery_class = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
      let fs_ls_any_ = new abap.types.FieldSymbol(new abap.types.Character(4));
      try {
        if (abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } }
        if (abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()].database_table === undefined && abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found"; }
        if (abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()].database_table === undefined) { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()](); }
        lo_table.set(await abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()].database_table({iv_name: iv_name.getOffset({length: 16})}));
        lo_content.set(await abap.dynamicCallLookup(lo_table.get(), "if_xco_database_table$content")());
        lo_delivery_class.set(await abap.dynamicCallLookup(lo_content.get(), "if_xco_dbt_content$get_delivery_class")());
        abap.statements.assign({target: fs_ls_any_, dynamicName: 'lo_delivery_class' + '->' + 'VALUE', dynamicSource: (() => {
            try { return lo_delivery_class; } catch {}
            try { return this.lo_delivery_class; } catch {}
        })()});
        rv_contflag.set(fs_ls_any_);
      } catch (e) {
        if ((abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'] && e instanceof abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS']) || (abap.Classes['CX_NO_CHECK'] && e instanceof abap.Classes['CX_NO_CHECK'])) {
          await abap.statements.select(rv_contflag, {select: "SELECT contflag FROM " + abap.buildDbTableName("dd02l") + " WHERE \"tabname\" = '" + iv_name.get() + "' UP TO 1 ROWS"});
        } else {
          throw e;
        }
      }
      return rv_contflag;
    }
    async is_application_table(INPUT) {
      return zcl_abapgit_data_utils.is_application_table(INPUT);
    }
    static async is_application_table(INPUT) {
      let rv_application = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
      let iv_name = INPUT?.iv_name;
      if (iv_name === undefined) { iv_name = new abap.types.Character(40, {}).set(INPUT.iv_name); }
      let lv_contflag = new abap.types.Character(1, {"qualifiedName":"zcl_abapgit_data_utils=>ty_contflag"});
      lv_contflag.set((await this.get_table_contflag({iv_name: iv_name})));
      if (abap.compare.ca(lv_contflag, abap.CharacterFactory.get(3, 'AEL'))) {
        rv_application.set(abap.builtin.abap_true);
      } else if (abap.compare.initial(lv_contflag) === false) {
        rv_application.set(abap.builtin.abap_false);
      } else {
        rv_application.set(abap.builtin.abap_undefined);
      }
      return rv_application;
    }
    async is_customizing_table(INPUT) {
      return zcl_abapgit_data_utils.is_customizing_table(INPUT);
    }
    static async is_customizing_table(INPUT) {
      let rv_customizing = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
      let iv_name = INPUT?.iv_name;
      if (iv_name === undefined) { iv_name = new abap.types.Character(40, {}).set(INPUT.iv_name); }
      let lv_contflag = new abap.types.Character(1, {"qualifiedName":"zcl_abapgit_data_utils=>ty_contflag"});
      lv_contflag.set((await this.get_table_contflag({iv_name: iv_name})));
      if (abap.compare.eq(lv_contflag, abap.CharacterFactory.get(1, 'C'))) {
        rv_customizing.set(abap.builtin.abap_true);
      } else if (abap.compare.initial(lv_contflag) === false) {
        rv_customizing.set(abap.builtin.abap_false);
      } else {
        rv_customizing.set(abap.builtin.abap_undefined);
      }
      return rv_customizing;
    }
    async jump(INPUT) {
      return zcl_abapgit_data_utils.jump(INPUT);
    }
    static async jump(INPUT) {
      let is_item = INPUT?.is_item;
      if (is_item?.getQualifiedName === undefined || is_item.getQualifiedName() !== "ZIF_ABAPGIT_DEFINITIONS=>TY_ITEM") { is_item = undefined; }
      if (is_item === undefined) { is_item = new abap.types.Structure({
      "obj_type": new abap.types.Character(4, {}),
      "obj_name": new abap.types.Character(40, {}),
      "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
      "srcsystem": new abap.types.Character(5, {}),
      "origlang": new abap.types.Character(1, {}),
      "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
      "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {}).set(INPUT.is_item); }
      try {
        if (abap.FunctionModules['RS_TABLE_LIST_CREATE'] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_FUNC not found"; } else { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_FUNC'.trimEnd()]();} }
        await abap.FunctionModules['RS_TABLE_LIST_CREATE']({exporting: {table_name: is_item.get().obj_name}});
        abap.builtin.sy.get().subrc.set(0);
      } catch (e) {
        if (e.classic) {
            switch (e.classic.toUpperCase()) {
            case "TABLE_IS_STRUCTURE": abap.builtin.sy.get().subrc.set(1); break;
            case "TABLE_NOT_EXISTS": abap.builtin.sy.get().subrc.set(2); break;
            case "DB_NOT_EXISTS": abap.builtin.sy.get().subrc.set(3); break;
            case "NO_PERMISSION": abap.builtin.sy.get().subrc.set(4); break;
            case "NO_CHANGE_ALLOWED": abap.builtin.sy.get().subrc.set(5); break;
            default: abap.builtin.sy.get().subrc.set(7); break;
              }
          } else {
              throw e;
          }
        }
        if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
          await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Table ${abap.templateFormatting(is_item.get().obj_name)} cannot be displayed`)});
        }
      }
      async list_key_fields(INPUT) {
        return zcl_abapgit_data_utils.list_key_fields(INPUT);
      }
      static async list_key_fields(INPUT) {
        let rt_names = abap.types.TableFactory.construct(new abap.types.Character(30, {"qualifiedName":"abap_compname"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_data_utils=>ty_names");
        let iv_name = INPUT?.iv_name;
        if (iv_name === undefined) { iv_name = new abap.types.Character(40, {}).set(INPUT.iv_name); }
        let lo_obj = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
        let lv_tabname = new abap.types.Character(16, {});
        let lr_ddfields = new abap.types.DataReference(new abap.types.Character(4));
        let lv_workaround = new abap.types.Character(20, {});
        let lr_struct = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_STRUCTDESCR", RTTIName: "\\CLASS=CL_ABAP_STRUCTDESCR"});
        let fs_lg_any_ = new abap.types.FieldSymbol(new abap.types.Character(4));
        let fs_lv_field_ = new abap.types.FieldSymbol(new abap.types.Character());
        let fs_lt_ddfields_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"}));
        lv_tabname.set(iv_name);
        try {
          if (abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()] === undefined) { if (abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_CLASS not found"; } else {throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'.trimEnd()](); } }
          if (abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()].database_table === undefined && abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()] === undefined) { throw "CX_SY_DYN_CALL_ILLEGAL_METHOD not found"; }
          if (abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()].database_table === undefined) { throw new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_METHOD'.trimEnd()](); }
          lo_obj.set(await abap.Classes['XCO_CP_ABAP_DICTIONARY'.trimEnd()].database_table({iv_name: lv_tabname}));
          abap.statements.assign({target: fs_lg_any_, dynamicName: 'lo_obj' + '->' + 'IF_XCO_DATABASE_TABLE~FIELDS->IF_XCO_DBT_FIELDS_FACTORY~KEY', dynamicSource: (() => {
              try { return lo_obj; } catch {}
              try { return this.lo_obj; } catch {}
          })()});
          if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
            const unique74 = await (new abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS']()).constructor_();
            unique74.EXTRA_CX = {"INTERNAL_FILENAME": "zcl_abapgit_data_utils.clas.abap","INTERNAL_LINE": 269};
            throw unique74;
          }
          lo_obj.set(fs_lg_any_);
          rt_names.set(await abap.dynamicCallLookup(lo_obj.get(), "if_xco_dbt_fields$get_names")());
        } catch (e) {
          if ((abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS'] && e instanceof abap.Classes['CX_SY_DYN_CALL_ILLEGAL_CLASS']) || (abap.Classes['CX_NO_CHECK'] && e instanceof abap.Classes['CX_NO_CHECK'])) {
            lv_workaround.set(abap.CharacterFactory.get(8, 'DDFIELDS'));
            abap.statements.createData(lr_ddfields,{"name": lv_workaround.get()});
            abap.statements.assign({target: fs_lt_ddfields_, source: lr_ddfields.dereference()});
            abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
            await abap.statements.cast(lr_struct, (await abap.Classes['CL_ABAP_TYPEDESCR'].describe_by_name({p_name: lv_tabname})));
            try {
              fs_lt_ddfields_.set(await lr_struct.get().get_ddic_field_list());
              abap.builtin.sy.get().subrc.set(0);
            } catch (e) {
              if (e.classic) {
                  switch (e.classic.toUpperCase()) {
                  case "NOT_FOUND": abap.builtin.sy.get().subrc.set(1); break;
                  case "NO_DDIC_TYPE": abap.builtin.sy.get().subrc.set(2); break;
                    }
                } else {
                    throw e;
                }
              }
              if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
                await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Table ${abap.templateFormatting(iv_name)} not found`)});
              }
              for await (const unique73 of abap.statements.loop(fs_lt_ddfields_)) {
                fs_lg_any_.assign(unique73);
                abap.statements.assign({component: abap.CharacterFactory.get(7, 'KEYFLAG'), target: fs_lv_field_, source: fs_lg_any_});
                if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) || abap.compare.ne(fs_lv_field_, abap.builtin.abap_true)) {
                  continue;
                }
                abap.statements.assign({component: abap.CharacterFactory.get(9, 'FIELDNAME'), target: fs_lv_field_, source: fs_lg_any_});
                abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
                abap.statements.append({source: fs_lv_field_, target: rt_names});
              }
            } else {
              throw e;
            }
          }
          return rt_names;
        }
      }
      abap.Classes['ZCL_ABAPGIT_DATA_UTILS'] = zcl_abapgit_data_utils;
      zcl_abapgit_data_utils.ty_names = abap.types.TableFactory.construct(new abap.types.Character(30, {"qualifiedName":"abap_compname"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_data_utils=>ty_names");
      zcl_abapgit_data_utils.ty_contflag = new abap.types.Character(1, {"qualifiedName":"zcl_abapgit_data_utils=>ty_contflag"});
export {zcl_abapgit_data_utils};