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 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 | 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_popups.clas.locals_imp.abap class lcl_object_decision_list { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_POPUPS-LCL_OBJECT_DECISION_LIST'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MR_TABLE": {"type": () => {return new abap.types.DataReference(new abap.types.Character(4));}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MO_TABLE_DESCR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TABLEDESCR", RTTIName: "\\CLASS=CL_ABAP_TABLEDESCR"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MO_ALV": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_SALV_TABLE", RTTIName: "\\CLASS=CL_SALV_TABLE"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_CANCEL": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MS_POSITION": {"type": () => {return new abap.types.Structure({ "start_column": new abap.types.Integer({qualifiedName: "I"}), "start_row": new abap.types.Integer({qualifiedName: "I"}), "end_column": new abap.types.Integer({qualifiedName: "I"}), "end_row": new abap.types.Integer({qualifiedName: "I"})}, "zif_abapgit_popups=>ty_popup_position", undefined, {}, {});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "C_DEFAULT_COLUMN": {"type": () => {return new abap.types.String({qualifiedName: "NAME"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "C_FIELDNAME_SELECTED": {"type": () => {return new abap.types.String({qualifiedName: "NAME"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "C_ANSWER_CANCEL": {"type": () => {return new abap.types.Character(1, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "C_FIELDNAME_OBJ_TYPE": {"type": () => {return new abap.types.String({qualifiedName: "NAME"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}, "C_OWN_PFSTATUS": {"type": () => {return new abap.types.Character(20, {"qualifiedName":"sy-pfkey"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}}; static METHODS = {"ON_SELECT_LIST_LINK_CLICK": {"visibility": "I", "parameters": {"ROW": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "COLUMN": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "ON_SELECT_LIST_FUNCTION_CLICK": {"visibility": "I", "parameters": {"E_SALV_FUNCTION": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "ON_DOUBLE_CLICK": {"visibility": "I", "parameters": {"ROW": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "COLUMN": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "CREATE_NEW_SELECTABLE_TABLE": {"visibility": "I", "parameters": {"IT_LIST": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"});}, "is_optional": " "}}}, "PRESELECT": {"visibility": "I", "parameters": {"IT_PRESELECTED_ROWS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TABLE_LINE"]},"secondary":[]}, "zif_abapgit_popups=>ty_rows");}, "is_optional": " "}}}, "CREATE_ALV": {"visibility": "I", "parameters": {"RO_ALV": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_SALV_TABLE", RTTIName: "\\CLASS=CL_SALV_TABLE"});}, "is_optional": " "}}}, "SETUP_COLUMNS": {"visibility": "I", "parameters": {"IO_COLUMNS": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "CL_SALV_COLUMNS_TABLE", RTTIName: "\\CLASS=CL_SALV_COLUMNS_TABLE"});}, "is_optional": " "}, "IV_SELECTION_MODE": {"type": () => {return (() => { throw new Error("Void type: SALV_DE_CONSTANT") })();}, "is_optional": " "}, "IV_SELECT_COLUMN_TEXT": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IT_COLUMNS_TO_DISPLAY": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-NAME"}), "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-TEXT"}), "length": (() => { throw new Error("Void type: LVC_OUTLEN") })(), "show_icon": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "center": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_popups=>ty_alv_column", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_popups=>ty_alv_column_tt");}, "is_optional": " "}}}, "SETUP_TOOLBAR": {"visibility": "I", "parameters": {"IV_SELECTION_MODE": {"type": () => {return (() => { throw new Error("Void type: SALV_DE_CONSTANT") })();}, "is_optional": " "}, "IV_OBJECT_LIST": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "ASK_USER_FOR_OBJ_CATEGORY": {"visibility": "I", "parameters": {"RV_CATEGORY": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "MARK_CATEGORY": {"visibility": "I", "parameters": {"IV_CATEGORY": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "MARK_ALL": {"visibility": "I", "parameters": {"IV_SELECTED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "MARK_VISIBLE": {"visibility": "I", "parameters": {"IV_SELECTED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "MARK_SELECTED": {"visibility": "I", "parameters": {}}, "MARK_INDEXED": {"visibility": "I", "parameters": {"IV_SELECTED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_INVERT": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IT_SCOPE": {"type": () => {return (() => { throw new Error("Void type: LVC_T_FIDX") })();}, "is_optional": " "}}}, "ARE_ALL_MARKED": {"visibility": "I", "parameters": {"RV_YES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IT_SCOPE": {"type": () => {return (() => { throw new Error("Void type: LVC_T_FIDX") })();}, "is_optional": " "}}}, "REFRESH": {"visibility": "I", "parameters": {}}, "CONSTRUCTOR": {"visibility": "U", "parameters": {"IT_LIST": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"});}, "is_optional": " "}, "IV_TITLE": {"type": () => {return new abap.types.Character(70, {"qualifiedName":"LVC_TITLE","ddicName":"LVC_TITLE","description":"LVC_TITLE"});}, "is_optional": " "}, "IV_HEADER_TEXT": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IS_POSITION": {"type": () => {return new abap.types.Structure({ "start_column": new abap.types.Integer({qualifiedName: "I"}), "start_row": new abap.types.Integer({qualifiedName: "I"}), "end_column": new abap.types.Integer({qualifiedName: "I"}), "end_row": new abap.types.Integer({qualifiedName: "I"})}, "zif_abapgit_popups=>ty_popup_position", undefined, {}, {});}, "is_optional": " "}, "IV_STRIPED_PATTERN": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_OPTIMIZE_COL_WIDTH": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_SELECTION_MODE": {"type": () => {return (() => { throw new Error("Void type: SALV_DE_CONSTANT") })();}, "is_optional": " "}, "IV_SELECT_COLUMN_TEXT": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IT_COLUMNS_TO_DISPLAY": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-NAME"}), "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-TEXT"}), "length": (() => { throw new Error("Void type: LVC_OUTLEN") })(), "show_icon": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "center": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_popups=>ty_alv_column", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_popups=>ty_alv_column_tt");}, "is_optional": " "}, "IT_PRESELECTED_ROWS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TABLE_LINE"]},"secondary":[]}, "zif_abapgit_popups=>ty_rows");}, "is_optional": " "}}}, "DISPLAY": {"visibility": "U", "parameters": {}}, "GET_SELECTED": {"visibility": "U", "parameters": {"ET_LIST": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"});}, "is_optional": " "}}}}; #mr_table; #mo_table_descr; #mo_alv; #mv_cancel; #ms_position; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "on_select_list_link_click": this.#on_select_list_link_click.bind(this), "on_select_list_function_click": this.#on_select_list_function_click.bind(this), "on_double_click": this.#on_double_click.bind(this), "create_new_selectable_table": this.#create_new_selectable_table.bind(this), "preselect": this.#preselect.bind(this), "create_alv": this.#create_alv.bind(this), "setup_columns": this.#setup_columns.bind(this), "setup_toolbar": this.#setup_toolbar.bind(this), "ask_user_for_obj_category": this.#ask_user_for_obj_category.bind(this), "mark_category": this.#mark_category.bind(this), "mark_all": this.#mark_all.bind(this), "mark_visible": this.#mark_visible.bind(this), "mark_selected": this.#mark_selected.bind(this), "mark_indexed": this.#mark_indexed.bind(this), "are_all_marked": this.#are_all_marked.bind(this), "refresh": this.#refresh.bind(this), "display": this.display.bind(this), "get_selected": this.get_selected.bind(this), }; this.#mr_table = new abap.types.DataReference(new abap.types.Character(4)); this.FRIENDS_ACCESS_INSTANCE["mr_table"] = this.#mr_table; this.#mo_table_descr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_TABLEDESCR", RTTIName: "\\CLASS=CL_ABAP_TABLEDESCR"}); this.FRIENDS_ACCESS_INSTANCE["mo_table_descr"] = this.#mo_table_descr; this.#mo_alv = new abap.types.ABAPObject({qualifiedName: "CL_SALV_TABLE", RTTIName: "\\CLASS=CL_SALV_TABLE"}); this.FRIENDS_ACCESS_INSTANCE["mo_alv"] = this.#mo_alv; this.#mv_cancel = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_cancel"] = this.#mv_cancel; this.#ms_position = new abap.types.Structure({ "start_column": new abap.types.Integer({qualifiedName: "I"}), "start_row": new abap.types.Integer({qualifiedName: "I"}), "end_column": new abap.types.Integer({qualifiedName: "I"}), "end_row": new abap.types.Integer({qualifiedName: "I"})}, "zif_abapgit_popups=>ty_popup_position", undefined, {}, {}); this.FRIENDS_ACCESS_INSTANCE["ms_position"] = this.#ms_position; this.c_default_column = lcl_object_decision_list.c_default_column; this.c_fieldname_selected = lcl_object_decision_list.c_fieldname_selected; this.c_answer_cancel = lcl_object_decision_list.c_answer_cancel; this.c_fieldname_obj_type = lcl_object_decision_list.c_fieldname_obj_type; this.c_own_pfstatus = lcl_object_decision_list.c_own_pfstatus; } async display() { await this.#mo_alv.get().display(); if (abap.compare.eq(this.#mv_cancel, abap.builtin.abap_true)) { const unique1037 = await (new abap.Classes['ZCX_ABAPGIT_CANCEL']()).constructor_(); unique1037.EXTRA_CX = {"INTERNAL_FILENAME": "zcl_abapgit_popups.clas.locals_imp.abap","INTERNAL_LINE": 116}; throw unique1037; } } async #refresh() { let ls_stable = (() => { throw new Error("Void type: LVC_S_STBL") })(); ls_stable.get().row.set(abap.CharacterFactory.get(1, 'X')); ls_stable.get().col.set(abap.CharacterFactory.get(1, 'X')); await this.#mo_alv.get().refresh({refresh_mode: ls_stable}); } async get_selected(INPUT) { let et_list = INPUT?.et_list || abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"}); let lv_condition = new abap.types.String({qualifiedName: "STRING"}); let lr_exporting = new abap.types.DataReference(new abap.types.Character(4)); let lo_data_descr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}); let lo_selections = (() => { throw new Error("Void type: cl_salv_selections") })(); let lt_selected_rows = (() => { throw new Error("Void type: SALV_T_ROW") })(); let fs_lg_exporting_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lg_value_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lv_selected_ = new abap.types.FieldSymbol(new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})); let fs_lv_selected_row_ = new abap.types.FieldSymbol((() => { throw new Error("Void type: SALV_T_ROW") })()); et_list.clear(); if (abap.compare.eq(this.#mv_cancel, abap.builtin.abap_true)) { return; } abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); lo_selections.set((await this.#mo_alv.get().get_selections())); if (abap.compare.eq((await lo_selections.get().get_selection_mode()), abap.Classes['IF_SALV_C_SELECTION_MODE'].if_salv_c_selection_mode$single)) { lt_selected_rows.set((await lo_selections.get().get_selected_rows())); for await (const unique1038 of abap.statements.loop(lt_selected_rows)) { fs_lv_selected_row_.assign(unique1038); abap.statements.readTable(fs_lt_table_,{index: fs_lv_selected_row_, assigning: fs_ls_line_}); if (!(abap.compare.assigned(fs_ls_line_))) { continue; } abap.statements.assign({component: lcl_object_decision_list.c_fieldname_selected, target: fs_lv_selected_, source: fs_ls_line_}); if (!(abap.compare.assigned(fs_lv_selected_))) { continue; } fs_lv_selected_.set(abap.builtin.abap_true); } } lv_condition.set(new abap.types.String().set(`${abap.templateFormatting(lcl_object_decision_list.c_fieldname_selected)} = ABAP_TRUE`)); abap.statements.createData(lr_exporting,{"likeLineOf": et_list}); abap.statements.assign({target: fs_lg_exporting_, source: lr_exporting.dereference()}); lo_data_descr.set((await this.#mo_table_descr.get().get_table_line_type())); for await (const unique1039 of abap.statements.loop(fs_lt_table_,{dynamicWhere: {condition: lv_condition.get(), evaluate: (name) => {try { return eval(name);} catch {}}}})) { fs_ls_line_.assign(unique1039); fs_lg_exporting_.clear(); let unique1040 = lo_data_descr.get().kind; if (abap.compare.eq(unique1040, abap.Classes['CL_ABAP_ELEMDESCR'].kind_elem)) { abap.statements.assign({component: lcl_object_decision_list.c_default_column, target: fs_lg_value_, source: fs_ls_line_}); abap.statements.assert(abap.compare.assigned(fs_lg_value_)); fs_lg_exporting_.set(fs_lg_value_); } else { abap.statements.moveCorresponding(fs_ls_line_, fs_lg_exporting_); } abap.statements.append({source: fs_lg_exporting_, target: et_list}); } } async #create_alv() { let ro_alv = new abap.types.ABAPObject({qualifiedName: "CL_SALV_TABLE", RTTIName: "\\CLASS=CL_SALV_TABLE"}); let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); await abap.Classes['CL_SALV_TABLE'].factory({r_salv_table: ro_alv, t_table: fs_lt_table_}); return ro_alv; } async constructor_(INPUT) { let it_list = INPUT?.it_list; let iv_title = new abap.types.Character(70, {"qualifiedName":"LVC_TITLE","ddicName":"LVC_TITLE","description":"LVC_TITLE"}); if (INPUT && INPUT.iv_title) {iv_title.set(INPUT.iv_title);} if (INPUT === undefined || INPUT.iv_title === undefined) {iv_title = abap.builtin.space;} let iv_header_text = INPUT?.iv_header_text || new abap.types.Character(); if (INPUT === undefined || INPUT.iv_header_text === undefined) {iv_header_text = abap.builtin.space;} let is_position = INPUT?.is_position; if (is_position?.getQualifiedName === undefined || is_position.getQualifiedName() !== "ZIF_ABAPGIT_POPUPS=>TY_POPUP_POSITION") { is_position = undefined; } if (is_position === undefined) { is_position = new abap.types.Structure({ "start_column": new abap.types.Integer({qualifiedName: "I"}), "start_row": new abap.types.Integer({qualifiedName: "I"}), "end_column": new abap.types.Integer({qualifiedName: "I"}), "end_row": new abap.types.Integer({qualifiedName: "I"})}, "zif_abapgit_popups=>ty_popup_position", undefined, {}, {}).set(INPUT.is_position); } let iv_striped_pattern = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_striped_pattern) {iv_striped_pattern.set(INPUT.iv_striped_pattern);} if (INPUT === undefined || INPUT.iv_striped_pattern === undefined) {iv_striped_pattern = abap.builtin.abap_false;} let iv_optimize_col_width = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_optimize_col_width) {iv_optimize_col_width.set(INPUT.iv_optimize_col_width);} if (INPUT === undefined || INPUT.iv_optimize_col_width === undefined) {iv_optimize_col_width = abap.builtin.abap_true;} let iv_selection_mode = (() => { throw new Error("Void type: SALV_DE_CONSTANT") })(); if (INPUT && INPUT.iv_selection_mode) {iv_selection_mode.set(INPUT.iv_selection_mode);} if (INPUT === undefined || INPUT.iv_selection_mode === undefined) {iv_selection_mode = abap.Classes['IF_SALV_C_SELECTION_MODE'].if_salv_c_selection_mode$multiple;} let iv_select_column_text = INPUT?.iv_select_column_text || new abap.types.Character(); if (INPUT === undefined || INPUT.iv_select_column_text === undefined) {iv_select_column_text = abap.builtin.space;} let it_columns_to_display = INPUT?.it_columns_to_display; if (it_columns_to_display?.getQualifiedName === undefined || it_columns_to_display.getQualifiedName() !== "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN_TT") { it_columns_to_display = undefined; } if (it_columns_to_display === undefined) { it_columns_to_display = abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-NAME"}), "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-TEXT"}), "length": (() => { throw new Error("Void type: LVC_OUTLEN") })(), "show_icon": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "center": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_popups=>ty_alv_column", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_popups=>ty_alv_column_tt").set(INPUT.it_columns_to_display); } let it_preselected_rows = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TABLE_LINE"]},"secondary":[]}, "zif_abapgit_popups=>ty_rows"); if (INPUT && INPUT.it_preselected_rows) {it_preselected_rows.set(INPUT.it_preselected_rows);} let lv_object_list = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let lo_events = new abap.types.ABAPObject({qualifiedName: "CL_SALV_EVENTS_TABLE", RTTIName: "\\CLASS=CL_SALV_EVENTS_TABLE"}); let lo_columns = new abap.types.ABAPObject({qualifiedName: "CL_SALV_COLUMNS_TABLE", RTTIName: "\\CLASS=CL_SALV_COLUMNS_TABLE"}); let lo_table_header = (() => { throw new Error("Void type: cl_salv_form_text") })(); await this.#create_new_selectable_table({it_list: it_list}); await this.#preselect({it_preselected_rows: it_preselected_rows}); try { this.#mo_alv.set((await this.#create_alv())); await this.#mo_alv.get().set_screen_popup({start_column: is_position.get().start_column, end_column: is_position.get().end_column, start_line: is_position.get().start_row, end_line: is_position.get().end_row}); this.#ms_position.set(is_position); lo_events.set((await this.#mo_alv.get().get_event())); abap.statements.setHandler({EVENT_NAME: "LINK_CLICK", EVENT_CLASS: "CL_SALV_EVENTS_TABLE"}, [this.on_select_list_link_click.bind(this)], "ALL"); abap.statements.setHandler({EVENT_NAME: "ADDED_FUNCTION", EVENT_CLASS: "CL_SALV_EVENTS_TABLE"}, [this.on_select_list_function_click.bind(this)], "ALL"); abap.statements.setHandler({EVENT_NAME: "DOUBLE_CLICK", EVENT_CLASS: "CL_SALV_EVENTS_TABLE"}, [this.on_double_click.bind(this)], "ALL"); if (abap.compare.cn(iv_title, abap.CharacterFactory.get(3, ' _0'))) { await (await this.#mo_alv.get().get_display_settings()).get().set_list_header({val: iv_title}); } if (abap.compare.cn(iv_header_text, abap.CharacterFactory.get(3, ' _0'))) { lo_table_header.set(await (new abap.Classes['RUNTIME_ERROR']()).constructor_({text: iv_header_text})); await this.#mo_alv.get().set_top_of_list({val: lo_table_header}); } await (await this.#mo_alv.get().get_display_settings()).get().set_striped_pattern({value: iv_striped_pattern}); await (await this.#mo_alv.get().get_selections()).get().set_selection_mode({value: iv_selection_mode}); lo_columns.set((await this.#mo_alv.get().get_columns())); await lo_columns.get().set_optimize({value: iv_optimize_col_width}); try { await lo_columns.get().get_column({columnname: new abap.types.String().set(`${abap.templateFormatting(lcl_object_decision_list.c_fieldname_obj_type)}`)}); lv_object_list.set(abap.builtin.abap_true); } catch (e) { if ((abap.Classes['CX_SALV_NOT_FOUND'] && e instanceof abap.Classes['CX_SALV_NOT_FOUND'])) { } else { throw e; } } await this.#setup_columns({io_columns: lo_columns, iv_selection_mode: iv_selection_mode, iv_select_column_text: iv_select_column_text, it_columns_to_display: it_columns_to_display}); await this.#setup_toolbar({iv_object_list: lv_object_list, iv_selection_mode: iv_selection_mode}); } catch (e) { if ((abap.Classes['CX_SALV_MSG'] && e instanceof abap.Classes['CX_SALV_MSG'])) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(35, 'ALV error from object decision list')}); } else { throw e; } } return this; } async #create_new_selectable_table(INPUT) { let it_list = INPUT?.it_list; let lr_struct = new abap.types.DataReference(new abap.types.Character(4)); let lt_components = abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "NAME"}), "type": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "as_include": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "suffix": new abap.types.String({qualifiedName: "SUFFIX"})}, "abap_componentdescr", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "abap_component_tab"); let lo_data_descr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}); let lo_elem_descr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_ELEMDESCR", RTTIName: "\\CLASS=CL_ABAP_ELEMDESCR"}); let lo_struct_descr = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_STRUCTDESCR", RTTIName: "\\CLASS=CL_ABAP_STRUCTDESCR"}); let lo_struct_descr2 = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_STRUCTDESCR", RTTIName: "\\CLASS=CL_ABAP_STRUCTDESCR"}); let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_ls_component_ = new abap.types.FieldSymbol(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "NAME"}), "type": new abap.types.ABAPObject({qualifiedName: "CL_ABAP_DATADESCR", RTTIName: "\\CLASS=CL_ABAP_DATADESCR"}), "as_include": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "suffix": new abap.types.String({qualifiedName: "SUFFIX"})}, "abap_componentdescr", undefined, {}, {})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lg_data_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lg_value_ = new abap.types.FieldSymbol(new abap.types.Character(4)); await abap.statements.cast(this.#mo_table_descr, (await abap.Classes['CL_ABAP_TABLEDESCR'].describe_by_data({p_data: it_list}))); lo_data_descr.set((await this.#mo_table_descr.get().get_table_line_type())); let unique1041 = lo_data_descr.get().kind; if (abap.compare.eq(unique1041, abap.Classes['CL_ABAP_ELEMDESCR'].kind_elem)) { await abap.statements.cast(lo_elem_descr, (await this.#mo_table_descr.get().get_table_line_type())); abap.statements.insertInternal({initial: true, index: abap.IntegerFactory.get(1), assigning: fs_ls_component_, table: lt_components}); fs_ls_component_.get().name.set(lcl_object_decision_list.c_default_column); fs_ls_component_.get().type.set(lo_elem_descr); } else if (abap.compare.eq(unique1041, abap.Classes['CL_ABAP_ELEMDESCR'].kind_struct)) { await abap.statements.cast(lo_struct_descr, (await this.#mo_table_descr.get().get_table_line_type())); lt_components.set((await lo_struct_descr.get().get_components())); } if (abap.compare.initial(lt_components)) { return; } abap.statements.insertInternal({initial: true, index: abap.IntegerFactory.get(1), assigning: fs_ls_component_, table: lt_components}); fs_ls_component_.get().name.set(lcl_object_decision_list.c_fieldname_selected); await abap.statements.cast(fs_ls_component_.get().type, (await abap.Classes['CL_ABAP_DATADESCR'].describe_by_name({p_name: abap.CharacterFactory.get(4, 'FLAG')}))); lo_struct_descr2.set((await abap.Classes['CL_ABAP_STRUCTDESCR'].create({p_components: lt_components}))); this.#mo_table_descr.set((await abap.Classes['CL_ABAP_TABLEDESCR'].create({p_line_type: lo_struct_descr2}))); if (abap.Classes['KERNEL_CREATE_DATA_HANDLE'] === undefined) throw new Error("CreateData, kernel class missing"); await abap.Classes['KERNEL_CREATE_DATA_HANDLE'].call({handle: this.#mo_table_descr, dref: this.#mr_table}); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); 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_struct_descr2, dref: lr_struct}); abap.statements.assign({target: fs_ls_line_, source: lr_struct.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); for await (const unique1042 of abap.statements.loop(it_list)) { fs_lg_data_.assign(unique1042); fs_ls_line_.clear(); let unique1043 = lo_data_descr.get().kind; if (abap.compare.eq(unique1043, abap.Classes['CL_ABAP_ELEMDESCR'].kind_elem)) { abap.statements.assign({component: lcl_object_decision_list.c_default_column, target: fs_lg_value_, source: fs_lg_data_}); abap.statements.assert(abap.compare.assigned(fs_lg_value_)); fs_ls_line_.set(fs_lg_value_); } else { abap.statements.moveCorresponding(fs_lg_data_, fs_ls_line_); } abap.statements.insertInternal({data: fs_ls_line_, table: fs_lt_table_}); } } async #preselect(INPUT) { let it_preselected_rows = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TABLE_LINE"]},"secondary":[]}, "zif_abapgit_popups=>ty_rows"); if (INPUT && INPUT.it_preselected_rows) {it_preselected_rows.set(INPUT.it_preselected_rows);} let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_lv_row_ = new abap.types.FieldSymbol(new abap.types.Integer({qualifiedName: "I"})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lv_selected_ = new abap.types.FieldSymbol(new abap.types.Character(4)); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); for await (const unique1044 of abap.statements.loop(it_preselected_rows)) { fs_lv_row_.assign(unique1044); abap.statements.readTable(fs_lt_table_,{index: fs_lv_row_, assigning: fs_ls_line_}); 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(`Preselected row ${abap.templateFormatting(fs_lv_row_)} doesn't exist`)}); } abap.statements.assign({component: lcl_object_decision_list.c_fieldname_selected, target: fs_lv_selected_, source: fs_ls_line_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); fs_lv_selected_.set(abap.builtin.abap_true); } } async #on_double_click(INPUT) { let row = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.row) {row = INPUT.row;} let column = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.column) {column = INPUT.column;} let lo_selections = (() => { throw new Error("Void type: cl_salv_selections") })(); lo_selections.set((await this.#mo_alv.get().get_selections())); if (abap.compare.eq((await lo_selections.get().get_selection_mode()), abap.Classes['IF_SALV_C_SELECTION_MODE'].if_salv_c_selection_mode$single)) { await this.#mo_alv.get().close_screen(); } } async #on_select_list_function_click(INPUT) { let e_salv_function = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.e_salv_function) {e_salv_function = INPUT.e_salv_function;} let unique1045 = e_salv_function; if (abap.compare.eq(unique1045, abap.CharacterFactory.get(4, 'O.K.')) || abap.compare.eq(unique1045, abap.CharacterFactory.get(2, 'OK'))) { this.#mv_cancel.set(abap.builtin.abap_false); await this.#mo_alv.get().close_screen(); } else if (abap.compare.eq(unique1045, abap.CharacterFactory.get(3, 'ABR')) || abap.compare.eq(unique1045, abap.CharacterFactory.get(6, 'CANCEL'))) { this.#mv_cancel.set(abap.builtin.abap_true); await this.#mo_alv.get().close_screen(); } else if (abap.compare.eq(unique1045, abap.CharacterFactory.get(4, 'SALL')) || abap.compare.eq(unique1045, abap.CharacterFactory.get(7, 'SEL_ALL'))) { await this.#mark_visible({iv_selected: abap.builtin.abap_true}); await this.#refresh(); } else if (abap.compare.eq(unique1045, abap.CharacterFactory.get(4, 'DSEL')) || abap.compare.eq(unique1045, abap.CharacterFactory.get(7, 'SEL_DEL'))) { await this.#mark_visible({iv_selected: abap.builtin.abap_false}); await this.#refresh(); } else if (abap.compare.eq(unique1045, abap.CharacterFactory.get(7, 'SEL_KEY'))) { await this.#mark_selected(); await this.#refresh(); } else if (abap.compare.eq(unique1045, abap.CharacterFactory.get(7, 'SEL_CAT'))) { await this.#mark_category({iv_category: (await this.#ask_user_for_obj_category())}); await this.#refresh(); } else { this.#mv_cancel.set(abap.builtin.abap_true); await this.#mo_alv.get().close_screen(); } } async #mark_all(INPUT) { let iv_selected = INPUT?.iv_selected; if (iv_selected?.getQualifiedName === undefined || iv_selected.getQualifiedName() !== "ABAP_BOOL") { iv_selected = undefined; } if (iv_selected === undefined) { iv_selected = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}).set(INPUT.iv_selected); } let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lv_selected_ = new abap.types.FieldSymbol(new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); for await (const unique1046 of abap.statements.loop(fs_lt_table_)) { fs_ls_line_.assign(unique1046); abap.statements.assign({component: lcl_object_decision_list.c_fieldname_selected, target: fs_lv_selected_, source: fs_ls_line_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); fs_lv_selected_.set(iv_selected); } } async #are_all_marked(INPUT) { let rv_yes = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let it_scope = INPUT?.it_scope; if (it_scope === undefined) { it_scope = (() => { throw new Error("Void type: LVC_T_FIDX") })().set(INPUT.it_scope); } let lv_index = (() => { throw new Error("Void type: LVC_T_FIDX") })(); let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lv_selected_ = new abap.types.FieldSymbol(new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); for await (const unique1047 of abap.statements.loop(it_scope)) { lv_index.set(unique1047); abap.statements.readTable(fs_lt_table_,{index: lv_index, assigning: fs_ls_line_}); if (!(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)))) { continue; } abap.statements.assign({component: lcl_object_decision_list.c_fieldname_selected, target: fs_lv_selected_, source: fs_ls_line_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); if (abap.compare.eq(fs_lv_selected_, abap.builtin.abap_true)) { rv_yes.set(abap.builtin.abap_true); } else { rv_yes.set(abap.builtin.abap_false); return rv_yes; } } return rv_yes; } async #mark_selected() { let lt_clear = (() => { throw new Error("Void type: SALV_T_ROW") })(); let lt_scope = (() => { throw new Error("Void type: LVC_T_FIDX") })(); lt_scope.set((await (await this.#mo_alv.get().get_selections()).get().get_selected_rows())); if (abap.compare.gt(abap.builtin.lines({val: lt_scope}), abap.IntegerFactory.get(0))) { await this.#mark_indexed({it_scope: lt_scope, iv_selected: abap.builtin.boolc(abap.compare.eq((await this.#are_all_marked({it_scope: lt_scope})), abap.builtin.abap_false))}); await (await this.#mo_alv.get().get_selections()).get().set_selected_rows({val: lt_clear}); } else { await abap.statements.message({text: abap.CharacterFactory.get(30, 'Select rows first to mark them'), type: abap.CharacterFactory.get(1, 'S')}); } } async #mark_visible(INPUT) { let iv_selected = INPUT?.iv_selected; if (iv_selected?.getQualifiedName === undefined || iv_selected.getQualifiedName() !== "ABAP_BOOL") { iv_selected = undefined; } if (iv_selected === undefined) { iv_selected = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}).set(INPUT.iv_selected); } let lt_filters = (() => { throw new Error("Void type: LVC_T_FILT") })(); let lt_scope = (() => { throw new Error("Void type: LVC_T_FIDX") })(); let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); lt_filters.set((await abap.Classes['CL_SALV_CONTROLLER_METADATA'].get_lvc_filter((await this.#mo_alv.get().get_filters())))); if (abap.compare.eq(abap.builtin.lines({val: lt_filters}), abap.IntegerFactory.get(0))) { await this.#mark_all({iv_selected: iv_selected}); return; } if (abap.FunctionModules['LVC_FILTER_APPLY'] === 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['LVC_FILTER_APPLY']({exporting: {it_filter: lt_filters}, importing: {et_filter_index_inside: lt_scope}, tables: {it_data: fs_lt_table_}}); await this.#mark_indexed({it_scope: lt_scope, iv_selected: iv_selected}); } async #mark_indexed(INPUT) { let iv_selected = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_selected) {iv_selected.set(INPUT.iv_selected);} if (INPUT === undefined || INPUT.iv_selected === undefined) {iv_selected = abap.builtin.abap_true;} let iv_invert = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_invert) {iv_invert.set(INPUT.iv_invert);} if (INPUT === undefined || INPUT.iv_invert === undefined) {iv_invert = abap.builtin.abap_false;} let it_scope = INPUT?.it_scope; if (it_scope === undefined) { it_scope = (() => { throw new Error("Void type: LVC_T_FIDX") })().set(INPUT.it_scope); } let lv_index = (() => { throw new Error("Void type: LVC_T_FIDX") })(); let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lv_selected_ = new abap.types.FieldSymbol(new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); for await (const unique1048 of abap.statements.loop(it_scope)) { lv_index.set(unique1048); abap.statements.readTable(fs_lt_table_,{index: lv_index, assigning: fs_ls_line_}); if (!(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)))) { continue; } abap.statements.assign({component: lcl_object_decision_list.c_fieldname_selected, target: fs_lv_selected_, source: fs_ls_line_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); if (abap.compare.eq(iv_invert, abap.builtin.abap_true)) { fs_lv_selected_.set(abap.builtin.boolc(abap.compare.eq(fs_lv_selected_, abap.builtin.abap_false))); } else { fs_lv_selected_.set(iv_selected); } } } async #ask_user_for_obj_category() { let rv_category = new abap.types.String({qualifiedName: "STRING"}); let lv_answer = new abap.types.Character(1, {}); let ls_position = new abap.types.Structure({ "start_column": new abap.types.Integer({qualifiedName: "I"}), "start_row": new abap.types.Integer({qualifiedName: "I"}), "end_column": new abap.types.Integer({qualifiedName: "I"}), "end_row": new abap.types.Integer({qualifiedName: "I"})}, "zif_abapgit_popups=>ty_popup_position", undefined, {}, {}); let ls_selection = (() => { throw new Error("Void type: SPOPLI") })(); let lt_selection = abap.types.TableFactory.construct((() => { throw new Error("Void type: SPOPLI") })(), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, ""); ls_selection.get().varoption.set(abap.CharacterFactory.get(8, 'Packages')); abap.statements.append({source: ls_selection, target: lt_selection}); ls_selection.get().varoption.set(abap.CharacterFactory.get(12, 'DDIC objects')); abap.statements.append({source: ls_selection, target: lt_selection}); ls_selection.get().varoption.set(abap.CharacterFactory.get(11, 'Source code')); abap.statements.append({source: ls_selection, target: lt_selection}); ls_selection.get().varoption.set(abap.CharacterFactory.get(12, 'Enhancements')); abap.statements.append({source: ls_selection, target: lt_selection}); ls_position.get().start_column.set(abap.operators.add(this.#ms_position.get().start_column,abap.IntegerFactory.get(20))); ls_position.get().start_row.set(abap.operators.add(this.#ms_position.get().start_row,abap.IntegerFactory.get(5))); try { if (abap.FunctionModules['POPUP_TO_DECIDE_LIST'] === 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['POPUP_TO_DECIDE_LIST']({exporting: {titel: abap.CharacterFactory.get(9, 'Selection'), textline1: abap.CharacterFactory.get(47, 'Which objects should be added to the selection?'), start_col: ls_position.get().start_column, start_row: ls_position.get().start_row, cursorline: abap.IntegerFactory.get(1)}, importing: {answer: lv_answer}, tables: {t_spopli: lt_selection}}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { default: abap.builtin.sy.get().subrc.set(1); break; } } else { throw e; } } if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) || abap.compare.eq(lv_answer, lcl_object_decision_list.c_answer_cancel)) { return rv_category; } abap.statements.readTable(lt_selection,{index: lv_answer, into: ls_selection}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { rv_category.set(ls_selection.get().varoption); } return rv_category; } async #mark_category(INPUT) { let iv_category = INPUT?.iv_category; if (iv_category?.getQualifiedName === undefined || iv_category.getQualifiedName() !== "STRING") { iv_category = undefined; } if (iv_category === undefined) { iv_category = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_category); } let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_lv_obj_type_ = new abap.types.FieldSymbol(new abap.types.Character(4, {})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lv_selected_ = new abap.types.FieldSymbol(new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})); if (abap.compare.initial(iv_category)) { return; } abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); for await (const unique1049 of abap.statements.loop(fs_lt_table_)) { fs_ls_line_.assign(unique1049); abap.statements.assign({component: lcl_object_decision_list.c_fieldname_obj_type, target: fs_lv_obj_type_, source: fs_ls_line_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); abap.statements.assign({component: lcl_object_decision_list.c_fieldname_selected, target: fs_lv_selected_, source: fs_ls_line_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); let unique1050 = iv_category; if (abap.compare.eq(unique1050, abap.CharacterFactory.get(8, 'Packages'))) { if (abap.compare.ne(fs_lv_obj_type_, abap.CharacterFactory.get(4, 'DEVC'))) { continue; } } else if (abap.compare.eq(unique1050, abap.CharacterFactory.get(12, 'DDIC objects'))) { if (abap.compare.eq((await abap.Classes['ZCL_ABAPGIT_OBJECTS_ACTIVATION'].is_ddic_type(fs_lv_obj_type_)), abap.builtin.abap_false)) { continue; } } else if (abap.compare.eq(unique1050, abap.CharacterFactory.get(11, 'Source code'))) { if (abap.compare.ns(abap.CharacterFactory.get(24, 'CLAS,FUGR,INTF,PROG,TYPE'), fs_lv_obj_type_)) { continue; } } else if (abap.compare.eq(unique1050, abap.CharacterFactory.get(12, 'Enhancements'))) { if (abap.compare.ns(abap.CharacterFactory.get(19, 'ENHO,ENHS,ENHC,ENSC'), fs_lv_obj_type_)) { continue; } } else { return; } fs_lv_selected_.set(abap.builtin.abap_true); } } async #on_select_list_link_click(INPUT) { let row = new abap.types.Integer({qualifiedName: "I"}); if (INPUT && INPUT.row) {row = INPUT.row;} let column = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.column) {column = INPUT.column;} let fs_lt_table_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); let fs_ls_line_ = new abap.types.FieldSymbol(new abap.types.Character(4)); let fs_lv_selected_ = new abap.types.FieldSymbol(new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})); abap.statements.assign({target: fs_lt_table_, source: this.#mr_table.dereference()}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); abap.statements.readTable(fs_lt_table_,{index: row, assigning: fs_ls_line_}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { abap.statements.assign({component: lcl_object_decision_list.c_fieldname_selected, target: fs_lv_selected_, source: fs_ls_line_}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); fs_lv_selected_.set(abap.builtin.boolc(abap.compare.eq(fs_lv_selected_, abap.builtin.abap_false))); } await this.#refresh(); } async #setup_columns(INPUT) { let io_columns = INPUT?.io_columns; if (io_columns?.getQualifiedName === undefined || io_columns.getQualifiedName() !== "CL_SALV_COLUMNS_TABLE") { io_columns = undefined; } if (io_columns === undefined) { io_columns = new abap.types.ABAPObject({qualifiedName: "CL_SALV_COLUMNS_TABLE", RTTIName: "\\CLASS=CL_SALV_COLUMNS_TABLE"}).set(INPUT.io_columns); } let iv_selection_mode = INPUT?.iv_selection_mode; if (iv_selection_mode === undefined) { iv_selection_mode = (() => { throw new Error("Void type: SALV_DE_CONSTANT") })().set(INPUT.iv_selection_mode); } let iv_select_column_text = INPUT?.iv_select_column_text; let it_columns_to_display = INPUT?.it_columns_to_display; if (it_columns_to_display?.getQualifiedName === undefined || it_columns_to_display.getQualifiedName() !== "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN_TT") { it_columns_to_display = undefined; } if (it_columns_to_display === undefined) { it_columns_to_display = abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-NAME"}), "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-TEXT"}), "length": (() => { throw new Error("Void type: LVC_OUTLEN") })(), "show_icon": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "center": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_popups=>ty_alv_column", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_popups=>ty_alv_column_tt").set(INPUT.it_columns_to_display); } let lt_columns = (() => { throw new Error("Void type: SALV_T_COLUMN_REF") })(); let ls_column = (() => { throw new Error("Void type: SALV_S_COLUMN_REF") })(); let lo_column = new abap.types.ABAPObject({qualifiedName: "CL_SALV_COLUMN_LIST", RTTIName: "\\CLASS=CL_SALV_COLUMN_LIST"}); let fs_ls_column_to_display_ = new abap.types.FieldSymbol(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-NAME"}), "text": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_POPUPS=>TY_ALV_COLUMN-TEXT"}), "length": (() => { throw new Error("Void type: LVC_OUTLEN") })(), "show_icon": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "center": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_popups=>ty_alv_column", undefined, {}, {})); lt_columns.set((await io_columns.get().get())); for await (const unique1051 of abap.statements.loop(lt_columns)) { ls_column.set(unique1051); await abap.statements.cast(lo_column, ls_column.get().r_column); if (abap.compare.eq(iv_selection_mode, abap.Classes['IF_SALV_C_SELECTION_MODE'].if_salv_c_selection_mode$multiple) && abap.compare.eq(ls_column.get().columnname, lcl_object_decision_list.c_fieldname_selected)) { await lo_column.get().set_cell_type({value: abap.Classes['IF_SALV_C_CELL_TYPE'].if_salv_c_cell_type$checkbox_hotspot}); await lo_column.get().set_output_length({value: abap.IntegerFactory.get(20)}); await lo_column.get().set_short_text({value: new abap.types.String().set(`${abap.templateFormatting(iv_select_column_text)}`)}); await lo_column.get().set_medium_text({value: new abap.types.String().set(`${abap.templateFormatting(iv_select_column_text)}`)}); await lo_column.get().set_long_text({value: new abap.types.String().set(`${abap.templateFormatting(iv_select_column_text)}`)}); continue; } abap.statements.readTable(it_columns_to_display,{assigning: fs_ls_column_to_display_, withKey: (i) => {return abap.compare.eq(i.name, ls_column.get().columnname);}, withKeyValue: [{key: (i) => {return i.name}, value: ls_column.get().columnname}], usesTableLine: false, withKeySimple: {"name": ls_column.get().columnname}}); let unique1052 = abap.builtin.sy.get().subrc; if (abap.compare.eq(unique1052, abap.IntegerFactory.get(0))) { if (abap.compare.cn(fs_ls_column_to_display_.get().text, abap.CharacterFactory.get(3, ' _0'))) { await lo_column.get().set_short_text({value: new abap.types.String().set(`${abap.templateFormatting(fs_ls_column_to_display_.get().text)}`)}); await lo_column.get().set_medium_text({value: new abap.types.String().set(`${abap.templateFormatting(fs_ls_column_to_display_.get().text)}`)}); await lo_column.get().set_long_text({value: new abap.types.String().set(`${abap.templateFormatting(fs_ls_column_to_display_.get().text)}`)}); } if (abap.compare.gt(fs_ls_column_to_display_.get().length, abap.IntegerFactory.get(0))) { await lo_column.get().set_output_length({value: fs_ls_column_to_display_.get().length}); } if (abap.compare.eq(fs_ls_column_to_display_.get().show_icon, abap.builtin.abap_true)) { await lo_column.get().set_icon({value: abap.builtin.abap_true}); } if (abap.compare.eq(fs_ls_column_to_display_.get().center, abap.builtin.abap_true)) { await lo_column.get().set_alignment({svalue: abap.Classes['IF_SALV_C_ALIGNMENT'].centered}); } } else { await lo_column.get().set_technical({value: abap.builtin.abap_true}); } } } async #setup_toolbar(INPUT) { let iv_selection_mode = INPUT?.iv_selection_mode; if (iv_selection_mode === undefined) { iv_selection_mode = (() => { throw new Error("Void type: SALV_DE_CONSTANT") })().set(INPUT.iv_selection_mode); } let iv_object_list = INPUT?.iv_object_list; if (iv_object_list?.getQualifiedName === undefined || iv_object_list.getQualifiedName() !== "ABAP_BOOL") { iv_object_list = undefined; } if (iv_object_list === undefined) { iv_object_list = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}).set(INPUT.iv_object_list); } let lv_report = new abap.types.Character(40, {"qualifiedName":"sy-repid"}); let lv_pfstatus = new abap.types.Character(20, {"qualifiedName":"sy-pfkey"}); let lo_functions = new abap.types.ABAPObject({qualifiedName: "CL_SALV_FUNCTIONS_LIST", RTTIName: "\\CLASS=CL_SALV_FUNCTIONS_LIST"}); let lt_func_list = (() => { throw new Error("Void type: SALV_T_UI_FUNC") })(); let lv_fn = new abap.types.String({qualifiedName: "STRING"}); let ls_func = (() => { throw new Error("Void type: SALV_T_UI_FUNC") })(); try { if (abap.FunctionModules['RS_CUA_STATUS_CHECK'] === 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_CUA_STATUS_CHECK']({exporting: {program: abap.builtin.sy.get().cprog, objectname: lcl_object_decision_list.c_own_pfstatus}}); abap.builtin.sy.get().subrc.set(0); } catch (e) { if (e.classic) { switch (e.classic.toUpperCase()) { case "OBJECT_NOT_FOUND": abap.builtin.sy.get().subrc.set(1); break; default: abap.builtin.sy.get().subrc.set(2); break; } } else { throw e; } } if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await this.#mo_alv.get().set_screen_status({report: abap.builtin.sy.get().cprog, pfstatus: lcl_object_decision_list.c_own_pfstatus}); } else { lv_report.set(abap.CharacterFactory.get(8, 'SAPMSVIM')); if (abap.compare.eq(iv_selection_mode, abap.Classes['IF_SALV_C_SELECTION_MODE'].if_salv_c_selection_mode$single)) { lv_pfstatus.set(abap.CharacterFactory.get(3, '110')); } else { lv_pfstatus.set(abap.CharacterFactory.get(3, '102')); } await this.#mo_alv.get().set_screen_status({report: lv_report, pfstatus: lv_pfstatus}); } lo_functions.set((await this.#mo_alv.get().get_functions())); lt_func_list.set((await lo_functions.get().get_functions())); for await (const unique1053 of abap.statements.loop(lt_func_list)) { ls_func.set(unique1053); lv_fn.set((await ls_func.get().r_function.get().get_name())); if (abap.compare.eq(lv_fn, abap.CharacterFactory.get(2, 'OK')) || abap.compare.eq(lv_fn, abap.CharacterFactory.get(6, 'CANCEL')) || abap.compare.eq(lv_fn, abap.CharacterFactory.get(4, 'O.K.')) || abap.compare.eq(lv_fn, abap.CharacterFactory.get(4, 'EABR'))) { await ls_func.get().r_function.get().set_visible(abap.builtin.abap_true); } else if (abap.compare.eq(iv_object_list, abap.builtin.abap_true)) { await ls_func.get().r_function.get().set_visible(abap.builtin.abap_true); } else { await ls_func.get().r_function.get().set_visible(abap.builtin.abap_false); } } } } abap.Classes['CLAS-ZCL_ABAPGIT_POPUPS-LCL_OBJECT_DECISION_LIST'] = lcl_object_decision_list; lcl_object_decision_list.c_default_column = new abap.types.String({qualifiedName: "NAME"}); lcl_object_decision_list.c_default_column.set('DEFAULT_COLUMN'); lcl_object_decision_list.c_fieldname_selected = new abap.types.String({qualifiedName: "NAME"}); lcl_object_decision_list.c_fieldname_selected.set('SELECTED'); lcl_object_decision_list.c_answer_cancel = new abap.types.Character(1, {}); lcl_object_decision_list.c_answer_cancel.set('A'); lcl_object_decision_list.c_fieldname_obj_type = new abap.types.String({qualifiedName: "NAME"}); lcl_object_decision_list.c_fieldname_obj_type.set('OBJ_TYPE'); lcl_object_decision_list.c_own_pfstatus = new abap.types.Character(20, {"qualifiedName":"sy-pfkey"}); lcl_object_decision_list.c_own_pfstatus.set('DECIDE_DIALOG'); export {lcl_object_decision_list}; |