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 | 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 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 4x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 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 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 | CLASS zcl_abapgit_objects_super DEFINITION PUBLIC ABSTRACT CREATE PUBLIC. PUBLIC SECTION. CONSTANTS c_user_unknown TYPE syuname VALUE 'UNKNOWN'. METHODS constructor IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item !iv_language TYPE spras !io_files TYPE REF TO zcl_abapgit_objects_files OPTIONAL !io_i18n_params TYPE REF TO zcl_abapgit_i18n_params OPTIONAL. METHODS get_accessed_files RETURNING VALUE(rt_files) TYPE zif_abapgit_git_definitions=>ty_file_signatures_tt. PROTECTED SECTION. DATA: ms_item TYPE zif_abapgit_definitions=>ty_item, mv_language TYPE spras, mo_files TYPE REF TO zcl_abapgit_objects_files, mo_i18n_params TYPE REF TO zcl_abapgit_i18n_params. METHODS get_metadata RETURNING VALUE(rs_metadata) TYPE zif_abapgit_definitions=>ty_metadata . METHODS corr_insert IMPORTING !iv_package TYPE devclass !ig_object_class TYPE any OPTIONAL RAISING zcx_abapgit_exception . METHODS tadir_insert IMPORTING !iv_package TYPE devclass RAISING zcx_abapgit_exception . METHODS tadir_delete RAISING zcx_abapgit_exception . METHODS exists_a_lock_entry_for IMPORTING !iv_lock_object TYPE string !iv_argument TYPE csequence OPTIONAL !iv_prefix TYPE csequence OPTIONAL RETURNING VALUE(rv_exists_a_lock_entry) TYPE abap_bool RAISING zcx_abapgit_exception . METHODS set_default_package IMPORTING !iv_package TYPE devclass . METHODS set_default_transport IMPORTING !iv_transport TYPE trkorr. METHODS serialize_longtexts IMPORTING !ii_xml TYPE REF TO zif_abapgit_xml_output !iv_longtext_id TYPE dokil-id OPTIONAL !it_dokil TYPE zif_abapgit_definitions=>ty_dokil_tt OPTIONAL !iv_longtext_name TYPE string DEFAULT 'LONGTEXTS' RAISING zcx_abapgit_exception . METHODS deserialize_longtexts IMPORTING !ii_xml TYPE REF TO zif_abapgit_xml_input !iv_longtext_id TYPE dokil-id OPTIONAL !iv_longtext_name TYPE string DEFAULT 'LONGTEXTS' RAISING zcx_abapgit_exception . METHODS delete_longtexts IMPORTING !iv_longtext_id TYPE dokil-id RAISING zcx_abapgit_exception . METHODS is_active RETURNING VALUE(rv_active) TYPE abap_bool RAISING zcx_abapgit_exception . METHODS delete_ddic IMPORTING !iv_objtype TYPE string !iv_no_ask TYPE abap_bool DEFAULT abap_true !iv_no_ask_delete_append TYPE abap_bool DEFAULT abap_false RAISING zcx_abapgit_exception . METHODS set_abap_language_version CHANGING !cv_abap_language_version TYPE uccheck RAISING zcx_abapgit_exception . METHODS clear_abap_language_version CHANGING !cv_abap_language_version TYPE uccheck RAISING zcx_abapgit_exception . PRIVATE SECTION. ENDCLASS. CLASS zcl_abapgit_objects_super IMPLEMENTATION. METHOD clear_abap_language_version. " Used during serializing of objects IF ms_item-abap_language_version = zcl_abapgit_abap_language_vers=>c_no_abap_language_version. " Ignore ABAP language version CLEAR cv_abap_language_version. ELSEIF ms_item-abap_language_version <> zcl_abapgit_abap_language_vers=>c_any_abap_language_version. " Check if ABAP language version matches repository setting zcl_abapgit_abap_language_vers=>check_abap_language_version( iv_abap_language_version = cv_abap_language_version is_item = ms_item ). ENDIF. ENDMETHOD. METHOD constructor. ms_item = is_item. ASSERT NOT ms_item IS INITIAL. mv_language = iv_language. ASSERT NOT mv_language IS INITIAL. IF io_files IS NOT INITIAL. mo_files = io_files. ELSE. mo_files = zcl_abapgit_objects_files=>new( is_item ). " New file collection ENDIF. IF io_i18n_params IS NOT INITIAL. mo_i18n_params = io_i18n_params. ELSE. mo_i18n_params = zcl_abapgit_i18n_params=>new( ). " All defaults ENDIF. ENDMETHOD. METHOD corr_insert. DATA: lv_object TYPE trobj_name, lv_object_class TYPE tadir-object. IF ig_object_class IS NOT INITIAL. lv_object_class = ig_object_class. IF ig_object_class = 'DICT'. CONCATENATE ms_item-obj_type ms_item-obj_name INTO lv_object. ELSE. lv_object = ms_item-obj_name. ENDIF. ELSE. lv_object_class = ms_item-obj_type. lv_object = ms_item-obj_name. ENDIF. zcl_abapgit_factory=>get_cts_api( )->insert_transport_object( iv_object = lv_object_class iv_obj_name = lv_object iv_package = iv_package iv_language = mv_language ). ENDMETHOD. METHOD delete_ddic. DATA: lv_objname TYPE rsedd0-ddobjname, lv_objtype TYPE rsedd0-ddobjtype. lv_objname = ms_item-obj_name. lv_objtype = iv_objtype. TRY. CALL FUNCTION 'RS_DD_DELETE_OBJ' EXPORTING no_ask = iv_no_ask objname = lv_objname objtype = lv_objtype no_ask_delete_append = iv_no_ask_delete_append EXCEPTIONS not_executed = 1 object_not_found = 2 object_not_specified = 3 permission_failure = 4 dialog_needed = 5 OTHERS = 6. CATCH cx_sy_dyn_call_param_not_found. TRY. " try to force deletion for APPENDs CALL FUNCTION 'RS_DD_DELETE_OBJ' EXPORTING no_ask = iv_no_ask objname = lv_objname objtype = lv_objtype aie_force_deletion = iv_no_ask_delete_append EXCEPTIONS not_executed = 1 object_not_found = 2 object_not_specified = 3 permission_failure = 4 dialog_needed = 5 OTHERS = 6. CATCH cx_sy_dyn_call_param_not_found. " no_ask_delete_append and aie_force_deletion not available in lower releases CALL FUNCTION 'RS_DD_DELETE_OBJ' EXPORTING no_ask = iv_no_ask objname = lv_objname objtype = lv_objtype EXCEPTIONS not_executed = 1 object_not_found = 2 object_not_specified = 3 permission_failure = 4 dialog_needed = 5 OTHERS = 6. ENDTRY. ENDTRY. IF sy-subrc = 5. zcx_abapgit_exception=>raise( |Object { ms_item-obj_type } { ms_item-obj_name } has dependencies and must be deleted manually| ). ELSEIF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error deleting { ms_item-obj_type } { ms_item-obj_name }| ). ENDIF. ENDMETHOD. METHOD delete_longtexts. zcl_abapgit_factory=>get_longtexts( )->delete( iv_longtext_id = iv_longtext_id iv_object_name = ms_item-obj_name ). ENDMETHOD. METHOD deserialize_longtexts. zcl_abapgit_factory=>get_longtexts( )->deserialize( ii_xml = ii_xml iv_longtext_name = iv_longtext_name iv_object_name = ms_item-obj_name iv_longtext_id = iv_longtext_id iv_main_language = mv_language ). ENDMETHOD. METHOD exists_a_lock_entry_for. DATA: lt_lock_entries TYPE STANDARD TABLE OF seqg3. DATA: lv_argument TYPE seqg3-garg. IF iv_prefix IS INITIAL. lv_argument = iv_argument. ELSE. lv_argument = |{ iv_prefix }{ iv_argument }|. OVERLAY lv_argument WITH ' '. lv_argument = lv_argument && '*'. ENDIF. CALL FUNCTION 'ENQUEUE_READ' EXPORTING guname = '*' garg = lv_argument TABLES enq = lt_lock_entries EXCEPTIONS communication_failure = 1 system_failure = 2 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. READ TABLE lt_lock_entries TRANSPORTING NO FIELDS WITH KEY gobj = iv_lock_object. IF sy-subrc = 0. rv_exists_a_lock_entry = abap_true. ENDIF. ENDMETHOD. METHOD get_accessed_files. rt_files = mo_files->get_accessed_files( ). ENDMETHOD. METHOD get_metadata. DATA: lv_class TYPE string. lv_class = cl_abap_classdescr=>describe_by_object_ref( me )->get_relative_name( ). REPLACE FIRST OCCURRENCE OF 'ZCL_ABAPGIT' IN lv_class WITH 'LCL'. rs_metadata-class = lv_class. rs_metadata-version = 'v1.0.0'. ENDMETHOD. METHOD is_active. rv_active = zcl_abapgit_objects_activation=>is_active( ms_item ). ENDMETHOD. METHOD serialize_longtexts. zcl_abapgit_factory=>get_longtexts( )->serialize( iv_object_name = ms_item-obj_name iv_longtext_name = iv_longtext_name iv_longtext_id = iv_longtext_id it_dokil = it_dokil io_i18n_params = mo_i18n_params ii_xml = ii_xml ). ENDMETHOD. METHOD set_abap_language_version. " Used during deserializing of objects IF ms_item-abap_language_version = zcl_abapgit_abap_language_vers=>c_no_abap_language_version. " ABAP language version is derived from object type and target package (see zcl_abapgit_objects->deserialize) cv_abap_language_version = ms_item-abap_language_version. ELSEIF ms_item-abap_language_version <> zcl_abapgit_abap_language_vers=>c_any_abap_language_version. " Check if ABAP language version matches repository setting zcl_abapgit_abap_language_vers=>check_abap_language_version( iv_abap_language_version = cv_abap_language_version is_item = ms_item ). ENDIF. ENDMETHOD. METHOD set_default_package. " In certain cases we need to set the package via ABAP memory " because we can't supply it via the APIs. " " Set default package, see function module RS_CORR_INSERT FORM get_current_devclass. " " We use ABAP memory instead the SET parameter because it is " more reliable. SET parameter doesn't work when multiple objects " are deserialized which uses the ABAP memory mechanism. " We don't need to reset the memory as it is done in above mentioned form routine. EXPORT current_devclass FROM iv_package TO MEMORY ID 'EUK'. ENDMETHOD. METHOD set_default_transport. " In certain cases we need to set the transport via ABAP memory " because we can't supply it via the APIs. " " See function module RS_CORR_INSERT EXPORT tasknr FROM iv_transport TO MEMORY ID 'EUT'. ENDMETHOD. METHOD tadir_delete. CALL FUNCTION 'TR_TADIR_INTERFACE' EXPORTING wi_delete_tadir_entry = abap_true wi_tadir_pgmid = 'R3TR' wi_tadir_object = ms_item-obj_type wi_tadir_obj_name = ms_item-obj_name wi_test_modus = abap_false EXCEPTIONS tadir_entry_not_existing = 1 tadir_entry_ill_type = 2 no_systemname = 3 no_systemtype = 4 original_system_conflict = 5 object_reserved_for_devclass = 6 object_exists_global = 7 object_exists_local = 8 object_is_distributed = 9 obj_specification_not_unique = 10 no_authorization_to_delete = 11 devclass_not_existing = 12 simultanious_set_remove_repair = 13 order_missing = 14 no_modification_of_head_syst = 15 pgmid_object_not_allowed = 16 masterlanguage_not_specified = 17 devclass_not_specified = 18 specify_owner_unique = 19 loc_priv_objs_no_repair = 20 gtadir_not_reached = 21 object_locked_for_order = 22 change_of_class_not_allowed = 23 no_change_from_sap_to_tmp = 24 OTHERS = 25. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD tadir_insert. CALL FUNCTION 'TR_TADIR_INTERFACE' EXPORTING wi_test_modus = abap_false wi_tadir_pgmid = 'R3TR' wi_tadir_object = ms_item-obj_type wi_tadir_obj_name = ms_item-obj_name wi_tadir_author = sy-uname wi_tadir_devclass = iv_package wi_tadir_masterlang = mv_language iv_delflag = abap_false EXCEPTIONS tadir_entry_not_existing = 1 tadir_entry_ill_type = 2 no_systemname = 3 no_systemtype = 4 original_system_conflict = 5 object_reserved_for_devclass = 6 object_exists_global = 7 object_exists_local = 8 object_is_distributed = 9 obj_specification_not_unique = 10 no_authorization_to_delete = 11 devclass_not_existing = 12 simultanious_set_remove_repair = 13 order_missing = 14 no_modification_of_head_syst = 15 pgmid_object_not_allowed = 16 masterlanguage_not_specified = 17 devclass_not_specified = 18 specify_owner_unique = 19 loc_priv_objs_no_repair = 20 gtadir_not_reached = 21 object_locked_for_order = 22 change_of_class_not_allowed = 23 no_change_from_sap_to_tmp = 24 OTHERS = 25. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. ENDCLASS. |