diff --git a/.github/workflows/publishTrmRelease.yml b/.github/workflows/publishTrmRelease.yml new file mode 100644 index 0000000..9906397 --- /dev/null +++ b/.github/workflows/publishTrmRelease.yml @@ -0,0 +1,56 @@ +name: Publish TRM release +on: + release: + types: [published] +jobs: + createTrmRelease: + runs-on: [self-hosted, Windows, RegRunner] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Start new NUVE instance + id: nuveInstance + uses: simonegaffurini/nuveplatform-start-backup@main + with: + email: ${{ secrets.NUVE_EMAIL }} + password: ${{ secrets.NUVE_PASSWORD }} + backup: ${{ vars.NUVE_INSTANCE_BACKUP_NAME }} + instanceName: ${{ vars.NUVE_INSTANCE_NAME }} + instanceProject: trm-publish + - name: Pull from main branch + uses: fjogeleit/http-request-action@v1 + with: + url: ${{ steps.nuveInstance.outputs.webDomain }}/zrestabapgit/pull + method: 'POST' + username: ${{ secrets.A4H_USER }} + password: ${{ secrets.A4H_PASSWORD }} + data: '{ "repoUrl": "${{ github.repositoryUrl }}", "trkorr": "${{ vars.NUVE_PULL_TRKORR }}" }' + - name: TRM Publish + uses: RegestaItalia/trm-action-publish@2.1.4 + with: + systemDest: A4H + systemAsHost: ${{ steps.nuveInstance.outputs.externalIp }} + systemSysnr: '00' + systemClient: '001' + systemUser: ${{ secrets.A4H_USER }} + systemPassword: ${{ secrets.A4H_PASSWORD }} + systemLang: EN + devclass: ZTRM + target: TRM + registryAuth: ${{ secrets.TRM_REGISTRY_AUTH }} + packageName: trm-server + packageVersion: ${{ github.event.release.tag_name }} + description: ${{ vars.TRM_DESCRIPTION }} + private: false + git: ${{ github.repositoryUrl }} + website: https://www.trmregistry.com/ + license: MIT + authors: Simone Gaffurini + keywords: trm + readme: ./README.md + - name: Stop NUVE instance + uses: simonegaffurini/nuveplatform-stop-instance@main + with: + email: ${{ secrets.NUVE_EMAIL }} + password: ${{ secrets.NUVE_PASSWORD }} + instanceName: ${{ vars.NUVE_INSTANCE_NAME }} \ No newline at end of file diff --git a/README.md b/README.md index 30fc16c..a499a16 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # TRM [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-1.3.0-4baaaa.svg)](https://github.com/RegestaItalia/trm-docs/blob/main/CODE_OF_CONDUCT.md) -[![TRM License](https://img.shields.io/endpoint?url=https://trmregistry.com/public/shieldio/license?package=trm-server)](https://trmregistry/#/package/trm-server) -[![TRM Latest version](https://img.shields.io/endpoint?url=https://trmregistry.com/public/shieldio/version?package=trm-server)](https://trmregistry/#/package/trm-server) -[![TRM Installs](https://img.shields.io/endpoint?url=https://trmregistry.com/public/shieldio/downloads?package=trm-server)](https://trmregistry/#/package/trm-server) +[![TRM License](https://img.shields.io/endpoint?url=https://trmregistry.com/public/shieldio/license?package=trm-server)](https://trmregistry.com/#/package/trm-server) +[![TRM Latest version](https://img.shields.io/endpoint?url=https://trmregistry.com/public/shieldio/version?package=trm-server)](https://trmregistry.com/#/package/trm-server) +[![TRM Installs](https://img.shields.io/endpoint?url=https://trmregistry.com/public/shieldio/downloads?package=trm-server)](https://trmregistry.com/#/package/trm-server) TRM Server is the essential component for operations between TRM Client and your development SAP system. diff --git a/docs/setup.md b/docs/setup.md index d70ac47..3d85382 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -75,7 +75,11 @@ With trm-server already installed on your system, there are two ways to keep it 1. You may keep using [abapGit](https://abapgit.org/) - If it's an online repo, simply pull from the "main" branch - If it's an offline repo, download the "main" branch source code as "zip" from Github and import -3. You may use TRM Client and get from the Public Registry the latest release. +2. You may use TRM Client and get from the Public Registry the latest release. + + In this case, simply run the command: + + `trm update trm-server` Both methods will assure you the latest version installed on your system. diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap new file mode 100644 index 0000000..c85c60a --- /dev/null +++ b/src/zcl_trm_package.clas.abap @@ -0,0 +1,304 @@ +CLASS zcl_trm_package DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . + + PUBLIC SECTION. + + METHODS constructor + IMPORTING iv_devclass TYPE devclass. + + CLASS-METHODS create + IMPORTING is_data TYPE scompkdtln + RETURNING VALUE(ro_package) TYPE REF TO zcl_trm_package + RAISING zcx_trm_exception. + + METHODS get_objects + EXPORTING et_tadir TYPE scts_tadir + RAISING zcx_trm_exception. + + METHODS interface + IMPORTING iv_parentcl TYPE devclass OPTIONAL + iv_rm_parentcl TYPE flag OPTIONAL + iv_devlayer TYPE devlayer OPTIONAL + RAISING zcx_trm_exception. + + PROTECTED SECTION. + PRIVATE SECTION. + DATA: gv_devclass TYPE devclass. + + CLASS-METHODS modify_package_data + IMPORTING is_package_data_sign TYPE scompksign + iv_suppress_dialog TYPE flag + CHANGING cs_package_data TYPE scompkdtln + cv_transport_request TYPE e070-trkorr + RAISING zcx_trm_exception. +ENDCLASS. + + + +CLASS zcl_trm_package IMPLEMENTATION. + + METHOD constructor. + gv_devclass = iv_devclass. + ENDMETHOD. + + METHOD create. + DATA ls_data LIKE is_data. + DATA lo_package TYPE REF TO if_package. + MOVE is_data TO ls_data. + + IF ls_data-as4user IS INITIAL. + ls_data-as4user = sy-uname. + ENDIF. + IF ls_data-masterlang IS INITIAL. + ls_data-masterlang = sy-langu. + ENDIF. + + TRY. + CALL METHOD ('CL_PACKAGE_FACTORY')=>('IF_PACKAGE_FACTORY~CREATE_NEW_PACKAGE') + EXPORTING + i_reuse_deleted_object = 'X' + i_suppress_dialog = 'X' + IMPORTING + e_package = lo_package + CHANGING + c_package_data = ls_data + EXCEPTIONS + OTHERS = 1. + CATCH cx_sy_dyn_call_param_not_found. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-dyn_call_param_not_found ). + ENDTRY. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + lo_package->save( + EXPORTING + i_suppress_dialog = 'X' + i_suppress_corr_insert = 'X' + EXCEPTIONS + OTHERS = 1 + ). + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + lo_package->set_changeable( + EXPORTING + i_changeable = ' ' + i_suppress_dialog = 'X' + EXCEPTIONS + OTHERS = 1 + ). + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + IF ls_data-devclass(1) <> '$'. + DATA: lv_objname TYPE sobj_name, + lv_devclass TYPE devclass, + lv_author TYPE responsibl, + lv_masterlang TYPE masterlang. + lv_objname = ls_data-devclass. + lv_devclass = ls_data-devclass. + lv_author = ls_data-as4user. + lv_masterlang = ls_data-masterlang. + CALL FUNCTION 'TR_TADIR_INTERFACE' + EXPORTING + wi_test_modus = abap_false + wi_tadir_pgmid = 'R3TR' + wi_tadir_object = 'DEVC' + wi_tadir_obj_name = lv_objname + wi_tadir_devclass = lv_devclass + wi_tadir_author = lv_author + wi_tadir_masterlang = lv_masterlang + EXCEPTIONS + OTHERS = 0. + ENDIF. + + CREATE OBJECT ro_package EXPORTING iv_devclass = ls_data-devclass. + ENDMETHOD. + + METHOD get_objects. + CALL FUNCTION 'TRINT_SELECT_OBJECTS' + EXPORTING + iv_devclass = gv_devclass + iv_via_selscreen = ' ' + IMPORTING + et_objects_tadir = et_tadir + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD modify_package_data. + DATA: subrc LIKE sy-subrc. + DATA: lo_package TYPE REF TO if_package. + +* load package + CALL METHOD cl_package_factory=>load_package + EXPORTING + i_package_name = cs_package_data-devclass + i_force_reload = 'X' + IMPORTING + e_package = lo_package + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + +* lock package + CALL METHOD lo_package->set_changeable + EXPORTING + i_changeable = 'X' + i_suppress_dialog = 'D' + EXCEPTIONS + object_already_changeable = 0 "ignore it + OTHERS = 1. + + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + +* modify package + CALL METHOD lo_package->set_all_attributes + EXPORTING + i_package_data = cs_package_data + i_data_sign = is_package_data_sign + EXCEPTIONS + OTHERS = 1. +* + IF sy-subrc <> 0. +* try to unlock the package, exceptions are tolerated + subrc = sy-subrc. + + CALL METHOD lo_package->set_changeable + EXPORTING + i_changeable = ' ' + EXCEPTIONS + OTHERS = 0. + zcx_trm_exception=>raise( ). + ENDIF. + +* save package + CALL METHOD lo_package->save + EXPORTING + i_transport_request = cv_transport_request + i_suppress_dialog = iv_suppress_dialog + i_suppress_corr_insert = 'X' + IMPORTING + e_transport_request = cv_transport_request + EXCEPTIONS + OTHERS = 1. + + IF sy-subrc <> 0. +* try to undo the changes, exceptions are tolerated +* (Note: if successful, this also unlocks the package) + subrc = sy-subrc. + CALL METHOD lo_package->undo_all_changes + EXCEPTIONS + OTHERS = 0. + zcx_trm_exception=>raise( ). + ENDIF. + +* unlock package + CALL METHOD lo_package->set_changeable + EXPORTING + i_changeable = ' ' + i_suppress_dialog = 'D' + EXCEPTIONS + object_already_unlocked = 0 "ignore + OTHERS = 1. + + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD interface. + DATA: ls_modify_sign TYPE scompksign, + ls_pack_data TYPE scompkdtln, + ls_cr TYPE e070-trkorr. + IF iv_rm_parentcl EQ 'X'. + "SAP Note 636704 + ls_modify_sign-parentcl = 'X'. + ls_pack_data-devclass = gv_devclass. + modify_package_data( + EXPORTING + is_package_data_sign = ls_modify_sign + iv_suppress_dialog = 'X' + CHANGING + cs_package_data = ls_pack_data + cv_transport_request = ls_cr + ). + CLEAR ls_modify_sign. + CLEAR ls_pack_data. + CLEAR ls_cr. + ELSEIF iv_parentcl IS NOT INITIAL. + DATA lo_package TYPE REF TO if_package. + cl_package_factory=>load_package( + EXPORTING + i_package_name = gv_devclass + IMPORTING + e_package = lo_package + EXCEPTIONS + OTHERS = 1 ). + lo_package->set_changeable( + EXPORTING + i_changeable = 'X' + i_suppress_dialog = 'D' + EXCEPTIONS + OTHERS = 1 ). + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + lo_package->set_super_package_name( + EXPORTING + i_super_package_name = iv_parentcl + EXCEPTIONS + OTHERS = 1 ). + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + lo_package->save( + EXPORTING + i_suppress_dialog = 'X' + i_suppress_corr_insert = 'X' + EXCEPTIONS + OTHERS = 1 ). + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + lo_package->set_changeable( + EXPORTING + i_changeable = 'X' + i_suppress_dialog = 'D' + EXCEPTIONS + OTHERS = 1 ). + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDIF. + IF iv_devlayer IS NOT INITIAL. + ls_modify_sign-pdevclass = 'X'. + ls_pack_data-devclass = gv_devclass. + ls_pack_data-pdevclass = iv_devlayer. + modify_package_data( + EXPORTING + is_package_data_sign = ls_modify_sign + iv_suppress_dialog = 'X' + CHANGING + cs_package_data = ls_pack_data + cv_transport_request = ls_cr + ). + CLEAR ls_modify_sign. + CLEAR ls_pack_data. + CLEAR ls_cr. + ENDIF. + ENDMETHOD. + +ENDCLASS. diff --git a/src/zcl_trm_package.clas.xml b/src/zcl_trm_package.clas.xml new file mode 100644 index 0000000..870e4de --- /dev/null +++ b/src/zcl_trm_package.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_TRM_PACKAGE + E + TRM Package + 1 + X + X + X + + + + diff --git a/src/zcl_trm_transport.clas.abap b/src/zcl_trm_transport.clas.abap new file mode 100644 index 0000000..1f35b16 --- /dev/null +++ b/src/zcl_trm_transport.clas.abap @@ -0,0 +1,538 @@ +CLASS zcl_trm_transport DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . + + PUBLIC SECTION. + TYPES: tyt_lxe_packg TYPE STANDARD TABLE OF lxe_tt_packg_line WITH DEFAULT KEY, + tyt_e071 TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY, + tyt_tline TYPE STANDARD TABLE OF tline WITH DEFAULT KEY. + + METHODS constructor + IMPORTING iv_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS create_workbench + IMPORTING iv_text TYPE as4text + iv_target TYPE tr_target + RETURNING VALUE(ro_transport) TYPE REF TO zcl_trm_transport + RAISING zcx_trm_exception. + + CLASS-METHODS create_transport_of_copies + IMPORTING iv_text TYPE as4text + iv_target TYPE tr_target + RETURNING VALUE(ro_transport) TYPE REF TO zcl_trm_transport + RAISING zcx_trm_exception. + + CLASS-METHODS find_object_lock + IMPORTING iv_pgmid TYPE pgmid + iv_object TYPE trobjtype + iv_obj_name TYPE trobj_name + RETURNING VALUE(ro_transport) TYPE REF TO zcl_trm_transport + RAISING zcx_trm_exception. + + CLASS-METHODS read_queue + IMPORTING iv_target TYPE tmssysnam + EXPORTING et_requests TYPE tmsiqreqs + RAISING zcx_trm_exception. + + METHODS get_trkorr + RETURNING VALUE(rv_trkorr) TYPE trkorr. + + METHODS add_translations + IMPORTING it_devclass TYPE tyt_lxe_packg + RAISING zcx_trm_exception. + + METHODS add_objects + IMPORTING iv_lock TYPE flag + it_e071 TYPE tyt_e071 + EXPORTING et_log TYPE sprot_u_tab + RAISING zcx_trm_exception. + + METHODS delete + RAISING zcx_trm_exception. + + METHODS enqueue + RAISING zcx_trm_exception. + + METHODS dequeue + RAISING zcx_trm_exception. + + METHODS forward + IMPORTING iv_target TYPE tmssysnam + iv_source TYPE tmssysnam + iv_import_again TYPE flag + RAISING zcx_trm_exception. + + METHODS import + IMPORTING iv_system TYPE tmssysnam + RAISING zcx_trm_exception. + + METHODS release + IMPORTING iv_lock TYPE flag + EXPORTING et_messages TYPE ctsgerrmsgs + RAISING zcx_trm_exception. + + METHODS rename + IMPORTING iv_as4text TYPE as4text + RAISING zcx_trm_exception. + + METHODS set_documentation + IMPORTING it_doc TYPE tyt_tline + RAISING zcx_trm_exception. + + METHODS copy + IMPORTING iv_trkorr TYPE trkorr + iv_doc TYPE trparflag + RAISING zcx_trm_exception. + + PROTECTED SECTION. + PRIVATE SECTION. + CLASS-METHODS create + IMPORTING iv_text TYPE as4text + iv_target TYPE tr_target + iv_type TYPE trfunction + RETURNING VALUE(ro_transport) TYPE REF TO zcl_trm_transport + RAISING zcx_trm_exception. + + DATA: gv_trkorr TYPE trkorr. +ENDCLASS. + + + +CLASS zcl_trm_transport IMPLEMENTATION. + + METHOD constructor. + gv_trkorr = iv_trkorr. + ENDMETHOD. + + METHOD get_trkorr. + rv_trkorr = gv_trkorr. + ENDMETHOD. + + METHOD add_translations. + DATA: lt_langs TYPE TABLE OF lxeisolang, + wa_langs LIKE LINE OF lt_langs, + lo_explang TYPE REF TO cl_lxe_log_export, + lt_date TYPE lxe_tt_date, + lv_ret_cnt TYPE i, + lt_objct TYPE lxe_tt_objct, + lt_user TYPE lxe_tt_user, + lt_comp TYPE lxe_tt_comp. + + IF it_devclass[] IS INITIAL. + zcx_trm_exception=>raise( iv_message = 'No input packages defined' + iv_reason = zcx_trm_exception=>c_reason-invalid_input ). + ENDIF. + + SELECT DISTINCT targlng FROM lxe_log INTO TABLE lt_langs WHERE custmnr EQ cl_lxe_constants=>c_trl_area_local. + + LOOP AT lt_langs INTO wa_langs. + CALL FUNCTION 'LXE_T002_CHECK_LANGUAGE' + EXPORTING + language = wa_langs + EXCEPTIONS + language_not_in_cp = 1 + unknown = 2 + OTHERS = 3. + + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + CLEAR lo_explang. + + CREATE OBJECT lo_explang TYPE cl_lxe_log_export_local + EXPORTING + custmnr = cl_lxe_constants=>c_trl_area_local + isolang = wa_langs. + + DATA ls_date LIKE LINE OF lt_date. + ls_date-sign = 'I'. + ls_date-option = 'LE'. + ls_date-low = sy-datum. + APPEND ls_date TO lt_date. + + CLEAR lv_ret_cnt. + lv_ret_cnt = lo_explang->log_select( st_objct = lt_objct[] + st_user = lt_user[] + st_date = lt_date[] ). + CHECK lv_ret_cnt NE 0. + + CLEAR lv_ret_cnt. + lv_ret_cnt = lo_explang->apply_filters( st_packg = it_devclass[] + st_comp = lt_comp[] + piecelist = ' ' + check_ex = 'X' + chckorlg = ' ' + clientdp = ' ' ). + + CHECK lv_ret_cnt NE 0. + + CALL METHOD lo_explang->export_objects + EXPORTING + tr_auto = '' + tr_request = gv_trkorr + force = '' + forcekey = '' + object_transport = '' + tr_system = '' + tr_project = '' + tr_mixed = 'X' + t_transport = '' + tr_text = '' + tr_release = '' + rfc_destination = '' + EXCEPTIONS + create_request_failed = 1 + write_to_request_failed = 2 + release_request_failed = 3 + invalid_request = 4 + no_correct_objects_available = 5 + OTHERS = 6. + + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDLOOP. + ENDMETHOD. + + METHOD add_objects. + DATA lt_e071 LIKE it_e071. + MOVE it_e071[] TO lt_e071[]. + CALL FUNCTION 'TRINT_REQUEST_CHOICE' + EXPORTING + iv_suppress_dialog = 'X' + iv_request_types = 'FTCOK' + iv_lock_objects = iv_lock + iv_with_error_log = 'X' + iv_request = gv_trkorr + IMPORTING + et_log = et_log + TABLES + it_e071 = lt_e071 + EXCEPTIONS + invalid_request = 1 + invalid_request_type = 2 + user_not_owner = 3 + no_objects_appended = 4 + enqueue_error = 5 + cancelled_by_user = 6 + recursive_call = 7. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD create_workbench. + create( + EXPORTING + iv_text = iv_text + iv_target = iv_target + iv_type = 'K' + RECEIVING + ro_transport = ro_transport + ). + ENDMETHOD. + + METHOD create_transport_of_copies. + create( + EXPORTING + iv_text = iv_text + iv_target = iv_target + iv_type = 'T' + RECEIVING + ro_transport = ro_transport + ). + ENDMETHOD. + + METHOD create. + DATA ls_header TYPE trwbo_request_header. + CALL FUNCTION 'TR_INSERT_REQUEST_WITH_TASKS' + EXPORTING + iv_text = iv_text + iv_type = iv_type + iv_target = iv_target + IMPORTING + es_request_header = ls_header + EXCEPTIONS + insert_failed = 1 + enqueue_failed = 2. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + CREATE OBJECT ro_transport EXPORTING iv_trkorr = ls_header-trkorr. + ENDMETHOD. + + METHOD delete. + CALL FUNCTION 'TR_DELETE_COMM' + EXPORTING + wi_dialog = ' ' + wi_trkorr = gv_trkorr + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD enqueue. + CALL FUNCTION 'ENQUEUE_E_TRKORR' + EXPORTING + trkorr = gv_trkorr + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-enqueue_error ). + ENDIF. + ENDMETHOD. + + METHOD dequeue. + CALL FUNCTION 'DEQUEUE_E_TRKORR' + EXPORTING + trkorr = gv_trkorr + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-dequeue_error ). + ENDIF. + ENDMETHOD. + + METHOD forward. + DATA: lt_stdout TYPE STANDARD TABLE OF tpstdout, + ls_stdout LIKE LINE OF lt_stdout, + lt_log TYPE zcx_trm_exception=>tyt_log, + ls_exception TYPE stmscalert. + CALL FUNCTION 'TMS_MGR_FORWARD_TR_REQUEST' + EXPORTING + iv_request = gv_trkorr + iv_target = iv_target + iv_source = iv_source + iv_import_again = iv_import_again + iv_monitor = space + IMPORTING + es_exception = ls_exception + TABLES + tt_stdout = lt_stdout + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ELSEIF ls_exception-msgty EQ 'E' OR ls_exception-msgty EQ 'A'. + LOOP AT lt_stdout INTO ls_stdout. + APPEND ls_stdout-line TO lt_log. + ENDLOOP. + syst-msgid = ls_exception-msgid. + syst-msgno = ls_exception-msgno. + syst-msgty = ls_exception-msgty. + syst-msgv1 = ls_exception-msgv1. + syst-msgv2 = ls_exception-msgv2. + syst-msgv3 = ls_exception-msgv3. + syst-msgv4 = ls_exception-msgv4. + zcx_trm_exception=>raise( it_log = lt_log ). + ENDIF. + ENDMETHOD. + + METHOD find_object_lock. + DATA: ls_e070 TYPE e070, + lv_trkorr TYPE trkorr. + SELECT SINGLE e070~trkorr e070~strkorr + FROM e071 + INNER JOIN e070 ON e070~trkorr = e071~trkorr + INTO CORRESPONDING FIELDS OF ls_e070 + WHERE e071~pgmid EQ iv_pgmid AND e071~object EQ iv_object AND e071~obj_name EQ iv_obj_name + AND ( e070~trfunction EQ 'K' OR e070~trfunction EQ 'S' OR e070~trfunction EQ 'R' ) + AND e070~trstatus EQ 'D'. + + IF ls_e070-strkorr IS NOT INITIAL. + lv_trkorr = ls_e070-strkorr. + ELSE. + lv_trkorr = ls_e070-trkorr. + ENDIF. + + IF lv_trkorr IS NOT INITIAL. + CREATE OBJECT ro_transport EXPORTING iv_trkorr = lv_trkorr. + ENDIF. + ENDMETHOD. + + METHOD import. + CALL FUNCTION 'TMS_MGR_IMPORT_TR_REQUEST' + EXPORTING + iv_system = iv_system + iv_request = gv_trkorr + iv_ctc_active = ' ' + iv_overtake = 'X' + iv_import_again = 'X' + iv_ignore_originality = 'X' + iv_ignore_repairs = 'X' + iv_ignore_transtype = 'X' + iv_ignore_tabletype = 'X' + iv_ignore_predec = 'X' + iv_ignore_cvers = 'X' + iv_test_import = ' ' + iv_subset = 'X' + iv_offline = 'X' + iv_monitor = 'X' + iv_verbose = ' ' + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD read_queue. + DATA: ls_bufcnt TYPE tmsbufcnt, + ls_alog TYPE tmsalog, + lv_dummy TYPE string. + " 03072024 avoid display alert + sy-batch = 'X'. + + CALL FUNCTION 'TMS_UIQ_IQD_READ_QUEUE' + EXPORTING + iv_system = iv_target + iv_collect = 'X' + iv_read_shadow = 'X' + IMPORTING + et_requests = et_requests + es_bufcnt = ls_bufcnt + EXCEPTIONS + OTHERS = 1. + + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + IF ls_bufcnt-alertid IS NOT INITIAL. + CALL FUNCTION 'TMS_ALT_ANALYSE_ALERT' + EXPORTING + iv_alert_id = ls_bufcnt-alertid + iv_no_display = 'X' + IMPORTING + es_alog = ls_alog + EXCEPTIONS + OTHERS = 1. + IF ls_alog-msgty EQ 'E' OR ls_alog-msgty EQ 'A' OR sy-subrc <> 0. + MESSAGE ID ls_alog-msgid + TYPE ls_alog-msgty + NUMBER ls_alog-msgno + INTO lv_dummy + WITH ls_alog-msgv1 ls_alog-msgv2 ls_alog-msgv3 ls_alog-msgv4. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-tms_alert ). + ENDIF. + ENDIF. + ENDMETHOD. + + METHOD release. + DATA lv_without_lock TYPE flag. + IF iv_lock EQ 'X'. + lv_without_lock = ' '. + ELSE. + lv_without_lock = 'X'. + ENDIF. + + CALL FUNCTION 'TRINT_RELEASE_REQUEST' + EXPORTING + iv_trkorr = gv_trkorr + iv_dialog = ' ' + iv_success_message = ' ' + iv_display_export_log = ' ' + iv_without_objects_check = 'X' + iv_without_locking = lv_without_lock + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD rename. + enqueue( ). + "LSTR6F02 - e070_update + DATA: ls_e070 TYPE e070, + ls_e070c TYPE e070c, + ls_e07t TYPE e07t. + DATA: lv_msgtext1 LIKE sy-msgv3, + lv_msgtext2 LIKE sy-msgv3, + lv_msgtext3 LIKE sy-msgv3. + + SELECT SINGLE * INTO ls_e070 + FROM e070 + WHERE trkorr = gv_trkorr. + SELECT SINGLE * INTO ls_e070c "read additional fields - note 2231381 + FROM e070c + WHERE trkorr = gv_trkorr. + + ls_e07t-trkorr = gv_trkorr. + ls_e07t-langu = sy-langu. + ls_e07t-as4text = iv_as4text. + + CALL FUNCTION 'TRINT_UPDATE_COMM_HEADER' + EXPORTING + wi_e070 = ls_e070 + wi_e07t = ls_e07t + wi_save_user = ' ' + wi_sel_e070 = 'X' + wi_sel_e07t = 'X' + wi_user = sy-uname + wi_e070c = ls_e070c + wi_sel_e070c = 'X' + IMPORTING + we_e070 = ls_e070 + we_e070c = ls_e070c + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + dequeue( ). + + lv_msgtext1 = ls_e070-trkorr. + lv_msgtext2 = sy-uname. + lv_msgtext3 = ' '. + + CALL FUNCTION 'TRINT_APPEND_COMM_SYSLOG_ENTRY' + EXPORTING + wi_msgid = 'TR' + wi_msgno = '018' + wi_msgv2 = lv_msgtext1 + wi_msgv3 = lv_msgtext2 + wi_msgv4 = lv_msgtext3 + wi_new_order = ' ' + wi_trfunction = ls_e070-trfunction + wi_trkorr = ls_e070-trkorr. + ENDMETHOD. + + METHOD set_documentation. + DATA lt_doc LIKE it_doc. + MOVE it_doc[] TO lt_doc[]. + CALL FUNCTION 'TRINT_DOCU_INTERFACE' + EXPORTING + iv_object = gv_trkorr + iv_action = 'M' + iv_modify_appending = '' + TABLES + tt_line = lt_doc + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD copy. + CALL FUNCTION 'TR_COPY_COMM' + EXPORTING + wi_dialog = ' ' + wi_trkorr_from = iv_trkorr + wi_trkorr_to = gv_trkorr + wi_without_documentation = iv_doc + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + +ENDCLASS. diff --git a/src/zcl_trm_transport.clas.xml b/src/zcl_trm_transport.clas.xml new file mode 100644 index 0000000..f7d7a1d --- /dev/null +++ b/src/zcl_trm_transport.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_TRM_TRANSPORT + E + TRM Transport + 1 + X + X + X + + + + diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap new file mode 100644 index 0000000..1c3581c --- /dev/null +++ b/src/zcl_trm_utility.clas.abap @@ -0,0 +1,304 @@ +CLASS zcl_trm_utility DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . + + PUBLIC SECTION. + + TYPES: tyt_ko100 TYPE STANDARD TABLE OF ko100 WITH DEFAULT KEY, + tyt_installdevc TYPE STANDARD TABLE OF ztrm_installdevc WITH DEFAULT KEY, + tyt_trnspacett TYPE STANDARD TABLE OF trnspacett WITH DEFAULT KEY. + + CLASS-METHODS check_functions_authorization + RETURNING VALUE(rv_authorized) TYPE flag. + + CLASS-METHODS add_skip_trkorr + IMPORTING iv_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS add_source_trkorr + IMPORTING iv_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS get_binary_file + IMPORTING iv_file_path TYPE string + EXPORTING ev_file TYPE xstring + RAISING zcx_trm_exception. + + CLASS-METHODS write_binary_file + IMPORTING iv_file_path TYPE string + iv_file TYPE xstring + RAISING zcx_trm_exception. + + CLASS-METHODS get_dir_trans + EXPORTING ev_dir_trans TYPE pfevalue + RAISING zcx_trm_exception. + + CLASS-METHODS get_file_sys + EXPORTING ev_file_sys TYPE filesys + RAISING zcx_trm_exception. + + CLASS-METHODS get_default_transport_layer + EXPORTING ev_layer TYPE devlayer + RAISING zcx_trm_exception. + + CLASS-METHODS get_supported_object_types + EXPORTING et_object_text TYPE tyt_ko100 + RAISING zcx_trm_exception. + + CLASS-METHODS add_install_devclass + IMPORTING it_installdevc TYPE tyt_installdevc + RAISING zcx_trm_exception. + + CLASS-METHODS add_package_integrity + IMPORTING is_integrity TYPE ztrm_integrity + RAISING zcx_trm_exception. + + CLASS-METHODS tadir_interface + IMPORTING iv_pgmid TYPE pgmid + iv_object TYPE trobjtype + iv_objname TYPE sobj_name + iv_devclass TYPE devclass OPTIONAL + iv_srcsystem TYPE srcsystem OPTIONAL + iv_author TYPE responsibl OPTIONAL + iv_genflag TYPE genflag OPTIONAL + RAISING zcx_trm_exception. + + CLASS-METHODS add_namespace + IMPORTING iv_namespace TYPE namespace + iv_replicense TYPE trnlicense + it_texts TYPE tyt_trnspacett + RAISING zcx_trm_exception. + + CLASS-METHODS get_r3trans_info + RETURNING VALUE(rv_r3trans) TYPE string + RAISING zcx_trm_exception. + + PROTECTED SECTION. + PRIVATE SECTION. + CLASS-METHODS enqueue + IMPORTING iv_mode_rstable TYPE enqmode DEFAULT 'E' + iv_tabname TYPE tabname + RAISING zcx_trm_exception. + CLASS-METHODS dequeue + IMPORTING iv_mode_rstable TYPE enqmode DEFAULT 'E' + iv_tabname TYPE tabname + RAISING zcx_trm_exception. +ENDCLASS. + + + +CLASS zcl_trm_utility IMPLEMENTATION. + + METHOD add_skip_trkorr. + DATA ls_dummy TYPE ztrm_skip_trkorr. + ls_dummy-trkorr = iv_trkorr. + enqueue( iv_tabname = 'ZTRM_SKIP_TRKORR' ). + INSERT ztrm_skip_trkorr FROM ls_dummy. + COMMIT WORK AND WAIT. + dequeue( iv_tabname = 'ZTRM_SKIP_TRKORR' ). + ENDMETHOD. + + METHOD add_source_trkorr. + DATA ls_dummy TYPE ztrm_src_trkorr. + ls_dummy-trkorr = iv_trkorr. + enqueue( iv_tabname = 'ZTRM_SRC_TRKORR' ). + INSERT ztrm_src_trkorr FROM ls_dummy. + COMMIT WORK AND WAIT. + dequeue( iv_tabname = 'ZTRM_SRC_TRKORR' ). + ENDMETHOD. + + METHOD check_functions_authorization. + CLEAR rv_authorized. + SELECT COUNT( * ) FROM ztrm_users WHERE uname = sy-uname. + IF sy-dbcnt EQ 1. + rv_authorized = 'X'. + ENDIF. + ENDMETHOD. + + METHOD enqueue. + CALL FUNCTION 'ENQUEUE_E_TABLE' + EXPORTING + mode_rstable = iv_mode_rstable + tabname = iv_tabname + EXCEPTIONS + foreign_lock = 1 + system_failure = 2 + OTHERS = 3. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-enqueue_error ). + ENDIF. + ENDMETHOD. + + METHOD dequeue. + CALL FUNCTION 'DEQUEUE_E_TABLE' + EXPORTING + mode_rstable = iv_mode_rstable + tabname = iv_tabname + EXCEPTIONS + foreign_lock = 1 + system_failure = 2 + OTHERS = 3. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-dequeue_error ). + ENDIF. + ENDMETHOD. + + METHOD get_binary_file. + OPEN DATASET iv_file_path FOR INPUT IN BINARY MODE. + READ DATASET iv_file_path INTO ev_file. + CLOSE DATASET iv_file_path. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD write_binary_file. + OPEN DATASET iv_file_path FOR OUTPUT IN BINARY MODE. + TRANSFER iv_file TO iv_file_path. + CLOSE DATASET iv_file_path. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD get_dir_trans. + DATA lv_param_name TYPE pfeparname. + lv_param_name = 'DIR_TRANS'. + CALL FUNCTION 'SXPG_PROFILE_PARAMETER_GET' + EXPORTING + parameter_name = lv_param_name + IMPORTING + parameter_value = ev_dir_trans + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD get_file_sys. + SELECT SINGLE filesys INTO ev_file_sys FROM opsystem WHERE opsys = sy-opsys. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( iv_message = 'File system not found' + iv_reason = zcx_trm_exception=>c_reason-not_found ). + ENDIF. + ENDMETHOD. + + METHOD get_default_transport_layer. + CALL FUNCTION 'TR_GET_TRANSPORT_TARGET' + EXPORTING + iv_use_default = 'X' + iv_get_layer_only = 'X' + IMPORTING + ev_layer = ev_layer + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD get_supported_object_types. + CALL FUNCTION 'TR_OBJECT_TABLE' + TABLES + wt_object_text = et_object_text + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD add_install_devclass. + DATA ls_installdevc LIKE LINE OF it_installdevc. + enqueue( iv_tabname = 'ZTRM_INSTALLDEVC' ). + LOOP AT it_installdevc INTO ls_installdevc. + MODIFY ztrm_installdevc FROM ls_installdevc. + ENDLOOP. + COMMIT WORK AND WAIT. + dequeue( iv_tabname = 'ZTRM_INSTALLDEVC' ). + ENDMETHOD. + + METHOD add_package_integrity. + enqueue( iv_tabname = 'ZTRM_INTEGRITY' ). + MODIFY ztrm_integrity FROM is_integrity. + COMMIT WORK AND WAIT. + dequeue( iv_tabname = 'ZTRM_INTEGRITY' ). + ENDMETHOD. + + METHOD tadir_interface. + CALL FUNCTION 'TR_TADIR_INTERFACE' + EXPORTING + wi_test_modus = ' ' + wi_tadir_pgmid = iv_pgmid + wi_tadir_object = iv_object + wi_tadir_obj_name = iv_objname + wi_tadir_devclass = iv_devclass + wi_tadir_srcsystem = iv_srcsystem + wi_tadir_author = iv_author + wi_set_genflag = iv_genflag +* iv_no_pak_check = 'X' + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD add_namespace. + DATA: ls_trnspacet TYPE trnspacet, + ls_trnspacett TYPE trnspacett. + + ls_trnspacet-namespace = iv_namespace. + ls_trnspacet-role = 'C'. + ls_trnspacet-changeuser = sy-uname. + ls_trnspacet-changedate = sy-datum. + ls_trnspacet-replicense = iv_replicense. + INSERT trnspacet FROM ls_trnspacet. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-insert_error ). + ENDIF. + + LOOP AT it_texts INTO ls_trnspacett. + CHECK ls_trnspacett-spras IS NOT INITIAL. + ls_trnspacett-namespace = iv_namespace. + INSERT trnspacett FROM ls_trnspacett. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-insert_error ). + ENDIF. + ENDLOOP. + + CALL FUNCTION 'TR_ACTIVATE_NAMESPACE' + EXPORTING + iv_namespace = iv_namespace + EXCEPTIONS + deletion_not_allowed = 1 + OTHERS = 2. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + UPDATE trnspace SET editflag = 'X' WHERE namespace = iv_namespace. + + COMMIT WORK AND WAIT. + ENDMETHOD. + + METHOD get_r3trans_info. + TYPES: ty_cmd TYPE c LENGTH 254, + BEGIN OF ty_result, + line(255), + END OF ty_result. + DATA: cmd TYPE ty_cmd, + result TYPE STANDARD TABLE OF ty_result. + cmd = 'R3trans'. + CALL 'SYSTEM' ID 'COMMAND' FIELD cmd + ID 'TAB' FIELD result. + IF sy-subrc <> 12. "Fatal errors have occurred, R3trans sets to 12 when running without options + zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-r3trans_cmd_error ). + ENDIF. + + CONCATENATE LINES OF result INTO rv_r3trans SEPARATED BY cl_abap_char_utilities=>newline. + ENDMETHOD. + +ENDCLASS. diff --git a/src/zcl_trm_utility.clas.xml b/src/zcl_trm_utility.clas.xml new file mode 100644 index 0000000..cbe19c6 --- /dev/null +++ b/src/zcl_trm_utility.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_TRM_UTILITY + E + TRM Utilities + 1 + X + X + X + + + + diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap new file mode 100644 index 0000000..b1ec1d6 --- /dev/null +++ b/src/zcx_trm_exception.clas.abap @@ -0,0 +1,82 @@ +CLASS zcx_trm_exception DEFINITION + PUBLIC + INHERITING FROM cx_static_check + CREATE PROTECTED . + + PUBLIC SECTION. + TYPES: tyt_log TYPE STANDARD TABLE OF tdline WITH DEFAULT KEY. + + CONSTANTS: + BEGIN OF c_reason, + generic TYPE string VALUE 'GENERIC', + invalid_input TYPE string VALUE 'INVALID_INPUT', + enqueue_error TYPE string VALUE 'ENQUEUE_ERROR', + dequeue_error TYPE string VALUE 'DEQUEUE_ERROR', + dyn_call_param_not_found TYPE string VALUE 'DYN_CALL_PARAM_NOT_FOUND', + not_found TYPE string VALUE 'NOT_FOUND', + tms_alert TYPE string VALUE 'TMS_ALERT', + insert_error TYPE string VALUE 'INSERT_ERROR', + r3trans_cmd_error TYPE string VALUE 'R3TRANS_CMD_ERROR', + END OF c_reason . + + METHODS constructor + IMPORTING + !textid LIKE textid OPTIONAL + !previous LIKE previous OPTIONAL. + + METHODS reason + RETURNING VALUE(rv_reason) TYPE string. + + METHODS log + RETURNING VALUE(rt_log) TYPE tyt_log. + + CLASS-METHODS raise + IMPORTING iv_message TYPE string OPTIONAL + iv_reason TYPE string OPTIONAL + it_log TYPE tyt_log OPTIONAL + RAISING zcx_trm_exception. + + DATA: message TYPE symsg READ-ONLY. + PROTECTED SECTION. + DATA: gv_reason TYPE string, + gt_log TYPE tyt_log. + PRIVATE SECTION. + +ENDCLASS. + + + +CLASS zcx_trm_exception IMPLEMENTATION. + + METHOD constructor ##ADT_SUPPRESS_GENERATION. + CALL METHOD super->constructor + EXPORTING + textid = textid + previous = previous. + MOVE-CORRESPONDING sy TO me->message. + ENDMETHOD. + + METHOD reason. + IF gv_reason IS INITIAL. + rv_reason = c_reason-generic. + ELSE. + rv_reason = gv_reason. + ENDIF. + ENDMETHOD. + + METHOD log. + rt_log = gt_log. + ENDMETHOD. + + METHOD raise. + DATA lo_exc TYPE REF TO zcx_trm_exception. + IF iv_message IS SUPPLIED. + cl_message_helper=>set_msg_vars_for_clike( iv_message ). + ENDIF. + CREATE OBJECT lo_exc. + lo_exc->gv_reason = iv_reason. + lo_exc->gt_log = it_log. + RAISE EXCEPTION lo_exc. + ENDMETHOD. + +ENDCLASS. diff --git a/src/zcx_trm_exception.clas.xml b/src/zcx_trm_exception.clas.xml new file mode 100644 index 0000000..c53f612 --- /dev/null +++ b/src/zcx_trm_exception.clas.xml @@ -0,0 +1,24 @@ + + + + + + ZCX_TRM_EXCEPTION + E + TRM Exception + 40 + 1 + X + X + X + + + + CONSTRUCTOR + E + CONSTRUCTOR + + + + + diff --git a/src/zif_trm.intf.abap b/src/zif_trm.intf.abap index 4a6c141..62e4ca2 100644 --- a/src/zif_trm.intf.abap +++ b/src/zif_trm.intf.abap @@ -1,6 +1,6 @@ INTERFACE zif_trm PUBLIC . - CONSTANTS version TYPE string VALUE '1.3.1' ##NO_TEXT. + CONSTANTS version TYPE string VALUE '2.0.0' ##NO_TEXT. ENDINTERFACE. diff --git a/src/ztrm.fugr.lztrmf00.abap b/src/ztrm.fugr.lztrmf00.abap deleted file mode 100644 index 722fe1a..0000000 --- a/src/ztrm.fugr.lztrmf00.abap +++ /dev/null @@ -1,6 +0,0 @@ -*---------------------------------------------------------------------* -* view related FORM routines -*---------------------------------------------------------------------* - -* base table related FORM-routines............. -INCLUDE LSVIMFTX . diff --git a/src/ztrm.fugr.lztrmf00.xml b/src/ztrm.fugr.lztrmf00.xml deleted file mode 100644 index 0515121..0000000 --- a/src/ztrm.fugr.lztrmf00.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - LZTRMF00 - X - S - D$ - I - S - E - X - D$S - X - - - - diff --git a/src/ztrm.fugr.lztrmf01.abap b/src/ztrm.fugr.lztrmf01.abap new file mode 100644 index 0000000..a7e57c9 --- /dev/null +++ b/src/ztrm.fugr.lztrmf01.abap @@ -0,0 +1,34 @@ +*&---------------------------------------------------------------------* +*& Include LZTRMF01 +*&---------------------------------------------------------------------* + +FORM check_auth. + CALL FUNCTION 'ZTRM_CHECK_AUTH' + EXCEPTIONS + trm_rfc_unauthorized = 1. + IF sy-subrc EQ 1. + RAISE trm_rfc_unauthorized. + ENDIF. +ENDFORM. + +FORM handle_exception. + CHECK lo_exc IS BOUND. + CASE lo_exc->reason( ). + WHEN zcx_trm_exception=>c_reason-invalid_input. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING invalid_input. + WHEN zcx_trm_exception=>c_reason-enqueue_error. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING enqueue_error. + WHEN zcx_trm_exception=>c_reason-dequeue_error. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING dequeue_error. + WHEN zcx_trm_exception=>c_reason-dyn_call_param_not_found. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING dyn_call_param_not_found. + WHEN zcx_trm_exception=>c_reason-not_found. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING not_found. + WHEN zcx_trm_exception=>c_reason-tms_alert. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING tms_alert. + WHEN zcx_trm_exception=>c_reason-r3trans_cmd_error. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING r3trans_cmd_error. + WHEN OTHERS. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING generic. + ENDCASE. +ENDFORM. diff --git a/src/ztrm.fugr.lztrmt00.xml b/src/ztrm.fugr.lztrmf01.xml similarity index 66% rename from src/ztrm.fugr.lztrmt00.xml rename to src/ztrm.fugr.lztrmf01.xml index ed75861..2218071 100644 --- a/src/ztrm.fugr.lztrmt00.xml +++ b/src/ztrm.fugr.lztrmf01.xml @@ -3,16 +3,19 @@ - LZTRMT00 - S - D$ + LZTRMF01 I S E - X - D$S X + + + R + Include LZTRMF01 + 16 + + diff --git a/src/ztrm.fugr.lztrmi00.abap b/src/ztrm.fugr.lztrmi00.abap deleted file mode 100644 index c265046..0000000 --- a/src/ztrm.fugr.lztrmi00.abap +++ /dev/null @@ -1,5 +0,0 @@ -*---------------------------------------------------------------------* -* view related PAI modules -*---------------------------------------------------------------------* - -INCLUDE LSVIMITX . "base table related PAI modules diff --git a/src/ztrm.fugr.lztrmi00.xml b/src/ztrm.fugr.lztrmi00.xml deleted file mode 100644 index dd0a5cc..0000000 --- a/src/ztrm.fugr.lztrmi00.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - LZTRMI00 - X - S - D$ - I - S - E - X - D$S - X - - - - diff --git a/src/ztrm.fugr.lztrmt00.abap b/src/ztrm.fugr.lztrmt00.abap deleted file mode 100644 index 3106420..0000000 --- a/src/ztrm.fugr.lztrmt00.abap +++ /dev/null @@ -1,39 +0,0 @@ -*---------------------------------------------------------------------* -* view related data declarations -*---------------------------------------------------------------------* -*...processing: ZTRM_INSTALLDEVC................................* -DATA: BEGIN OF STATUS_ZTRM_INSTALLDEVC . "state vector - INCLUDE STRUCTURE VIMSTATUS. -DATA: END OF STATUS_ZTRM_INSTALLDEVC . -CONTROLS: TCTRL_ZTRM_INSTALLDEVC - TYPE TABLEVIEW USING SCREEN '0002'. -*...processing: ZTRM_SKIP_TRKORR................................* -DATA: BEGIN OF STATUS_ZTRM_SKIP_TRKORR . "state vector - INCLUDE STRUCTURE VIMSTATUS. -DATA: END OF STATUS_ZTRM_SKIP_TRKORR . -CONTROLS: TCTRL_ZTRM_SKIP_TRKORR - TYPE TABLEVIEW USING SCREEN '0001'. -*...processing: ZTRM_SRC_TRKORR.................................* -DATA: BEGIN OF STATUS_ZTRM_SRC_TRKORR . "state vector - INCLUDE STRUCTURE VIMSTATUS. -DATA: END OF STATUS_ZTRM_SRC_TRKORR . -CONTROLS: TCTRL_ZTRM_SRC_TRKORR - TYPE TABLEVIEW USING SCREEN '0004'. -*...processing: ZTRM_USERS......................................* -DATA: BEGIN OF STATUS_ZTRM_USERS . "state vector - INCLUDE STRUCTURE VIMSTATUS. -DATA: END OF STATUS_ZTRM_USERS . -CONTROLS: TCTRL_ZTRM_USERS - TYPE TABLEVIEW USING SCREEN '0003'. -*.........table declarations:.................................* -TABLES: *ZTRM_INSTALLDEVC . -TABLES: *ZTRM_SKIP_TRKORR . -TABLES: *ZTRM_SRC_TRKORR . -TABLES: *ZTRM_USERS . -TABLES: ZTRM_INSTALLDEVC . -TABLES: ZTRM_SKIP_TRKORR . -TABLES: ZTRM_SRC_TRKORR . -TABLES: ZTRM_USERS . - -* general table data declarations.............. - INCLUDE LSVIMTDT . diff --git a/src/ztrm.fugr.lztrmtop.abap b/src/ztrm.fugr.lztrmtop.abap index 4ebc5f5..44e6b9b 100644 --- a/src/ztrm.fugr.lztrmtop.abap +++ b/src/ztrm.fugr.lztrmtop.abap @@ -1,5 +1,7 @@ -FUNCTION-POOL ZTRM MESSAGE-ID SV. +FUNCTION-POOL ztrm MESSAGE-ID sv. * INCLUDE LZTRMD... " Local class definition - INCLUDE LSVIMDAT . "general data decl. - INCLUDE LZTRMT00 . "view rel. data dcl. + +DATA: lo_exc TYPE REF TO zcx_trm_exception, + lo_transport TYPE REF TO zcl_trm_transport, + lo_package TYPE REF TO zcl_trm_package. diff --git a/src/ztrm.fugr.saplztrm.abap b/src/ztrm.fugr.saplztrm.abap index aeb70b1..1f5d059 100644 --- a/src/ztrm.fugr.saplztrm.abap +++ b/src/ztrm.fugr.saplztrm.abap @@ -46,8 +46,4 @@ * INCLUDE LZTRME... " Events * INCLUDE LZTRMP... " Local class implement. * INCLUDE LZTRMT99. " ABAP Unit tests - INCLUDE LZTRMF00 . " subprograms - INCLUDE LZTRMI00 . " PAI modules - INCLUDE LSVIMFXX . " subprograms - INCLUDE LSVIMOXX . " PBO modules - INCLUDE LSVIMIXX . " PAI modules + INCLUDE LZTRMF01 . " subprograms diff --git a/src/ztrm.fugr.tableframe_ztrm.abap b/src/ztrm.fugr.tableframe_ztrm.abap deleted file mode 100644 index ff1aced..0000000 --- a/src/ztrm.fugr.tableframe_ztrm.abap +++ /dev/null @@ -1,10 +0,0 @@ -*---------------------------------------------------------------------* -* program for: TABLEFRAME_ZTRM -*---------------------------------------------------------------------* -FUNCTION TABLEFRAME_ZTRM . - - PERFORM TABLEFRAME TABLES X_HEADER X_NAMTAB DBA_SELLIST DPL_SELLIST - EXCL_CUA_FUNCT - USING CORR_NUMBER VIEW_ACTION VIEW_NAME. - -ENDFUNCTION. diff --git a/src/ztrm.fugr.tableproc_ztrm.abap b/src/ztrm.fugr.tableproc_ztrm.abap deleted file mode 100644 index dd1a101..0000000 --- a/src/ztrm.fugr.tableproc_ztrm.abap +++ /dev/null @@ -1,8 +0,0 @@ -*---------------------------------------------------------------------* -* program for: TABLEPROC_ZTRM -*---------------------------------------------------------------------* -FUNCTION TABLEPROC_ZTRM . - - PERFORM TABLEPROC. - -ENDFUNCTION. diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index 457006e..83e9541 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -4,282 +4,79 @@ TRM Functions - LZTRMF00 - LZTRMI00 - LZTRMT00 + LZTRMF01 LZTRMTOP SAPLZTRM - TABLEFRAME_ZTRM - Upper-level extended table maintenance + ZTRM_ADD_LANG_TR + R + Add language translation to transport request - VIEW_ACTION - 'S' - - - VIEW_NAME - DD02V-TABNAME - - - CORR_NUMBER - E070-TRKORR - ' ' + IV_TRKORR + TRKORR - DBA_SELLIST - VIMSELLIST - - - DPL_SELLIST - VIMSELLIST - - - EXCL_CUA_FUNCT - VIMEXCLFUN - - - X_HEADER - VIMDESC - - - X_NAMTAB - VIMNAMTAB + IT_DEVCLASS + LXE_TT_PACKG_LINE - MISSING_CORR_NUMBER + TRM_RFC_UNAUTHORIZED - - - - VIEW_ACTION - P - Aktion mit Tabelle: anz./änd./transp. (S/U/T) - - - VIEW_NAME - P - Name der Tabelle - - - CORR_NUMBER - P - Korrekturnummer für durchgeführte Änderungen - - - DBA_SELLIST - P - Selektionsbedingungen für den DB-Zugriff - - - DPL_SELLIST - P - Selektionsbedingungen für die Anzeige - - - EXCL_CUA_FUNCT - P - Tabelle mit dynam. zu deaktivierenden CUA-Funkt. - - - X_HEADER - P - Kontrollblocktabelle für die Tabelle - - - X_NAMTAB - P - Kontrollblocktabelle für die Tabellen-Felder - - - MISSING_CORR_NUMBER - X - Korrekturnummer fehlt - - - - - TABLEPROC_ZTRM - X - Lower-level extended table maintenance - - - FCODE - 'RDED' - - - VIEW_ACTION - 'S' - - - VIEW_NAME - DD02V-TABNAME - - - CORR_NUMBER - E070-TRKORR - ' ' - - - - - LAST_ACT_ENTRY - - - UCOMM - - - UPDATE_REQUIRED - - - - - CORR_KEYTAB - E071K - - - DBA_SELLIST - VIMSELLIST - - - DPL_SELLIST - VIMSELLIST - - - EXCL_CUA_FUNCT - VIMEXCLFUN - - - EXTRACT - - - TOTAL - - - X_HEADER - VIMDESC - - - X_NAMTAB - VIMNAMTAB - - - - MISSING_CORR_NUMBER + INVALID_INPUT - SAVING_CORRECTION_FAILED + GENERIC - FCODE - P - gewünschte Funktion des Bausteins - - - VIEW_ACTION - P - Aktion mit Tabelle: anz./änd./transp. (S/U/T) - - - VIEW_NAME - P - Name der Tabelle - - - CORR_NUMBER - P - Korrekturnummer für durchgeführte Änderungen - - - LAST_ACT_ENTRY - P - Index der Cursorposition in der Anzeigetabelle - - - UCOMM - P - letztes User-command innerhalb der Viewpflege - - - UPDATE_REQUIRED - P - Flag: Einträge verändert, Sichern erforderlich - - - CORR_KEYTAB - P - Tabelle mit den Keys der zu transport. Einträge - - - DBA_SELLIST - P - Selektionsbedingungen für den DB-Zugriff - - - DPL_SELLIST - P - Selektionsbedingungen für die Anzeige - - - EXCL_CUA_FUNCT - P - Tab. der nicht zu aktivierenden CUA-Funktionen - - - EXTRACT - P - Tab. der gerade sichtbaren Daten (Anzeigetabelle - - - TOTAL + IV_TRKORR P - Tabelle, mit allen von der DB gelesenen Daten - X_HEADER + IT_DEVCLASS P - Kontrollblocktabelle für die Tabelle - X_NAMTAB - P - Kontrollblocktabelle für die Tabellen-Felder + TRM_RFC_UNAUTHORIZED + X - MISSING_CORR_NUMBER + INVALID_INPUT X - Korrekturnummer fehlt - SAVING_CORRECTION_FAILED + GENERIC X - Fehler beim Sichern der Korrektureinträge - ZTRM_ADD_LANG_TR + ZTRM_ADD_NAMESPACE R - Add language translation to transport request + Add namespace - IV_TRKORR - TRKORR + IV_NAMESPACE + NAMESPACE + + + IV_REPLICENSE + TRNLICENSE - IT_DEVCLASS - LXE_TT_PACKG_LINE + IT_TEXTS + TRNSPACETT @@ -287,73 +84,35 @@ TRM_RFC_UNAUTHORIZED - EMPTY_DEVCLASS - - - LANGUAGE_NOT_IN_CP - - - CREATE_REQUEST_FAILED - - - WRITE_TO_REQUEST_FAILED - - - RELEASE_REQUEST_FAILED - - - INVALID_REQUEST - - - NO_CORRECT_OBJECTS_AVAILABLE + INVALID_INPUT - UNKNOWN + GENERIC - IV_TRKORR + IV_NAMESPACE P - IT_DEVCLASS + IV_REPLICENSE P - TRM_RFC_UNAUTHORIZED - X - - - EMPTY_DEVCLASS - X - - - LANGUAGE_NOT_IN_CP - X - - - CREATE_REQUEST_FAILED - X - - - WRITE_TO_REQUEST_FAILED - X - - - RELEASE_REQUEST_FAILED - X + IT_TEXTS + P - INVALID_REQUEST + TRM_RFC_UNAUTHORIZED X - NO_CORRECT_OBJECTS_AVAILABLE + INVALID_INPUT X - UNKNOWN + GENERIC X @@ -363,14 +122,15 @@ R Add objects to transport request - - IV_LOCK - FLAG - IV_TRKORR TRKORR + + IV_LOCK + X + FLAG + @@ -389,34 +149,19 @@ TRM_RFC_UNAUTHORIZED - INVALID_REQUEST - - - INVALID_REQUEST_TYPE - - - USER_NOT_OWNER - - - NO_OBJECTS_APPENDED - - - ENQUEUE_ERROR - - - CANCELLED_BY_USER + INVALID_INPUT - RECURSIVE_CALL + GENERIC - IV_LOCK + IV_TRKORR P - IV_TRKORR + IV_LOCK P @@ -432,31 +177,11 @@ X - INVALID_REQUEST - X - - - INVALID_REQUEST_TYPE - X - - - USER_NOT_OWNER - X - - - NO_OBJECTS_APPENDED - X - - - ENQUEUE_ERROR - X - - - CANCELLED_BY_USER + INVALID_INPUT X - RECURSIVE_CALL + GENERIC X @@ -476,7 +201,16 @@ TRM_RFC_UNAUTHORIZED - INSERT_ERROR + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -489,7 +223,19 @@ X - INSERT_ERROR + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X @@ -509,7 +255,16 @@ TRM_RFC_UNAUTHORIZED - INSERT_ERROR + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -522,7 +277,19 @@ X - INSERT_ERROR + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X @@ -567,10 +334,10 @@ TRM_RFC_UNAUTHORIZED - INSERT_FAILED + INVALID_INPUT - ENQUEUE_FAILED + GENERIC @@ -591,11 +358,11 @@ X - INSERT_FAILED + INVALID_INPUT X - ENQUEUE_FAILED + GENERIC X @@ -615,97 +382,13 @@ TRM_RFC_UNAUTHORIZED - OBJECT_ALREADY_EXISTING - - - OBJECT_JUST_CREATED - - - NOT_AUTHORIZED - - - WRONG_NAME_PREFIX - - - UNDEFINED_NAME - - - RESERVED_LOCAL_NAME - - - INVALID_PACKAGE_NAME - - - SHORT_TEXT_MISSING - - - SOFTWARE_COMPONENT_INVALID - - - LAYER_INVALID - - - AUTHOR_NOT_EXISTING - - - COMPONENT_NOT_EXISTING - - - COMPONENT_MISSING - - - PREFIX_IN_USE - - - UNEXPECTED_ERROR - - - INTERN_ERR - - - NO_ACCESS - - - INVALID_TRANSLATION_DEPTH - - - WRONG_MAINPACK_VALUE - - - SUPERPACKAGE_INVALID - - - ERROR_IN_CTS_CHECKS - - - OBJECT_INVALID - - - OBJECT_NOT_CHANGEABLE - - - CANCELLED_IN_CORR - - - PERMISSION_FAILURE - - - OBJECT_LOCKED_BY_OTHER_USER - - - OBJECT_ALREADY_CHANGEABLE - - - OBJECT_ALREADY_UNLOCKED - - - OBJECT_DELETED + INVALID_INPUT - OBJECT_MODIFIED + DYN_CALL_PARAM_NOT_FOUND - OBJECT_NOT_EXISTING + GENERIC @@ -718,127 +401,15 @@ X - OBJECT_ALREADY_EXISTING - X - - - OBJECT_JUST_CREATED - X - - - NOT_AUTHORIZED - X - - - WRONG_NAME_PREFIX - X - - - UNDEFINED_NAME - X - - - RESERVED_LOCAL_NAME - X - - - INVALID_PACKAGE_NAME - X - - - SHORT_TEXT_MISSING - X - - - SOFTWARE_COMPONENT_INVALID - X - - - LAYER_INVALID - X - - - AUTHOR_NOT_EXISTING - X - - - COMPONENT_NOT_EXISTING - X - - - COMPONENT_MISSING - X - - - PREFIX_IN_USE - X - - - UNEXPECTED_ERROR - X - - - INTERN_ERR - X - - - NO_ACCESS - X - - - INVALID_TRANSLATION_DEPTH - X - - - WRONG_MAINPACK_VALUE - X - - - SUPERPACKAGE_INVALID - X - - - ERROR_IN_CTS_CHECKS - X - - - OBJECT_INVALID - X - - - OBJECT_NOT_CHANGEABLE - X - - - CANCELLED_IN_CORR - X - - - PERMISSION_FAILURE - X - - - OBJECT_LOCKED_BY_OTHER_USER - X - - - OBJECT_ALREADY_CHANGEABLE - X - - - OBJECT_ALREADY_UNLOCKED - X - - - OBJECT_DELETED + INVALID_INPUT X - OBJECT_MODIFIED + DYN_CALL_PARAM_NOT_FOUND X - OBJECT_NOT_EXISTING + GENERIC X @@ -868,10 +439,10 @@ TRM_RFC_UNAUTHORIZED - INSERT_FAILED + INVALID_INPUT - ENQUEUE_FAILED + GENERIC @@ -892,11 +463,11 @@ X - INSERT_FAILED + INVALID_INPUT X - ENQUEUE_FAILED + GENERIC X @@ -909,132 +480,34 @@ IV_TRKORR TRKORR - - - - - TRM_RFC_UNAUTHORIZED - - - FILE_ACCESS_ERROR - - - ORDER_ALREADY_RELEASED - - - ORDER_CONTAINS_C_MEMBER - - - ORDER_CONTAINS_LOCKED_ENTRIES - - - ORDER_IS_REFERED - - - REPAIR_ORDER - - - USER_NOT_OWNER - - - DELETE_WAS_CANCELLED - - - ORDERNUMBER_EMPTY - - - TR_ENQUEUE_FAILED - - - OBJECTS_FREE_BUT_STILL_LOCKS - - - ORDER_LOCK_FAILED - - - NO_AUTHORIZATION - - - WRONG_CLIENT - - - PROJECT_STILL_REFERENCED - - - SUCCESSORS_ALREADY_RELEASED - - - - - IV_TRKORR - P - - - TRM_RFC_UNAUTHORIZED - X - - - FILE_ACCESS_ERROR - X - - - ORDER_ALREADY_RELEASED - X - - - ORDER_CONTAINS_C_MEMBER - X - - - ORDER_CONTAINS_LOCKED_ENTRIES - X - - - ORDER_IS_REFERED - X - - - REPAIR_ORDER - X - - - USER_NOT_OWNER - X - - - DELETE_WAS_CANCELLED - X - - - ORDERNUMBER_EMPTY - X - - - TR_ENQUEUE_FAILED - X - - - OBJECTS_FREE_BUT_STILL_LOCKS - X - - - ORDER_LOCK_FAILED - X - + + + + + TRM_RFC_UNAUTHORIZED + + + INVALID_INPUT + + + GENERIC + + + - NO_AUTHORIZATION - X + IV_TRKORR + P - WRONG_CLIENT + TRM_RFC_UNAUTHORIZED X - PROJECT_STILL_REFERENCED + INVALID_INPUT X - SUCCESSORS_ALREADY_RELEASED + GENERIC X @@ -1053,6 +526,15 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + DEQUEUE_ERROR + + + GENERIC + @@ -1063,6 +545,18 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + DEQUEUE_ERROR + X + + + GENERIC + X + @@ -1094,13 +588,10 @@ TRM_RFC_UNAUTHORIZED - READ_CONFIG_FAILED - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT - ERROR_MESSAGE + GENERIC @@ -1125,15 +616,11 @@ X - READ_CONFIG_FAILED - X - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT X - ERROR_MESSAGE + GENERIC X @@ -1158,6 +645,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -1172,6 +665,14 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + @@ -1195,10 +696,10 @@ TRM_RFC_UNAUTHORIZED - CANCELLED_BY_USER + INVALID_INPUT - INVALID_INPUT + GENERIC @@ -1215,11 +716,11 @@ X - CANCELLED_BY_USER + INVALID_INPUT X - INVALID_INPUT + GENERIC X @@ -1239,7 +740,10 @@ TRM_RFC_UNAUTHORIZED - NOT_FOUND + INVALID_INPUT + + + GENERIC @@ -1252,7 +756,11 @@ X - NOT_FOUND + INVALID_INPUT + X + + + GENERIC X @@ -1271,9 +779,15 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + NOT_FOUND + + GENERIC + @@ -1284,10 +798,18 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + NOT_FOUND X + + GENERIC + X + @@ -1318,6 +840,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -1340,6 +868,54 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + + + + + ZTRM_GET_R3TRANS_INFO + R + Get system installed R3trans info + + + EV_LOG + STRING + + + + + TRM_RFC_UNAUTHORIZED + + + R3TRANS_CMD_ERROR + + + GENERIC + + + + + EV_LOG + P + + + TRM_RFC_UNAUTHORIZED + X + + + R3TRANS_CMD_ERROR + X + + + GENERIC + X + @@ -1356,14 +932,11 @@ TRM_RFC_UNAUTHORIZED - - WRONG_CALL - INVALID_INPUT - CTS_INITIALIZATION_FAILURE + GENERIC @@ -1375,16 +948,12 @@ TRM_RFC_UNAUTHORIZED X - - WRONG_CALL - X - INVALID_INPUT X - CTS_INITIALIZATION_FAILURE + GENERIC X @@ -1408,13 +977,10 @@ TRM_RFC_UNAUTHORIZED - READ_CONFIG_FAILED - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT - ERROR_MESSAGE + GENERIC @@ -1431,15 +997,11 @@ X - READ_CONFIG_FAILED - X - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT X - ERROR_MESSAGE + GENERIC X @@ -1458,6 +1020,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -1468,6 +1036,14 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + @@ -1517,11 +1093,14 @@ TRM_RFC_UNAUTHORIZED - READ_QUEUE_FAILED + INVALID_INPUT TMS_ALERT + + GENERIC + @@ -1537,13 +1116,17 @@ X - READ_QUEUE_FAILED + INVALID_INPUT X TMS_ALERT X + + GENERIC + X + @@ -1571,55 +1154,10 @@ TRM_RFC_UNAUTHORIZED - CTS_INITIALIZATION_FAILURE - - - ENQUEUE_FAILED - - - NO_AUTHORIZATION - - - INVALID_REQUEST - - - REQUEST_ALREADY_RELEASED - - - REPEAT_TOO_EARLY - - - OBJECT_LOCK_ERROR - - - OBJECT_CHECK_ERROR - - - DOCU_MISSING - - - DB_ACCESS_ERROR - - - ACTION_ABORTED_BY_USER - - - EXPORT_FAILED - - - EXECUTE_OBJECTS_CHECK - - - RELEASE_IN_BG_MODE - - - RELEASE_IN_BG_MODE_W_OBJCHK - - - ERROR_IN_EXPORT_METHODS + INVALID_INPUT - OBJECT_LANG_ERROR + GENERIC @@ -1640,71 +1178,11 @@ X - CTS_INITIALIZATION_FAILURE - X - - - ENQUEUE_FAILED - X - - - NO_AUTHORIZATION - X - - - INVALID_REQUEST - X - - - REQUEST_ALREADY_RELEASED - X - - - REPEAT_TOO_EARLY - X - - - OBJECT_LOCK_ERROR - X - - - OBJECT_CHECK_ERROR - X - - - DOCU_MISSING - X - - - DB_ACCESS_ERROR - X - - - ACTION_ABORTED_BY_USER - X - - - EXPORT_FAILED - X - - - EXECUTE_OBJECTS_CHECK - X - - - RELEASE_IN_BG_MODE - X - - - RELEASE_IN_BG_MODE_W_OBJCHK - X - - - ERROR_IN_EXPORT_METHODS + INVALID_INPUT X - OBJECT_LANG_ERROR + GENERIC X @@ -1728,7 +1206,16 @@ TRM_RFC_UNAUTHORIZED - UPDATE_FAILED + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -1745,7 +1232,19 @@ X - UPDATE_FAILED + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X @@ -1762,7 +1261,19 @@ - TRM_RFC_UNAUTHORIZED + TRM_RFC_UNAUTHORIZED + + + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -1774,6 +1285,22 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC + X + @@ -1790,6 +1317,18 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC + @@ -1800,6 +1339,22 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC + X + @@ -1823,7 +1378,16 @@ TRM_RFC_UNAUTHORIZED - ERROR + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -1840,7 +1404,19 @@ X - ERROR + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X @@ -1888,76 +1464,10 @@ TRM_RFC_UNAUTHORIZED - TADIR_ENTRY_NOT_EXISTING - - - TADIR_ENTRY_ILL_TYPE - - - NO_SYSTEMNAME - - - NO_SYSTEMTYPE - - - ORIGINAL_SYSTEM_CONFLICT - - - OBJECT_RESERVED_FOR_DEVCLASS - - - OBJECT_EXISTS_GLOBAL - - - OBJECT_EXISTS_LOCAL - - - OBJECT_IS_DISTRIBUTED - - - OBJ_SPECIFICATION_NOT_UNIQUE - - - NO_AUTHORIZATION_TO_DELETE - - - DEVCLASS_NOT_EXISTING - - - SIMULTANIOUS_SET_REMOVE_REPAIR - - - ORDER_MISSING - - - NO_MODIFICATION_OF_HEAD_SYST - - - PGMID_OBJECT_NOT_ALLOWED - - - MASTERLANGUAGE_NOT_SPECIFIED - - - DEVCLASS_NOT_SPECIFIED - - - SPECIFY_OWNER_UNIQUE - - - LOC_PRIV_OBJS_NO_REPAIR - - - GTADIR_NOT_REACHED - - - OBJECT_LOCKED_FOR_ORDER - - - CHANGE_OF_CLASS_NOT_ALLOWED + INVALID_INPUT - NO_CHANGE_FROM_SAP_TO_TMP + GENERIC @@ -1994,99 +1504,11 @@ X - TADIR_ENTRY_NOT_EXISTING - X - - - TADIR_ENTRY_ILL_TYPE - X - - - NO_SYSTEMNAME - X - - - NO_SYSTEMTYPE - X - - - ORIGINAL_SYSTEM_CONFLICT - X - - - OBJECT_RESERVED_FOR_DEVCLASS - X - - - OBJECT_EXISTS_GLOBAL - X - - - OBJECT_EXISTS_LOCAL - X - - - OBJECT_IS_DISTRIBUTED - X - - - OBJ_SPECIFICATION_NOT_UNIQUE - X - - - NO_AUTHORIZATION_TO_DELETE - X - - - DEVCLASS_NOT_EXISTING - X - - - SIMULTANIOUS_SET_REMOVE_REPAIR - X - - - ORDER_MISSING - X - - - NO_MODIFICATION_OF_HEAD_SYST - X - - - PGMID_OBJECT_NOT_ALLOWED - X - - - MASTERLANGUAGE_NOT_SPECIFIED - X - - - DEVCLASS_NOT_SPECIFIED - X - - - SPECIFY_OWNER_UNIQUE - X - - - LOC_PRIV_OBJS_NO_REPAIR - X - - - GTADIR_NOT_REACHED - X - - - OBJECT_LOCKED_FOR_ORDER - X - - - CHANGE_OF_CLASS_NOT_ALLOWED + INVALID_INPUT X - NO_CHANGE_FROM_SAP_TO_TMP + GENERIC X @@ -2110,13 +1532,21 @@ X FLAG + + IV_DEVLAYER + X + DEVLAYER + TRM_RFC_UNAUTHORIZED - FACTORY_ERROR + INVALID_INPUT + + + GENERIC @@ -2132,12 +1562,20 @@ IV_RM_PARENTCL P + + IV_DEVLAYER + P + TRM_RFC_UNAUTHORIZED X - FACTORY_ERROR + INVALID_INPUT + X + + + GENERIC X @@ -2165,37 +1603,10 @@ TRM_RFC_UNAUTHORIZED - DB_ACCESS_ERROR - - - TRKORR_FROM_NOT_EXIST - - - TRKORR_TO_IS_REPAIR - - - TRKORR_TO_LOCKED - - - TRKORR_TO_NOT_EXIST - - - TRKORR_TO_RELEASED - - - USER_NOT_OWNER - - - NO_AUTHORIZATION - - - WRONG_CLIENT - - - WRONG_CATEGORY + INVALID_INPUT - OBJECT_NOT_PATCHABLE + GENERIC @@ -2216,47 +1627,11 @@ X - DB_ACCESS_ERROR - X - - - TRKORR_FROM_NOT_EXIST - X - - - TRKORR_TO_IS_REPAIR - X - - - TRKORR_TO_LOCKED - X - - - TRKORR_TO_NOT_EXIST - X - - - TRKORR_TO_RELEASED - X - - - USER_NOT_OWNER - X - - - NO_AUTHORIZATION - X - - - WRONG_CLIENT - X - - - WRONG_CATEGORY + INVALID_INPUT X - OBJECT_NOT_PATCHABLE + GENERIC X @@ -2296,6 +1671,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -2310,1028 +1691,17 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + - - -
- SAPLZTRM - 0001 - E - View Maintenance: Overview Screen ZTRM_SKIP_TRKORR - N - 0001 - 061 - 255 -
- - - SCREEN - SCREEN - - - TABLE_CTRL - TCTRL_ZTRM_SKIP_TRKORR - SCREEN - 001 - 001 - 255 - 059 - X - X - X - X - ENTRY - X - X - X - X - X - MULTIPLE - NONE - X - 001 - - - - - SCREEN - SCREEN - PUSH_TMPL - VIM_POSI_PUSH - ____________________ - 061 - 019 - 020 - 020 - 001 - POSI - CHAR - X - N - - - SCREEN - SCREEN - TEMPLATE - VIM_POSITION_INFO - ______________________________ - 061 - 040 - 030 - 030 - 001 - CHAR - X - X - X - N - <_--32_DIMENS>X - - - SCREEN - SCREEN - OKCODE - OK_CODE - ____________________ - 020 - 020 - 001 - CHAR - X - - - TABLE_CTRL - TCTRL_ZTRM_SKIP_TRKORR - TEMPLATE - VIM_FRAME_FIELD - ____________________________________________________________ - 001 - 060 - 060 - 001 - CHAR - X - X - N - X - - - TABLE_CTRL - TCTRL_ZTRM_SKIP_TRKORR - TEXT - *ZTRM_SKIP_TRKORR-TRKORR - 001 - 001 - 040 - 020 - 001 - CHAR - X - V - N - X - - - TABLE_CTRL - TCTRL_ZTRM_SKIP_TRKORR - CHECK - VIM_MARKED - 001 - 001 - 001 - 001 - CHAR - X - X - X - - - TABLE_CTRL - TCTRL_ZTRM_SKIP_TRKORR - TEMPLATE - ZTRM_SKIP_TRKORR-TRKORR - ____________________ - 001 - 001 - 020 - 020 - 001 - KEY - CHAR - X - X - X - X - N - X - - - - - PROCESS BEFORE OUTPUT. - - - MODULE LISTE_INITIALISIEREN. - - - LOOP AT EXTRACT WITH CONTROL - - - TCTRL_ZTRM_SKIP_TRKORR CURSOR NEXTLINE. - - - MODULE LISTE_SHOW_LISTE. - - - ENDLOOP. - - - * - - - PROCESS AFTER INPUT. - - - MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND. - - - MODULE LISTE_BEFORE_LOOP. - - - LOOP AT EXTRACT. - - - MODULE LISTE_INIT_WORKAREA. - - - CHAIN. - - - FIELD ZTRM_SKIP_TRKORR-TRKORR . - - - MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST. - - - ENDCHAIN. - - - FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX. - - - CHAIN. - - - FIELD ZTRM_SKIP_TRKORR-TRKORR . - - - MODULE LISTE_UPDATE_LISTE. - - - ENDCHAIN. - - - ENDLOOP. - - - MODULE LISTE_AFTER_LOOP. - - -
- -
- SAPLZTRM - 0002 - E - View Maintenance: Overview Screen ZTRM_INSTALLDEVC - N - 0002 - 061 - 255 -
- - - SCREEN - SCREEN - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - SCREEN - 001 - 001 - 255 - 059 - X - X - X - X - ENTRY - X - X - X - X - X - MULTIPLE - NONE - X - 003 - - - - - SCREEN - SCREEN - PUSH_TMPL - VIM_POSI_PUSH - ____________________ - 061 - 019 - 020 - 020 - 001 - POSI - CHAR - X - N - - - SCREEN - SCREEN - TEMPLATE - VIM_POSITION_INFO - ______________________________ - 061 - 040 - 030 - 030 - 001 - CHAR - X - X - X - N - <_--32_DIMENS>X - - - SCREEN - SCREEN - OKCODE - OK_CODE - ____________________ - 020 - 020 - 001 - CHAR - X - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEMPLATE - VIM_FRAME_FIELD - ____________________________________________________________ - 001 - 060 - 060 - 001 - CHAR - X - X - N - X - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEXT - *ZTRM_INSTALLDEVC-PACKAGE_NAME - +_______________________________________ - 001 - 001 - 040 - 042 - 001 - CHAR - N - X - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEXT - *ZTRM_INSTALLDEVC-PACKAGE_REGISTRY - +_______________________________________ - 001 - 002 - 040 - 100 - 001 - CHAR - N - X - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEXT - *ZTRM_INSTALLDEVC-ORIGINAL_DEVCLASS - +_______________________________________ - 001 - 003 - 040 - 030 - 001 - CHAR - N - X - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEXT - *ZTRM_INSTALLDEVC-INSTALL_DEVCLASS - 001 - 004 - 040 - 030 - 001 - CHAR - X - V - N - X - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - CHECK - VIM_MARKED - 001 - 001 - 001 - 001 - CHAR - X - X - X - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEMPLATE - ZTRM_INSTALLDEVC-PACKAGE_NAME - __________________________________________ - X - 001 - 001 - 042 - 021 - 001 - KEY - CHAR - X - X - X - N - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEMPLATE - ZTRM_INSTALLDEVC-PACKAGE_REGISTRY - ____________________________________________________________________________________________________ - X - 001 - 002 - 100 - 012 - 001 - KEY - CHAR - X - X - X - N - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEMPLATE - ZTRM_INSTALLDEVC-ORIGINAL_DEVCLASS - ______________________________ - X - 001 - 003 - 030 - 015 - 001 - KEY - CHAR - X - X - X - N - - - TABLE_CTRL - TCTRL_ZTRM_INSTALLDEVC - TEMPLATE - ZTRM_INSTALLDEVC-INSTALL_DEVCLASS - ______________________________ - 001 - 004 - 030 - 030 - 001 - CHAR - X - X - DVC - X - X - - - - - PROCESS BEFORE OUTPUT. - - - MODULE LISTE_INITIALISIEREN. - - - LOOP AT EXTRACT WITH CONTROL - - - TCTRL_ZTRM_INSTALLDEVC CURSOR NEXTLINE. - - - MODULE LISTE_SHOW_LISTE. - - - ENDLOOP. - - - * - - - PROCESS AFTER INPUT. - - - MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND. - - - MODULE LISTE_BEFORE_LOOP. - - - LOOP AT EXTRACT. - - - MODULE LISTE_INIT_WORKAREA. - - - CHAIN. - - - FIELD ZTRM_INSTALLDEVC-PACKAGE_NAME . - - - FIELD ZTRM_INSTALLDEVC-PACKAGE_REGISTRY . - - - FIELD ZTRM_INSTALLDEVC-ORIGINAL_DEVCLASS . - - - FIELD ZTRM_INSTALLDEVC-INSTALL_DEVCLASS . - - - MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST. - - - ENDCHAIN. - - - FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX. - - - CHAIN. - - - FIELD ZTRM_INSTALLDEVC-PACKAGE_NAME . - - - FIELD ZTRM_INSTALLDEVC-PACKAGE_REGISTRY . - - - FIELD ZTRM_INSTALLDEVC-ORIGINAL_DEVCLASS . - - - MODULE LISTE_UPDATE_LISTE. - - - ENDCHAIN. - - - ENDLOOP. - - - MODULE LISTE_AFTER_LOOP. - - -
- -
- SAPLZTRM - 0003 - E - View Maintenance: Overview Screen ZTRM_USERS - N - 0003 - 061 - 255 -
- - - SCREEN - SCREEN - - - TABLE_CTRL - TCTRL_ZTRM_USERS - SCREEN - 001 - 001 - 255 - 059 - X - X - X - X - ENTRY - X - X - X - X - X - MULTIPLE - NONE - X - 001 - - - - - SCREEN - SCREEN - PUSH_TMPL - VIM_POSI_PUSH - ____________________ - 061 - 019 - 020 - 020 - 001 - POSI - CHAR - X - N - - - SCREEN - SCREEN - TEMPLATE - VIM_POSITION_INFO - ______________________________ - 061 - 040 - 030 - 030 - 001 - CHAR - X - X - X - N - <_--32_DIMENS>X - - - SCREEN - SCREEN - OKCODE - OK_CODE - ____________________ - 020 - 020 - 001 - CHAR - X - - - TABLE_CTRL - TCTRL_ZTRM_USERS - TEMPLATE - VIM_FRAME_FIELD - ____________________________________________________________ - 001 - 060 - 060 - 001 - CHAR - X - X - N - X - - - TABLE_CTRL - TCTRL_ZTRM_USERS - TEXT - *ZTRM_USERS-UNAME - 001 - 001 - 040 - 012 - 001 - CHAR - X - V - N - X - - - TABLE_CTRL - TCTRL_ZTRM_USERS - CHECK - VIM_MARKED - 001 - 001 - 001 - 001 - CHAR - X - X - X - - - TABLE_CTRL - TCTRL_ZTRM_USERS - TEMPLATE - ZTRM_USERS-UNAME - ____________ - 001 - 001 - 012 - 012 - 001 - KEY - CHAR - X - X - X - N - - - - - PROCESS BEFORE OUTPUT. - - - MODULE LISTE_INITIALISIEREN. - - - LOOP AT EXTRACT WITH CONTROL - - - TCTRL_ZTRM_USERS CURSOR NEXTLINE. - - - MODULE LISTE_SHOW_LISTE. - - - ENDLOOP. - - - * - - - PROCESS AFTER INPUT. - - - MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND. - - - MODULE LISTE_BEFORE_LOOP. - - - LOOP AT EXTRACT. - - - MODULE LISTE_INIT_WORKAREA. - - - CHAIN. - - - FIELD ZTRM_USERS-UNAME . - - - MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST. - - - ENDCHAIN. - - - FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX. - - - CHAIN. - - - FIELD ZTRM_USERS-UNAME . - - - MODULE LISTE_UPDATE_LISTE. - - - ENDCHAIN. - - - ENDLOOP. - - - MODULE LISTE_AFTER_LOOP. - - -
- -
- SAPLZTRM - 0004 - E - View Maintenance: Overview Screen ZTRM_SRC_TRKORR - N - 0004 - 061 - 255 -
- - - SCREEN - SCREEN - - - TABLE_CTRL - TCTRL_ZTRM_SRC_TRKORR - SCREEN - 001 - 001 - 255 - 059 - X - X - X - X - ENTRY - X - X - X - X - X - MULTIPLE - NONE - X - 001 - - - - - SCREEN - SCREEN - PUSH_TMPL - VIM_POSI_PUSH - ____________________ - 061 - 019 - 020 - 020 - 001 - POSI - CHAR - X - N - - - SCREEN - SCREEN - TEMPLATE - VIM_POSITION_INFO - ______________________________ - 061 - 040 - 030 - 030 - 001 - CHAR - X - X - X - N - <_--32_DIMENS>X - - - SCREEN - SCREEN - OKCODE - OK_CODE - ____________________ - 020 - 020 - 001 - CHAR - X - - - TABLE_CTRL - TCTRL_ZTRM_SRC_TRKORR - TEMPLATE - VIM_FRAME_FIELD - ____________________________________________________________ - 001 - 060 - 060 - 001 - CHAR - X - X - N - X - - - TABLE_CTRL - TCTRL_ZTRM_SRC_TRKORR - TEXT - *ZTRM_SRC_TRKORR-TRKORR - 001 - 001 - 040 - 020 - 001 - CHAR - X - V - N - X - - - TABLE_CTRL - TCTRL_ZTRM_SRC_TRKORR - CHECK - VIM_MARKED - 001 - 001 - 001 - 001 - CHAR - X - X - X - - - TABLE_CTRL - TCTRL_ZTRM_SRC_TRKORR - TEMPLATE - ZTRM_SRC_TRKORR-TRKORR - ____________________ - 001 - 001 - 020 - 020 - 001 - KEY - CHAR - X - X - X - X - N - X - - - - - PROCESS BEFORE OUTPUT. - - - MODULE LISTE_INITIALISIEREN. - - - LOOP AT EXTRACT WITH CONTROL - - - TCTRL_ZTRM_SRC_TRKORR CURSOR NEXTLINE. - - - MODULE LISTE_SHOW_LISTE. - - - ENDLOOP. - - - * - - - PROCESS AFTER INPUT. - - - MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND. - - - MODULE LISTE_BEFORE_LOOP. - - - LOOP AT EXTRACT. - - - MODULE LISTE_INIT_WORKAREA. - - - CHAIN. - - - FIELD ZTRM_SRC_TRKORR-TRKORR . - - - MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST. - - - ENDCHAIN. - - - FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX. - - - CHAIN. - - - FIELD ZTRM_SRC_TRKORR-TRKORR . - - - MODULE LISTE_UPDATE_LISTE. - - - ENDCHAIN. - - - ENDLOOP. - - - MODULE LISTE_AFTER_LOOP. - - -
-
diff --git a/src/ztrm.fugr.ztrm_add_lang_tr.abap b/src/ztrm.fugr.ztrm_add_lang_tr.abap index 5c63b08..680bf7d 100644 --- a/src/ztrm.fugr.ztrm_add_lang_tr.abap +++ b/src/ztrm.fugr.ztrm_add_lang_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_ADD_LANG_TR. +FUNCTION ztrm_add_lang_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -7,122 +7,19 @@ FUNCTION ZTRM_ADD_LANG_TR. *" IT_DEVCLASS STRUCTURE LXE_TT_PACKG_LINE *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" EMPTY_DEVCLASS -*" LANGUAGE_NOT_IN_CP -*" CREATE_REQUEST_FAILED -*" WRITE_TO_REQUEST_FAILED -*" RELEASE_REQUEST_FAILED -*" INVALID_REQUEST -*" NO_CORRECT_OBJECTS_AVAILABLE -*" UNKNOWN +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - DATA: it_langs TYPE TABLE OF lxeisolang, - wa_langs TYPE lxeisolang, - lo_explang TYPE REF TO cl_lxe_log_export, - lv_ret_cnt TYPE i, - lt_objct TYPE lxe_tt_objct, - lt_user TYPE lxe_tt_user, - lt_date TYPE lxe_tt_date, - lt_comp TYPE lxe_tt_comp. + PERFORM check_auth. - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - IF it_devclass[] IS INITIAL. - RAISE empty_devclass. - ENDIF. - - SELECT DISTINCT targlng FROM lxe_log INTO TABLE it_langs WHERE custmnr EQ cl_lxe_constants=>c_trl_area_local. - - LOOP AT it_langs INTO wa_langs. - - CALL FUNCTION 'LXE_T002_CHECK_LANGUAGE' - EXPORTING - language = wa_langs - EXCEPTIONS - language_not_in_cp = 1 - unknown = 2 - OTHERS = 3. - - IF sy-subrc EQ 1. - RAISE language_not_in_cp. - ELSEIF sy-subrc EQ 2. - RAISE unknown. - ELSEIF sy-subrc EQ 3. - RAISE unknown. - ENDIF. - - CLEAR lo_explang. - - CREATE OBJECT lo_explang TYPE cl_lxe_log_export_local - EXPORTING - custmnr = cl_lxe_constants=>c_trl_area_local - isolang = wa_langs. - - DATA ls_date LIKE LINE OF lt_date. - ls_date-sign = 'I'. - ls_date-option = 'LE'. - ls_date-low = sy-datum. - APPEND ls_date TO lt_date. - - CLEAR lv_ret_cnt. - lv_ret_cnt = lo_explang->log_select( st_objct = lt_objct[] - st_user = lt_user[] - st_date = lt_date[] ). - CHECK lv_ret_cnt NE 0. - - CLEAR lv_ret_cnt. - lv_ret_cnt = lo_explang->apply_filters( st_packg = it_devclass[] - st_comp = lt_comp[] - piecelist = ' ' - check_ex = 'X' - chckorlg = ' ' - clientdp = ' ' ). - - CHECK lv_ret_cnt NE 0. - - CALL METHOD lo_explang->export_objects + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->add_translations( EXPORTING - tr_auto = '' - tr_request = iv_trkorr - force = '' - forcekey = '' - object_transport = '' - tr_system = '' - tr_project = '' - tr_mixed = 'X' - t_transport = '' - tr_text = '' - tr_release = '' - rfc_destination = '' - EXCEPTIONS - create_request_failed = 1 - write_to_request_failed = 2 - release_request_failed = 3 - invalid_request = 4 - no_correct_objects_available = 5 - OTHERS = 6. - - IF sy-subrc EQ 1. - RAISE create_request_failed. - ELSEIF sy-subrc EQ 2. - RAISE write_to_request_failed. - ELSEIF sy-subrc EQ 3. - RAISE release_request_failed. - ELSEIF sy-subrc EQ 4. - RAISE invalid_request. - ELSEIF sy-subrc EQ 5. - RAISE no_correct_objects_available. - ELSEIF sy-subrc EQ 6. - RAISE unknown. - ENDIF. - ENDLOOP. - - - + it_devclass = it_devclass[] + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_add_namespace.abap b/src/ztrm.fugr.ztrm_add_namespace.abap new file mode 100644 index 0000000..f9d9721 --- /dev/null +++ b/src/ztrm.fugr.ztrm_add_namespace.abap @@ -0,0 +1,27 @@ +FUNCTION ztrm_add_namespace. +*"---------------------------------------------------------------------- +*"*"Local Interface: +*" IMPORTING +*" VALUE(IV_NAMESPACE) TYPE NAMESPACE +*" VALUE(IV_REPLICENSE) TYPE TRNLICENSE +*" TABLES +*" IT_TEXTS STRUCTURE TRNSPACETT +*" EXCEPTIONS +*" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC +*"---------------------------------------------------------------------- + PERFORM check_auth. + + TRY. + zcl_trm_utility=>add_namespace( + EXPORTING + iv_namespace = iv_namespace + iv_replicense = iv_replicense + it_texts = it_texts[] + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. + +ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_add_objs_tr.abap b/src/ztrm.fugr.ztrm_add_objs_tr.abap index 03b0ae3..2724c65 100644 --- a/src/ztrm.fugr.ztrm_add_objs_tr.abap +++ b/src/ztrm.fugr.ztrm_add_objs_tr.abap @@ -1,63 +1,31 @@ -FUNCTION ZTRM_ADD_OBJS_TR. +FUNCTION ztrm_add_objs_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING -*" VALUE(IV_LOCK) TYPE FLAG *" VALUE(IV_TRKORR) TYPE TRKORR +*" VALUE(IV_LOCK) TYPE FLAG OPTIONAL *" EXPORTING *" VALUE(ET_LOG) TYPE SPROT_U_TAB *" TABLES *" IT_E071 STRUCTURE E071 *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INVALID_REQUEST -*" INVALID_REQUEST_TYPE -*" USER_NOT_OWNER -*" NO_OBJECTS_APPENDED -*" ENQUEUE_ERROR -*" CANCELLED_BY_USER -*" RECURSIVE_CALL +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - CALL FUNCTION 'TRINT_REQUEST_CHOICE' - EXPORTING - iv_suppress_dialog = 'X' - iv_request_types = 'FTCOK' - iv_lock_objects = iv_lock - iv_with_error_log = 'X' - iv_request = iv_trkorr - IMPORTING - et_log = et_log - TABLES - it_e071 = it_e071 - EXCEPTIONS - invalid_request = 1 - invalid_request_type = 2 - user_not_owner = 3 - no_objects_appended = 4 - enqueue_error = 5 - cancelled_by_user = 6 - recursive_call = 7. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->add_objects( + EXPORTING + iv_lock = iv_lock + it_e071 = it_e071[] + IMPORTING + et_log = et_log + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. - IF sy-subrc EQ 1. - RAISE invalid_request. - ELSEIF sy-subrc EQ 2. - RAISE invalid_request_type. - ELSEIF sy-subrc EQ 3. - RAISE user_not_owner. - ELSEIF sy-subrc EQ 4. - RAISE no_objects_appended. - ELSEIF sy-subrc EQ 5. - RAISE enqueue_error. - ELSEIF sy-subrc EQ 6. - RAISE cancelled_by_user. - ELSEIF sy-subrc EQ 7. - RAISE recursive_call. - ENDIF. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap index de8cf16..34faa22 100644 --- a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap @@ -1,27 +1,24 @@ -FUNCTION ZTRM_ADD_SKIP_TRKORR. +FUNCTION ztrm_add_skip_trkorr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_ERROR +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - DATA ls_data TYPE ztrm_skip_trkorr. - ls_data-trkorr = iv_trkorr. - - INSERT ztrm_skip_trkorr FROM ls_data. - COMMIT WORK AND WAIT. - - IF sy-subrc <> 0. - RAISE insert_error. - ENDIF. + TRY. + zcl_trm_utility=>add_skip_trkorr( + EXPORTING + iv_trkorr = iv_trkorr + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_add_src_trkorr.abap b/src/ztrm.fugr.ztrm_add_src_trkorr.abap index 79c77c5..31f6c84 100644 --- a/src/ztrm.fugr.ztrm_add_src_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_src_trkorr.abap @@ -1,31 +1,24 @@ -FUNCTION ZTRM_ADD_SRC_TRKORR. +FUNCTION ztrm_add_src_trkorr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_ERROR +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - DATA ls_data TYPE ztrm_src_trkorr. - ls_data-trkorr = iv_trkorr. - - INSERT ztrm_src_trkorr FROM ls_data. - COMMIT WORK AND WAIT. - - IF sy-subrc <> 0. - RAISE insert_error. - ENDIF. - - - - + PERFORM check_auth. + + TRY. + zcl_trm_utility=>add_source_trkorr( + EXPORTING + iv_trkorr = iv_trkorr + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_check_auth.abap b/src/ztrm.fugr.ztrm_check_auth.abap index 5e9fffa..6d883a6 100644 --- a/src/ztrm.fugr.ztrm_check_auth.abap +++ b/src/ztrm.fugr.ztrm_check_auth.abap @@ -1,16 +1,11 @@ -FUNCTION ZTRM_CHECK_AUTH. +FUNCTION ztrm_check_auth. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED *"---------------------------------------------------------------------- - - SELECT COUNT( * ) FROM ztrm_users WHERE uname = sy-uname. - - IF sy-dbcnt NE 1. + IF zcl_trm_utility=>check_functions_authorization( ) NE 'X'. RAISE trm_rfc_unauthorized. ENDIF. - - ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_create_import_tr.abap b/src/ztrm.fugr.ztrm_create_import_tr.abap index b37fe9d..575fdb9 100644 --- a/src/ztrm.fugr.ztrm_create_import_tr.abap +++ b/src/ztrm.fugr.ztrm_create_import_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_CREATE_IMPORT_TR. +FUNCTION ztrm_create_import_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -8,34 +8,22 @@ FUNCTION ZTRM_CREATE_IMPORT_TR. *" VALUE(EV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_FAILED -*" ENQUEUE_FAILED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - DATA ls_header TYPE trwbo_request_header. - CALL FUNCTION 'TR_INSERT_REQUEST_WITH_TASKS' - EXPORTING - iv_text = iv_text - iv_type = 'K' - iv_target = iv_target - IMPORTING - es_request_header = ls_header - EXCEPTIONS - insert_failed = 1 - enqueue_failed = 2. - - IF sy-subrc EQ 0. - ev_trkorr = ls_header-trkorr. - ELSEIF sy-subrc EQ 1. - RAISE insert_failed. - ELSEIF sy-subrc EQ 2. - RAISE enqueue_failed. - ENDIF. + TRY. + zcl_trm_transport=>create_workbench( + EXPORTING + iv_text = iv_text + iv_target = iv_target + RECEIVING + ro_transport = lo_transport + ). + ev_trkorr = lo_transport->get_trkorr( ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_create_package.abap b/src/ztrm.fugr.ztrm_create_package.abap index b49b56c..24b9041 100644 --- a/src/ztrm.fugr.ztrm_create_package.abap +++ b/src/ztrm.fugr.ztrm_create_package.abap @@ -1,189 +1,23 @@ -FUNCTION ZTRM_CREATE_PACKAGE. +FUNCTION ztrm_create_package. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IS_DATA) TYPE SCOMPKDTLN *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" OBJECT_ALREADY_EXISTING -*" OBJECT_JUST_CREATED -*" NOT_AUTHORIZED -*" WRONG_NAME_PREFIX -*" UNDEFINED_NAME -*" RESERVED_LOCAL_NAME -*" INVALID_PACKAGE_NAME -*" SHORT_TEXT_MISSING -*" SOFTWARE_COMPONENT_INVALID -*" LAYER_INVALID -*" AUTHOR_NOT_EXISTING -*" COMPONENT_NOT_EXISTING -*" COMPONENT_MISSING -*" PREFIX_IN_USE -*" UNEXPECTED_ERROR -*" INTERN_ERR -*" NO_ACCESS -*" INVALID_TRANSLATION_DEPTH -*" WRONG_MAINPACK_VALUE -*" SUPERPACKAGE_INVALID -*" ERROR_IN_CTS_CHECKS -*" OBJECT_INVALID -*" OBJECT_NOT_CHANGEABLE -*" CANCELLED_IN_CORR -*" PERMISSION_FAILURE -*" OBJECT_LOCKED_BY_OTHER_USER -*" OBJECT_ALREADY_CHANGEABLE -*" OBJECT_ALREADY_UNLOCKED -*" OBJECT_DELETED -*" OBJECT_MODIFIED -*" OBJECT_NOT_EXISTING +*" INVALID_INPUT +*" DYN_CALL_PARAM_NOT_FOUND +*" GENERIC *"---------------------------------------------------------------------- - - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - - DATA lo_package TYPE REF TO if_package. - cl_package_factory=>create_new_package( - EXPORTING - i_reuse_deleted_object = 'X' - i_suppress_dialog = 'X' " does not exist in 730 - IMPORTING - e_package = lo_package - CHANGING - c_package_data = is_data - EXCEPTIONS - object_already_existing = 1 - object_just_created = 2 - not_authorized = 3 - wrong_name_prefix = 4 - undefined_name = 5 - reserved_local_name = 6 - invalid_package_name = 7 - short_text_missing = 8 - software_component_invalid = 9 - layer_invalid = 10 - author_not_existing = 11 - component_not_existing = 12 - component_missing = 13 - prefix_in_use = 14 - unexpected_error = 15 - intern_err = 16 - no_access = 17 - invalid_translation_depth = 18 - wrong_mainpack_value = 19 - superpackage_invalid = 20 - error_in_cts_checks = 21 ). - - IF sy-subrc EQ 1. - RAISE object_already_existing. - ELSEIF sy-subrc EQ 2. - RAISE object_just_created. - ELSEIF sy-subrc EQ 3. - RAISE not_authorized. - ELSEIF sy-subrc EQ 4. - RAISE wrong_name_prefix. - ELSEIF sy-subrc EQ 5. - RAISE undefined_name. - ELSEIF sy-subrc EQ 6. - RAISE reserved_local_name. - ELSEIF sy-subrc EQ 7. - RAISE invalid_package_name. - ELSEIF sy-subrc EQ 8. - RAISE short_text_missing. - ELSEIF sy-subrc EQ 9. - RAISE software_component_invalid. - ELSEIF sy-subrc EQ 10. - RAISE layer_invalid. - ELSEIF sy-subrc EQ 11. - RAISE author_not_existing. - ELSEIF sy-subrc EQ 12. - RAISE component_not_existing. - ELSEIF sy-subrc EQ 13. - RAISE component_missing. - ELSEIF sy-subrc EQ 14. - RAISE prefix_in_use. - ELSEIF sy-subrc EQ 15. - RAISE unexpected_error. - ELSEIF sy-subrc EQ 16. - RAISE intern_err. - ELSEIF sy-subrc EQ 17. - RAISE no_access. - ELSEIF sy-subrc EQ 18. - RAISE invalid_translation_depth. - ELSEIF sy-subrc EQ 19. - RAISE wrong_mainpack_value. - ELSEIF sy-subrc EQ 20. - RAISE superpackage_invalid. - ELSEIF sy-subrc EQ 21. - RAISE error_in_cts_checks. - ENDIF. - - lo_package->save( - EXPORTING - i_suppress_dialog = 'X' - i_suppress_corr_insert = 'X' - EXCEPTIONS - object_invalid = 1 - object_not_changeable = 2 - cancelled_in_corr = 3 - permission_failure = 4 - unexpected_error = 5 - intern_err = 6 ). - - IF sy-subrc EQ 1. - RAISE object_invalid. - ELSEIF sy-subrc EQ 2. - RAISE object_not_changeable. - ELSEIF sy-subrc EQ 3. - RAISE cancelled_in_corr. - ELSEIF sy-subrc EQ 4. - RAISE permission_failure. - ELSEIF sy-subrc EQ 5. - RAISE unexpected_error. - ELSEIF sy-subrc EQ 6. - RAISE intern_err. - ENDIF. - - lo_package->set_changeable( - EXPORTING - i_changeable = ' ' - i_suppress_dialog = 'X' - EXCEPTIONS - object_locked_by_other_user = 1 - permission_failure = 2 - object_already_changeable = 3 - object_already_unlocked = 4 - object_just_created = 5 - object_deleted = 6 - object_modified = 7 - object_not_existing = 8 - object_invalid = 9 - unexpected_error = 10 ). - - IF sy-subrc EQ 1. - RAISE object_locked_by_other_user. - ELSEIF sy-subrc EQ 2. - RAISE permission_failure. - ELSEIF sy-subrc EQ 3. - RAISE object_already_changeable. - ELSEIF sy-subrc EQ 4. - RAISE object_already_unlocked. - ELSEIF sy-subrc EQ 5. - RAISE object_just_created. - ELSEIF sy-subrc EQ 6. - RAISE object_deleted. - ELSEIF sy-subrc EQ 7. - RAISE object_modified. - ELSEIF sy-subrc EQ 8. - RAISE object_not_existing. - ELSEIF sy-subrc EQ 9. - RAISE object_invalid. - ELSEIF sy-subrc EQ 10. - RAISE unexpected_error. - ENDIF. + PERFORM check_auth. + + TRY. + zcl_trm_package=>create( + EXPORTING + is_data = is_data + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_create_toc.abap b/src/ztrm.fugr.ztrm_create_toc.abap index 7fca3a4..30ac78c 100644 --- a/src/ztrm.fugr.ztrm_create_toc.abap +++ b/src/ztrm.fugr.ztrm_create_toc.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_CREATE_TOC. +FUNCTION ztrm_create_toc. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -8,34 +8,22 @@ FUNCTION ZTRM_CREATE_TOC. *" VALUE(EV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_FAILED -*" ENQUEUE_FAILED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - DATA ls_header TYPE trwbo_request_header. - CALL FUNCTION 'TR_INSERT_REQUEST_WITH_TASKS' - EXPORTING - iv_text = iv_text - iv_type = 'T' - iv_target = iv_target - IMPORTING - es_request_header = ls_header - EXCEPTIONS - insert_failed = 1 - enqueue_failed = 2. - - IF sy-subrc EQ 0. - ev_trkorr = ls_header-trkorr. - ELSEIF sy-subrc EQ 1. - RAISE insert_failed. - ELSEIF sy-subrc EQ 2. - RAISE enqueue_failed. - ENDIF. + TRY. + zcl_trm_transport=>create_transport_of_copies( + EXPORTING + iv_text = iv_text + iv_target = iv_target + RECEIVING + ro_transport = lo_transport + ). + ev_trkorr = lo_transport->get_trkorr( ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_delete_transport.abap b/src/ztrm.fugr.ztrm_delete_transport.abap index 4983eb8..a65a0ae 100644 --- a/src/ztrm.fugr.ztrm_delete_transport.abap +++ b/src/ztrm.fugr.ztrm_delete_transport.abap @@ -1,89 +1,20 @@ -FUNCTION ZTRM_DELETE_TRANSPORT. +FUNCTION ztrm_delete_transport. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" FILE_ACCESS_ERROR -*" ORDER_ALREADY_RELEASED -*" ORDER_CONTAINS_C_MEMBER -*" ORDER_CONTAINS_LOCKED_ENTRIES -*" ORDER_IS_REFERED -*" REPAIR_ORDER -*" USER_NOT_OWNER -*" DELETE_WAS_CANCELLED -*" ORDERNUMBER_EMPTY -*" TR_ENQUEUE_FAILED -*" OBJECTS_FREE_BUT_STILL_LOCKS -*" ORDER_LOCK_FAILED -*" NO_AUTHORIZATION -*" WRONG_CLIENT -*" PROJECT_STILL_REFERENCED -*" SUCCESSORS_ALREADY_RELEASED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - CALL FUNCTION 'TR_DELETE_COMM' - EXPORTING - wi_dialog = ' ' - wi_trkorr = iv_trkorr - EXCEPTIONS - file_access_error = 1 - order_already_released = 2 - order_contains_c_member = 3 - order_contains_locked_entries = 4 - order_is_refered = 5 - repair_order = 6 - user_not_owner = 7 - delete_was_cancelled = 8 - ordernumber_empty = 9 - tr_enqueue_failed = 10 - objects_free_but_still_locks = 11 - order_lock_failed = 12 - no_authorization = 13 - wrong_client = 14 - project_still_referenced = 15 - successors_already_released = 16. - - IF sy-subrc EQ 1. - RAISE file_access_error. - ELSEIF sy-subrc EQ 2. - RAISE order_already_released. - ELSEIF sy-subrc EQ 3. - RAISE order_contains_c_member. - ELSEIF sy-subrc EQ 4. - RAISE order_contains_locked_entries. - ELSEIF sy-subrc EQ 5. - RAISE order_is_refered. - ELSEIF sy-subrc EQ 6. - RAISE repair_order. - ELSEIF sy-subrc EQ 7. - RAISE user_not_owner. - ELSEIF sy-subrc EQ 8. - RAISE delete_was_cancelled. - ELSEIF sy-subrc EQ 9. - RAISE ordernumber_empty. - ELSEIF sy-subrc EQ 10. - RAISE tr_enqueue_failed. - ELSEIF sy-subrc EQ 11. - RAISE objects_free_but_still_locks. - ELSEIF sy-subrc EQ 12. - RAISE order_lock_failed. - ELSEIF sy-subrc EQ 13. - RAISE no_authorization. - ELSEIF sy-subrc EQ 14. - RAISE wrong_client. - ELSEIF sy-subrc EQ 15. - RAISE project_still_referenced. - ELSEIF sy-subrc EQ 16. - RAISE successors_already_released. - ENDIF. + PERFORM check_auth. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->delete( ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_dequeue_tr.abap b/src/ztrm.fugr.ztrm_dequeue_tr.abap index b960f5f..14458b8 100644 --- a/src/ztrm.fugr.ztrm_dequeue_tr.abap +++ b/src/ztrm.fugr.ztrm_dequeue_tr.abap @@ -1,20 +1,21 @@ -FUNCTION ZTRM_DEQUEUE_TR. +FUNCTION ztrm_dequeue_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - CALL FUNCTION 'DEQUEUE_E_TRKORR' - EXPORTING - trkorr = iv_trkorr. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->dequeue( ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_forward_tr.abap b/src/ztrm.fugr.ztrm_forward_tr.abap index 1c1f71b..d93c5e2 100644 --- a/src/ztrm.fugr.ztrm_forward_tr.abap +++ b/src/ztrm.fugr.ztrm_forward_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_FORWARD_TR. +FUNCTION ztrm_forward_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -8,34 +8,21 @@ FUNCTION ZTRM_FORWARD_TR. *" VALUE(IV_IMPORT_AGAIN) TYPE FLAG DEFAULT 'X' *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" READ_CONFIG_FAILED -*" TABLE_OF_REQUESTS_IS_EMPTY -*" ERROR_MESSAGE +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - CALL FUNCTION 'TMS_MGR_FORWARD_TR_REQUEST' - EXPORTING - iv_request = iv_trkorr - iv_target = iv_target - iv_source = iv_source - iv_import_again = iv_import_again - EXCEPTIONS - read_config_failed = 1 - table_of_requests_is_empty = 2 - error_message = 3. - - IF sy-subrc EQ 1. - RAISE read_config_failed. - ELSEIF sy-subrc EQ 2. - RAISE table_of_requests_is_empty. - ELSEIF sy-subrc EQ 3. - RAISE error_message. - ENDIF. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->forward( + EXPORTING + iv_target = iv_target + iv_source = iv_source + iv_import_again = iv_import_again + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_binary_file.abap b/src/ztrm.fugr.ztrm_get_binary_file.abap index 9be2928..f25bfbc 100644 --- a/src/ztrm.fugr.ztrm_get_binary_file.abap +++ b/src/ztrm.fugr.ztrm_get_binary_file.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_GET_BINARY_FILE. +FUNCTION ztrm_get_binary_file. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -7,17 +7,20 @@ FUNCTION ZTRM_GET_BINARY_FILE. *" VALUE(EV_FILE) TYPE XSTRING *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - OPEN DATASET iv_file_path FOR INPUT IN BINARY MODE. - READ DATASET iv_file_path INTO ev_file. - CLOSE DATASET iv_file_path. + PERFORM check_auth. + TRY. + zcl_trm_utility=>get_binary_file( + EXPORTING + iv_file_path = iv_file_path + IMPORTING + ev_file = ev_file + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_devclass_objs.abap b/src/ztrm.fugr.ztrm_get_devclass_objs.abap index be7a6f1..f39269c 100644 --- a/src/ztrm.fugr.ztrm_get_devclass_objs.abap +++ b/src/ztrm.fugr.ztrm_get_devclass_objs.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_GET_DEVCLASS_OBJS. +FUNCTION ztrm_get_devclass_objs. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -7,30 +7,19 @@ FUNCTION ZTRM_GET_DEVCLASS_OBJS. *" VALUE(ET_TADIR) TYPE SCTS_TADIR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" CANCELLED_BY_USER *" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - CALL FUNCTION 'TRINT_SELECT_OBJECTS' - EXPORTING - iv_devclass = iv_devclass - iv_via_selscreen = ' ' - IMPORTING - et_objects_tadir = et_tadir - EXCEPTIONS - cancelled_by_user = 1 - invalid_input = 2. - - IF sy-subrc EQ 1. - RAISE cancelled_by_user. - ELSEIF sy-subrc EQ 2. - RAISE invalid_input. - ENDIF. + TRY. + CREATE OBJECT lo_package EXPORTING iv_devclass = iv_devclass. + lo_package->get_objects( + IMPORTING + et_tadir = et_tadir + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_dir_trans.abap b/src/ztrm.fugr.ztrm_get_dir_trans.abap index 63a2678..a4adb35 100644 --- a/src/ztrm.fugr.ztrm_get_dir_trans.abap +++ b/src/ztrm.fugr.ztrm_get_dir_trans.abap @@ -1,30 +1,22 @@ -FUNCTION ZTRM_GET_DIR_TRANS. +FUNCTION ztrm_get_dir_trans. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXPORTING *" VALUE(EV_DIR_TRANS) TYPE PFEVALUE *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" NOT_FOUND +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - DATA lv_param_name TYPE pfeparname. - lv_param_name = 'DIR_TRANS'. - - CALL FUNCTION 'SXPG_PROFILE_PARAMETER_GET' - EXPORTING - parameter_name = lv_param_name - IMPORTING - parameter_value = ev_dir_trans. - - IF lv_param_name IS INITIAL. - RAISE not_found. - ENDIF. + TRY. + zcl_trm_utility=>get_dir_trans( + IMPORTING + ev_dir_trans = ev_dir_trans + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_file_sys.abap b/src/ztrm.fugr.ztrm_get_file_sys.abap index 4be43d4..0e16785 100644 --- a/src/ztrm.fugr.ztrm_get_file_sys.abap +++ b/src/ztrm.fugr.ztrm_get_file_sys.abap @@ -1,22 +1,23 @@ -FUNCTION ZTRM_GET_FILE_SYS. +FUNCTION ztrm_get_file_sys. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXPORTING *" VALUE(EV_FILE_SYS) TYPE FILESYS *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT *" NOT_FOUND +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. + TRY. + zcl_trm_utility=>get_file_sys( + IMPORTING + ev_file_sys = ev_file_sys + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. - SELECT SINGLE filesys INTO ev_file_sys FROM opsystem WHERE opsys = sy-opsys. - IF sy-subrc NE 0. - RAISE not_found. - ENDIF. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap b/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap index 13a1aab..471fb80 100644 --- a/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap +++ b/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_GET_OBJ_LOCK_TR. +FUNCTION ztrm_get_obj_lock_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -9,27 +9,23 @@ FUNCTION ZTRM_GET_OBJ_LOCK_TR. *" VALUE(EV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - DATA ls_e070 TYPE e070. - SELECT SINGLE e070~trkorr e070~strkorr - FROM e071 - INNER JOIN e070 ON e070~trkorr = e071~trkorr - INTO CORRESPONDING FIELDS OF ls_e070 - WHERE e071~pgmid EQ iv_pgmid AND e071~object EQ iv_object AND e071~obj_name EQ iv_obj_name - AND ( e070~trfunction EQ 'K' OR e070~trfunction EQ 'S' OR e070~trfunction EQ 'R' ) - AND e070~trstatus EQ 'D'. - - IF ls_e070-strkorr IS NOT INITIAL. - ev_trkorr = ls_e070-strkorr. - ELSE. - ev_trkorr = ls_e070-trkorr. - ENDIF. + TRY. + zcl_trm_transport=>find_object_lock( + EXPORTING + iv_pgmid = iv_pgmid + iv_object = iv_object + iv_obj_name = iv_obj_name + RECEIVING + ro_transport = lo_transport + ). + ev_trkorr = lo_transport->get_trkorr( ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_r3trans_info.abap b/src/ztrm.fugr.ztrm_get_r3trans_info.abap new file mode 100644 index 0000000..1bf911f --- /dev/null +++ b/src/ztrm.fugr.ztrm_get_r3trans_info.abap @@ -0,0 +1,19 @@ +FUNCTION ztrm_get_r3trans_info. +*"---------------------------------------------------------------------- +*"*"Local Interface: +*" EXPORTING +*" VALUE(EV_LOG) TYPE STRING +*" EXCEPTIONS +*" TRM_RFC_UNAUTHORIZED +*" R3TRANS_CMD_ERROR +*" GENERIC +*"---------------------------------------------------------------------- + PERFORM check_auth. + + TRY. + ev_log = zcl_trm_utility=>get_r3trans_info( ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. + +ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_transport_layer.abap b/src/ztrm.fugr.ztrm_get_transport_layer.abap index 6a8c168..1efd85f 100644 --- a/src/ztrm.fugr.ztrm_get_transport_layer.abap +++ b/src/ztrm.fugr.ztrm_get_transport_layer.abap @@ -1,38 +1,22 @@ -FUNCTION ZTRM_GET_TRANSPORT_LAYER. +FUNCTION ztrm_get_transport_layer. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXPORTING *" VALUE(EV_LAYER) TYPE DEVLAYER *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" WRONG_CALL *" INVALID_INPUT -*" CTS_INITIALIZATION_FAILURE +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - CALL FUNCTION 'TR_GET_TRANSPORT_TARGET' - EXPORTING - iv_use_default = abap_true - iv_get_layer_only = abap_true - IMPORTING - ev_layer = ev_layer - EXCEPTIONS - wrong_call = 1 - invalid_input = 2 - cts_initialization_failure = 3. - - IF sy-subrc EQ 1. - RAISE wrong_call. - ELSEIF sy-subrc EQ 2. - RAISE invalid_input. - ELSEIF sy-subrc EQ 3. - RAISE cts_initialization_failure. - ENDIF. + TRY. + zcl_trm_utility=>get_default_transport_layer( + IMPORTING + ev_layer = ev_layer + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_import_tr.abap b/src/ztrm.fugr.ztrm_import_tr.abap index 90b8639..901abb6 100644 --- a/src/ztrm.fugr.ztrm_import_tr.abap +++ b/src/ztrm.fugr.ztrm_import_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_IMPORT_TR. +FUNCTION ztrm_import_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -6,46 +6,19 @@ FUNCTION ZTRM_IMPORT_TR. *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" READ_CONFIG_FAILED -*" TABLE_OF_REQUESTS_IS_EMPTY -*" ERROR_MESSAGE +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - CALL FUNCTION 'TMS_MGR_IMPORT_TR_REQUEST' - EXPORTING - iv_system = iv_system - iv_request = iv_trkorr - iv_ctc_active = ' ' - iv_overtake = 'X' - iv_import_again = 'X' - iv_ignore_originality = 'X' - iv_ignore_repairs = 'X' - iv_ignore_transtype = 'X' - iv_ignore_tabletype = 'X' - iv_ignore_predec = 'X' - iv_ignore_cvers = 'X' - iv_test_import = ' ' - iv_subset = 'X' - iv_offline = 'X' - iv_monitor = 'X' - iv_verbose = ' ' - EXCEPTIONS - read_config_failed = 1 - table_of_requests_is_empty = 2 - error_message = 3. - - IF sy-subrc EQ 1. - RAISE read_config_failed. - ELSEIF sy-subrc EQ 2. - RAISE table_of_requests_is_empty. - ELSEIF sy-subrc EQ 3. - RAISE error_message. - ENDIF. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->import( + EXPORTING + iv_system = iv_system + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_list_object_types.abap b/src/ztrm.fugr.ztrm_list_object_types.abap index d098845..433ab85 100644 --- a/src/ztrm.fugr.ztrm_list_object_types.abap +++ b/src/ztrm.fugr.ztrm_list_object_types.abap @@ -1,23 +1,22 @@ -FUNCTION ZTRM_LIST_OBJECT_TYPES. +FUNCTION ztrm_list_object_types. *"---------------------------------------------------------------------- *"*"Local Interface: *" TABLES *" ET_OBJECT_TEXT STRUCTURE KO100 *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - CLEAR et_object_text. - CALL FUNCTION 'TR_OBJECT_TABLE' - TABLES - wt_object_text = et_object_text. - + PERFORM check_auth. + TRY. + zcl_trm_utility=>get_supported_object_types( + IMPORTING + et_object_text = et_object_text[] + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_ping.abap b/src/ztrm.fugr.ztrm_ping.abap index e51f35c..a8315a7 100644 --- a/src/ztrm.fugr.ztrm_ping.abap +++ b/src/ztrm.fugr.ztrm_ping.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_PING. +FUNCTION ztrm_ping. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXPORTING @@ -6,12 +6,7 @@ FUNCTION ZTRM_PING. *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. ev_return = 'PONG'. diff --git a/src/ztrm.fugr.ztrm_read_tms_queue.abap b/src/ztrm.fugr.ztrm_read_tms_queue.abap index 742f973..b22f75f 100644 --- a/src/ztrm.fugr.ztrm_read_tms_queue.abap +++ b/src/ztrm.fugr.ztrm_read_tms_queue.abap @@ -7,55 +7,21 @@ FUNCTION ztrm_read_tms_queue. *" VALUE(ET_REQUESTS) TYPE TMSIQREQS *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" READ_QUEUE_FAILED +*" INVALID_INPUT *" TMS_ALERT +*" GENERIC *"---------------------------------------------------------------------- - DATA: ls_bufcnt TYPE tmsbufcnt, - ls_alog TYPE tmsalog. + PERFORM check_auth. - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - " 03072024 avoid display alert - sy-batch = 'X'. - - CALL FUNCTION 'TMS_UIQ_IQD_READ_QUEUE' - EXPORTING - iv_system = iv_target - iv_collect = 'X' - iv_read_shadow = 'X' - IMPORTING - et_requests = et_requests - es_bufcnt = ls_bufcnt - EXCEPTIONS - read_queue_failed = 1. - - IF sy-subrc EQ 1. - RAISE read_queue_failed. - ENDIF. - - IF ls_bufcnt-alertid IS NOT INITIAL. - CALL FUNCTION 'TMS_ALT_ANALYSE_ALERT' + TRY. + zcl_trm_transport=>read_queue( EXPORTING - iv_alert_id = ls_bufcnt-alertid - iv_no_display = 'X' + iv_target = iv_target IMPORTING - es_alog = ls_alog - EXCEPTIONS - alert = 1 - error_message = 2 - OTHERS = 3. - IF ls_alog-msgty EQ 'E' OR ls_alog-msgty EQ 'A'. - MESSAGE ID ls_alog-msgid - TYPE ls_alog-msgty - NUMBER ls_alog-msgno - WITH ls_alog-msgv1 ls_alog-msgv2 ls_alog-msgv3 ls_alog-msgv4 - RAISING tms_alert. - ENDIF. - ENDIF. + et_requests = et_requests + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_release_tr.abap b/src/ztrm.fugr.ztrm_release_tr.abap index 0599563..3898736 100644 --- a/src/ztrm.fugr.ztrm_release_tr.abap +++ b/src/ztrm.fugr.ztrm_release_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_RELEASE_TR. +FUNCTION ztrm_release_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -8,100 +8,21 @@ FUNCTION ZTRM_RELEASE_TR. *" VALUE(ET_MESSAGES) TYPE CTSGERRMSGS *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" CTS_INITIALIZATION_FAILURE -*" ENQUEUE_FAILED -*" NO_AUTHORIZATION -*" INVALID_REQUEST -*" REQUEST_ALREADY_RELEASED -*" REPEAT_TOO_EARLY -*" OBJECT_LOCK_ERROR -*" OBJECT_CHECK_ERROR -*" DOCU_MISSING -*" DB_ACCESS_ERROR -*" ACTION_ABORTED_BY_USER -*" EXPORT_FAILED -*" EXECUTE_OBJECTS_CHECK -*" RELEASE_IN_BG_MODE -*" RELEASE_IN_BG_MODE_W_OBJCHK -*" ERROR_IN_EXPORT_METHODS -*" OBJECT_LANG_ERROR +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - DATA lv_without_lock TYPE flag. - IF iv_lock EQ 'X'. - lv_without_lock = ' '. - ELSE. - lv_without_lock = 'X'. - ENDIF. - - CALL FUNCTION 'TRINT_RELEASE_REQUEST' - EXPORTING - iv_trkorr = iv_trkorr - iv_dialog = ' ' - iv_success_message = ' ' - iv_display_export_log = ' ' - iv_without_objects_check = 'X' - iv_without_locking = lv_without_lock - EXCEPTIONS - cts_initialization_failure = 1 - enqueue_failed = 2 - no_authorization = 3 - invalid_request = 4 - request_already_released = 5 - repeat_too_early = 6 - object_lock_error = 7 - object_check_error = 8 - docu_missing = 9 - db_access_error = 10 - action_aborted_by_user = 11 - export_failed = 12 - execute_objects_check = 13 - release_in_bg_mode = 14 - release_in_bg_mode_w_objchk = 15 - error_in_export_methods = 16 - object_lang_error = 17. - - IF sy-subrc EQ 1. - RAISE cts_initialization_failure. - ELSEIF sy-subrc EQ 2. - RAISE enqueue_failed. - ELSEIF sy-subrc EQ 3. - RAISE no_authorization. - ELSEIF sy-subrc EQ 4. - RAISE invalid_request. - ELSEIF sy-subrc EQ 5. - RAISE request_already_released. - ELSEIF sy-subrc EQ 6. - RAISE repeat_too_early. - ELSEIF sy-subrc EQ 7. - RAISE object_lock_error. - ELSEIF sy-subrc EQ 8. - RAISE object_check_error. - ELSEIF sy-subrc EQ 9. - RAISE docu_missing. - ELSEIF sy-subrc EQ 10. - RAISE db_access_error. - ELSEIF sy-subrc EQ 11. - RAISE action_aborted_by_user. - ELSEIF sy-subrc EQ 12. - RAISE export_failed. - ELSEIF sy-subrc EQ 13. - RAISE execute_objects_check. - ELSEIF sy-subrc EQ 14. - RAISE release_in_bg_mode. - ELSEIF sy-subrc EQ 15. - RAISE release_in_bg_mode_w_objchk. - ELSEIF sy-subrc EQ 16. - RAISE error_in_export_methods. - ELSEIF sy-subrc EQ 17. - RAISE object_lang_error. - ENDIF. + PERFORM check_auth. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->release( + EXPORTING + iv_lock = iv_lock + IMPORTING + et_messages = et_messages + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_rename_transport_request.abap b/src/ztrm.fugr.ztrm_rename_transport_request.abap index eb32e06..d3fc32a 100644 --- a/src/ztrm.fugr.ztrm_rename_transport_request.abap +++ b/src/ztrm.fugr.ztrm_rename_transport_request.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_RENAME_TRANSPORT_REQUEST. +FUNCTION ztrm_rename_transport_request. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -6,82 +6,21 @@ FUNCTION ZTRM_RENAME_TRANSPORT_REQUEST. *" VALUE(IV_AS4TEXT) TYPE AS4TEXT *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" UPDATE_FAILED +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - - CALL FUNCTION 'ENQUEUE_E_TRKORR' - EXPORTING - trkorr = iv_trkorr. - IF sy-subrc <> 0. - RAISE update_failed. - ENDIF. - - "LSTR6F02 - e070_update - DATA: ls_e070 LIKE e070, - ls_e070c LIKE e070c, - ls_e07t LIKE e07t. - DATA: lv_msgtext1 LIKE sy-msgv3, - lv_msgtext2 LIKE sy-msgv3, - lv_msgtext3 LIKE sy-msgv3. - - SELECT SINGLE * INTO ls_e070 - FROM e070 - WHERE trkorr = iv_trkorr. - SELECT SINGLE * INTO ls_e070c "read additional fields - note 2231381 - FROM e070c - WHERE trkorr = iv_trkorr. - - ls_e07t-trkorr = iv_trkorr. - ls_e07t-langu = sy-langu. - ls_e07t-as4text = iv_as4text. - - - CALL FUNCTION 'TRINT_UPDATE_COMM_HEADER' - EXPORTING - wi_e070 = ls_e070 - wi_e07t = ls_e07t - wi_save_user = ' ' - wi_sel_e070 = 'X' - wi_sel_e07t = 'X' - wi_user = sy-uname - wi_e070c = ls_e070c - wi_sel_e070c = 'X' - IMPORTING - we_e070 = ls_e070 - we_e070c = ls_e070c - EXCEPTIONS - e070_update_error = 01 - e07t_update_error = 02 - e070c_update_error = 03. - - IF sy-subrc <> 0. - CALL FUNCTION 'DEQUEUE_E_TRKORR' + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->rename( EXPORTING - trkorr = iv_trkorr. - RAISE update_failed. - ENDIF. - - lv_msgtext1 = ls_e070-trkorr. - lv_msgtext2 = sy-uname. - lv_msgtext3 = ' '. - - CALL FUNCTION 'TRINT_APPEND_COMM_SYSLOG_ENTRY' - EXPORTING - wi_msgid = 'TR' - wi_msgno = '018' - wi_msgv2 = lv_msgtext1 - wi_msgv3 = lv_msgtext2 - wi_msgv4 = lv_msgtext3 - wi_new_order = ' ' - wi_trfunction = ls_e070-trfunction - wi_trkorr = ls_e070-trkorr. - + iv_as4text = iv_as4text + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_set_install_devc.abap b/src/ztrm.fugr.ztrm_set_install_devc.abap index 9f1a9fd..8047b82 100644 --- a/src/ztrm.fugr.ztrm_set_install_devc.abap +++ b/src/ztrm.fugr.ztrm_set_install_devc.abap @@ -1,25 +1,24 @@ -FUNCTION ZTRM_SET_INSTALL_DEVC. +FUNCTION ztrm_set_install_devc. *"---------------------------------------------------------------------- *"*"Local Interface: *" TABLES *" IT_INSTALLDEVC STRUCTURE ZTRM_INSTALLDEVC *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - DATA ls_installdevc LIKE LINE OF it_installdevc. - LOOP AT it_installdevc INTO ls_installdevc. - MODIFY ztrm_installdevc FROM ls_installdevc. - ENDLOOP. - - COMMIT WORK AND WAIT. - + PERFORM check_auth. + TRY. + zcl_trm_utility=>add_install_devclass( + EXPORTING + it_installdevc = it_installdevc[] + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_set_integrity.abap b/src/ztrm.fugr.ztrm_set_integrity.abap index 77b4a23..92683c4 100644 --- a/src/ztrm.fugr.ztrm_set_integrity.abap +++ b/src/ztrm.fugr.ztrm_set_integrity.abap @@ -1,21 +1,24 @@ -FUNCTION ZTRM_SET_INTEGRITY. +FUNCTION ztrm_set_integrity. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IS_INTEGRITY) TYPE ZTRM_INTEGRITY *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - MODIFY ztrm_integrity FROM is_integrity. - COMMIT WORK AND WAIT. - + PERFORM check_auth. + TRY. + zcl_trm_utility=>add_package_integrity( + EXPORTING + is_integrity = is_integrity + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_set_transport_doc.abap b/src/ztrm.fugr.ztrm_set_transport_doc.abap index 98eb2f5..844b440 100644 --- a/src/ztrm.fugr.ztrm_set_transport_doc.abap +++ b/src/ztrm.fugr.ztrm_set_transport_doc.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_SET_TRANSPORT_DOC. +FUNCTION ztrm_set_transport_doc. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -7,26 +7,21 @@ FUNCTION ZTRM_SET_TRANSPORT_DOC. *" IT_DOC STRUCTURE TLINE *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" ERROR +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - CALL FUNCTION 'TRINT_DOCU_INTERFACE' - EXPORTING - iv_object = iv_trkorr - iv_action = 'M' - iv_modify_appending = '' - TABLES - tt_line = it_doc. - - IF sy-subrc <> 0. - RAISE error. - ENDIF. + PERFORM check_auth. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->set_documentation( + EXPORTING + it_doc = it_doc[] + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_tadir_interface.abap b/src/ztrm.fugr.ztrm_tadir_interface.abap index b6905f4..9fa6dd5 100644 --- a/src/ztrm.fugr.ztrm_tadir_interface.abap +++ b/src/ztrm.fugr.ztrm_tadir_interface.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_TADIR_INTERFACE. +FUNCTION ztrm_tadir_interface. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -11,123 +11,24 @@ FUNCTION ZTRM_TADIR_INTERFACE. *" VALUE(IV_SET_GENFLAG) TYPE GENFLAG OPTIONAL *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" TADIR_ENTRY_NOT_EXISTING -*" TADIR_ENTRY_ILL_TYPE -*" NO_SYSTEMNAME -*" NO_SYSTEMTYPE -*" ORIGINAL_SYSTEM_CONFLICT -*" OBJECT_RESERVED_FOR_DEVCLASS -*" OBJECT_EXISTS_GLOBAL -*" OBJECT_EXISTS_LOCAL -*" OBJECT_IS_DISTRIBUTED -*" OBJ_SPECIFICATION_NOT_UNIQUE -*" NO_AUTHORIZATION_TO_DELETE -*" DEVCLASS_NOT_EXISTING -*" SIMULTANIOUS_SET_REMOVE_REPAIR -*" ORDER_MISSING -*" NO_MODIFICATION_OF_HEAD_SYST -*" PGMID_OBJECT_NOT_ALLOWED -*" MASTERLANGUAGE_NOT_SPECIFIED -*" DEVCLASS_NOT_SPECIFIED -*" SPECIFY_OWNER_UNIQUE -*" LOC_PRIV_OBJS_NO_REPAIR -*" GTADIR_NOT_REACHED -*" OBJECT_LOCKED_FOR_ORDER -*" CHANGE_OF_CLASS_NOT_ALLOWED -*" NO_CHANGE_FROM_SAP_TO_TMP +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. - CALL FUNCTION 'TR_TADIR_INTERFACE' - EXPORTING - wi_test_modus = ' ' - wi_tadir_pgmid = iv_pgmid - wi_tadir_object = iv_object - wi_tadir_obj_name = iv_obj_name - wi_tadir_devclass = iv_devclass - wi_tadir_srcsystem = iv_srcsystem - wi_tadir_author = iv_author - wi_set_genflag = iv_set_genflag -* iv_no_pak_check = 'X' - 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. - - IF sy-subrc EQ 1. - RAISE tadir_entry_not_existing. - ELSEIF sy-subrc EQ 2. - RAISE tadir_entry_ill_type. - ELSEIF sy-subrc EQ 3. - RAISE no_systemname. - ELSEIF sy-subrc EQ 4. - RAISE no_systemtype. - ELSEIF sy-subrc EQ 5. - RAISE original_system_conflict. - ELSEIF sy-subrc EQ 6. - RAISE object_reserved_for_devclass. - ELSEIF sy-subrc EQ 7. - RAISE object_exists_global. - ELSEIF sy-subrc EQ 8. - RAISE object_exists_local. - ELSEIF sy-subrc EQ 9. - RAISE object_is_distributed. - ELSEIF sy-subrc EQ 10. - RAISE obj_specification_not_unique. - ELSEIF sy-subrc EQ 11. - RAISE no_authorization_to_delete. - ELSEIF sy-subrc EQ 12. - RAISE devclass_not_existing. - ELSEIF sy-subrc EQ 13. - RAISE simultanious_set_remove_repair. - ELSEIF sy-subrc EQ 14. - RAISE order_missing. - ELSEIF sy-subrc EQ 15. - RAISE no_modification_of_head_syst. - ELSEIF sy-subrc EQ 16. - RAISE pgmid_object_not_allowed. - ELSEIF sy-subrc EQ 17. - RAISE masterlanguage_not_specified. - ELSEIF sy-subrc EQ 18. - RAISE devclass_not_specified. - ELSEIF sy-subrc EQ 19. - RAISE specify_owner_unique. - ELSEIF sy-subrc EQ 20. - RAISE loc_priv_objs_no_repair. - ELSEIF sy-subrc EQ 21. - RAISE gtadir_not_reached. - ELSEIF sy-subrc EQ 22. - RAISE object_locked_for_order. - ELSEIF sy-subrc EQ 23. - RAISE change_of_class_not_allowed. - ELSEIF sy-subrc EQ 24. - RAISE no_change_from_sap_to_tmp. - ENDIF. + TRY. + zcl_trm_utility=>tadir_interface( + EXPORTING + iv_pgmid = iv_pgmid + iv_object = iv_object + iv_objname = iv_obj_name + iv_devclass = iv_devclass + iv_srcsystem = iv_srcsystem + iv_author = iv_author + iv_genflag = iv_set_genflag + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_tdevc_interface.abap b/src/ztrm.fugr.ztrm_tdevc_interface.abap index 339bda0..dae335b 100644 --- a/src/ztrm.fugr.ztrm_tdevc_interface.abap +++ b/src/ztrm.fugr.ztrm_tdevc_interface.abap @@ -1,278 +1,28 @@ -FUNCTION ZTRM_TDEVC_INTERFACE. +FUNCTION ztrm_tdevc_interface. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(IV_DEVCLASS) TYPE DEVCLASS *" VALUE(IV_PARENTCL) TYPE DEVCLASS OPTIONAL *" VALUE(IV_RM_PARENTCL) TYPE FLAG OPTIONAL +*" VALUE(IV_DEVLAYER) TYPE DEVLAYER OPTIONAL *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" FACTORY_ERROR +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - IF iv_rm_parentcl EQ 'X'. - "SAP Note 636704 - DATA: ls_modify_sign TYPE scompksign, - ls_pack_data TYPE scompkdtln, - ls_cr TYPE e070-trkorr. - ls_modify_sign-parentcl = 'X'. - ls_pack_data-devclass = iv_devclass. -* CALL FUNCTION 'PA_MAINTAIN_PACKAGE_DARK' -* EXPORTING -* i_operation = 'MODIFY' -* i_modify_data_sign = ls_modify_sign -* i_suppress_dialog = 'X' -* CHANGING -* c_package_data = ls_pack_data -* EXCEPTIONS -* OTHERS = 1. -* IF sy-subrc <> 0. -* RAISE factory_error. -* ENDIF. - PERFORM modify_package_data - USING ls_modify_sign - 'X' - CHANGING ls_cr - ls_pack_data. - ELSEIF iv_parentcl IS NOT INITIAL. - DATA lo_package TYPE REF TO if_package. - cl_package_factory=>load_package( - EXPORTING - i_package_name = iv_devclass - IMPORTING - e_package = lo_package - EXCEPTIONS - OTHERS = 1 ). - lo_package->set_changeable( - EXPORTING - i_changeable = 'X' - i_suppress_dialog = 'D' - EXCEPTIONS - object_already_changeable = 1 - object_already_unlocked = 2 - OTHERS = 3 ). - IF sy-subrc EQ 3. - RAISE factory_error. - ENDIF. - lo_package->set_super_package_name( - EXPORTING - i_super_package_name = iv_parentcl - EXCEPTIONS - OTHERS = 1 ). - IF sy-subrc <> 0. - RAISE factory_error. - ENDIF. - lo_package->save( - EXPORTING - i_suppress_dialog = 'X' - i_suppress_corr_insert = 'X' - EXCEPTIONS - OTHERS = 1 ). - IF sy-subrc <> 0. - RAISE factory_error. - ENDIF. - lo_package->set_changeable( - EXPORTING - i_changeable = 'X' - i_suppress_dialog = 'D' - EXCEPTIONS - object_already_changeable = 1 - object_already_unlocked = 2 - OTHERS = 3 ). - IF sy-subrc EQ 3. - RAISE factory_error. - ENDIF. - ENDIF. - - - + PERFORM check_auth. + + TRY. + CREATE OBJECT lo_package EXPORTING iv_devclass = iv_devclass. + lo_package->interface( + EXPORTING + iv_parentcl = iv_parentcl + iv_rm_parentcl = iv_rm_parentcl + iv_devlayer = iv_devlayer + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. - -FORM modify_package_data - USING p_package_data_sign TYPE scompksign - p_suppress_dialog TYPE flag - CHANGING p_transport_request TYPE e070-trkorr - p_package_data TYPE scompkdtln. - - DATA: subrc LIKE sy-subrc. - DATA: lo_package TYPE REF TO if_package. - -* load package - CALL METHOD cl_package_factory=>load_package - EXPORTING - i_package_name = p_package_data-devclass - i_force_reload = 'X' - IMPORTING - e_package = lo_package - EXCEPTIONS - object_not_existing = 1 - unexpected_error = 2 - intern_err = 3 - no_access = 4 - object_locked_and_modified = 5. -* - IF sy-subrc <> 0. - CASE sy-subrc. - WHEN 1. - RAISE package_not_existing. - WHEN 4. - RAISE no_authorization. - WHEN 5. - RAISE locked_by_other_user. - WHEN OTHERS. - RAISE internal_error. - ENDCASE. - ENDIF. - -* lock package - CALL METHOD lo_package->set_changeable - EXPORTING - i_changeable = 'X' - i_suppress_dialog = 'D' - EXCEPTIONS - object_locked_by_other_user = 1 - permission_failure = 2 - object_already_changeable = 0 "ignore it - object_already_unlocked = 4 - object_just_created = 5 - object_deleted = 6 - object_modified = 7 - object_not_existing = 8 - object_invalid = 9 - unexpected_error = 10. -* - IF sy-subrc <> 0. - CASE sy-subrc. - WHEN 1. - RAISE locked_by_other_user. - WHEN 2. - RAISE no_authorization. - WHEN OTHERS. - RAISE internal_error. - ENDCASE. - ENDIF. - -* modify package - CALL METHOD lo_package->set_all_attributes - EXPORTING - i_package_data = p_package_data - i_data_sign = p_package_data_sign - EXCEPTIONS - object_not_changeable = 1 - object_deleted = 2 - object_invalid = 3 - short_text_missing = 4 - author_not_existing = 5 - local_package = 6 - software_component_invalid = 7 - layer_invalid = 8 - korrflag_invalid = 9 - component_not_existing = 10 - component_missing = 11 - authorize_failure = 12 - prefix_in_use = 13 - unexpected_error = 14 - intern_err = 15 - wrong_mainpack_value = 16 - superpackage_invalid = 17. -* - IF sy-subrc <> 0. -* try to unlock the package, exceptions are tolerated - subrc = sy-subrc. - - CALL METHOD lo_package->set_changeable - EXPORTING - i_changeable = ' ' - EXCEPTIONS - OTHERS = 0. - - CASE subrc. - WHEN 4. - RAISE short_text_missing. - WHEN 5. - RAISE invalid_author. - WHEN 6. - RAISE invalid_transport_properties. - WHEN 7. - RAISE invalid_software_component. - WHEN 8. - RAISE invalid_transport_layer. - WHEN 9. - RAISE invalid_transport_properties. - WHEN 10. - RAISE invalid_application_component. - WHEN 11. - RAISE invalid_application_component. - WHEN 12. - RAISE no_authorization. - WHEN 16. - RAISE wrong_mainpack_value. - WHEN 17. - RAISE superpackage_invalid. - WHEN OTHERS. - RAISE internal_error. - ENDCASE. - ENDIF. " IF sy-subrc <> 0. - -* save package - CALL METHOD lo_package->save - EXPORTING - i_transport_request = p_transport_request - i_suppress_dialog = p_suppress_dialog - i_suppress_corr_insert = 'X' - IMPORTING - e_transport_request = p_transport_request - EXCEPTIONS - object_invalid = 1 - object_not_changeable = 2 - cancelled_in_corr = 3 - permission_failure = 4 - unexpected_error = 5 - intern_err = 6. -* - IF sy-subrc <> 0. -* try to undo the changes, exceptions are tolerated -* (Note: if successful, this also unlocks the package) - subrc = sy-subrc. - CALL METHOD lo_package->undo_all_changes - EXCEPTIONS - OTHERS = 0. - CASE subrc. - WHEN 3. - RAISE cancelled_in_corr. - WHEN 4. - RAISE no_authorization. - WHEN OTHERS. - RAISE internal_error. - ENDCASE. - ENDIF. - -* unlock package - CALL METHOD lo_package->set_changeable - EXPORTING - i_changeable = ' ' - i_suppress_dialog = 'D' - EXCEPTIONS - object_locked_by_other_user = 1 - permission_failure = 2 - object_already_changeable = 3 - object_already_unlocked = 0 "ignore - object_just_created = 5 - object_deleted = 6 - object_modified = 7 - object_not_existing = 8 - object_invalid = 9 - unexpected_error = 10. -* - IF sy-subrc <> 0. - RAISE internal_error. - ENDIF. -* -ENDFORM. diff --git a/src/ztrm.fugr.ztrm_tr_copy.abap b/src/ztrm.fugr.ztrm_tr_copy.abap index c870768..2288ad8 100644 --- a/src/ztrm.fugr.ztrm_tr_copy.abap +++ b/src/ztrm.fugr.ztrm_tr_copy.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_TR_COPY. +FUNCTION ztrm_tr_copy. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -7,68 +7,20 @@ FUNCTION ZTRM_TR_COPY. *" VALUE(IV_DOC) TYPE TRPARFLAG *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" DB_ACCESS_ERROR -*" TRKORR_FROM_NOT_EXIST -*" TRKORR_TO_IS_REPAIR -*" TRKORR_TO_LOCKED -*" TRKORR_TO_NOT_EXIST -*" TRKORR_TO_RELEASED -*" USER_NOT_OWNER -*" NO_AUTHORIZATION -*" WRONG_CLIENT -*" WRONG_CATEGORY -*" OBJECT_NOT_PATCHABLE +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - CALL FUNCTION 'TR_COPY_COMM' - EXPORTING - wi_dialog = ' ' - wi_trkorr_from = iv_from - wi_trkorr_to = iv_to - wi_without_documentation = iv_doc - EXCEPTIONS - db_access_error = 1 - trkorr_from_not_exist = 2 - trkorr_to_is_repair = 3 - trkorr_to_locked = 4 - trkorr_to_not_exist = 5 - trkorr_to_released = 6 - user_not_owner = 7 - no_authorization = 8 - wrong_client = 9 - wrong_category = 10 - object_not_patchable = 11. - - IF sy-subrc EQ 1. - RAISE db_access_error. - ELSEIF sy-subrc EQ 2. - RAISE trkorr_from_not_exist. - ELSEIF sy-subrc EQ 3. - RAISE trkorr_to_is_repair. - ELSEIF sy-subrc EQ 4. - RAISE trkorr_to_locked. - ELSEIF sy-subrc EQ 5. - RAISE trkorr_to_not_exist. - ELSEIF sy-subrc EQ 6. - RAISE trkorr_to_released. - ELSEIF sy-subrc EQ 7. - RAISE user_not_owner. - ELSEIF sy-subrc EQ 8. - RAISE no_authorization. - ELSEIF sy-subrc EQ 9. - RAISE wrong_client. - ELSEIF sy-subrc EQ 10. - RAISE wrong_category. - ELSEIF sy-subrc EQ 11. - RAISE object_not_patchable. - ENDIF. - + PERFORM check_auth. + TRY. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_to. + lo_transport->copy( + EXPORTING + iv_trkorr = iv_from + iv_doc = iv_doc + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_write_binary_file.abap b/src/ztrm.fugr.ztrm_write_binary_file.abap index 7aeaaf0..8ae60b4 100644 --- a/src/ztrm.fugr.ztrm_write_binary_file.abap +++ b/src/ztrm.fugr.ztrm_write_binary_file.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_WRITE_BINARY_FILE. +FUNCTION ztrm_write_binary_file. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -6,18 +6,19 @@ FUNCTION ZTRM_WRITE_BINARY_FILE. *" VALUE(IV_FILE) TYPE XSTRING *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. - - OPEN DATASET iv_file_path FOR OUTPUT IN BINARY MODE. - TRANSFER iv_file TO iv_file_path. - CLOSE DATASET iv_file_path. - + PERFORM check_auth. + TRY. + zcl_trm_utility=>write_binary_file( + EXPORTING + iv_file_path = iv_file_path + iv_file = iv_file + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm_installdevc.tabl.xml b/src/ztrm_installdevc.tabl.xml index aa35f5e..9af385f 100644 --- a/src/ztrm_installdevc.tabl.xml +++ b/src/ztrm_installdevc.tabl.xml @@ -8,7 +8,6 @@ TRANSP Devclass TRM install E - X A 1 diff --git a/src/ztrm_installdevcs.tobj.xml b/src/ztrm_installdevcs.tobj.xml deleted file mode 100644 index bc24011..0000000 --- a/src/ztrm_installdevcs.tobj.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - ZTRM_INSTALLDEVC - S - CUSY - 3 - - - E - ZTRM_INSTALLDEVC - S - Devclass TRM install - - - - ZTRM_INSTALLDEVC - S - ZTRM_INSTALLDEVC - X - X - - - - - ZTRM_INSTALLDEVC - &NC& - - - ZTRM_INSTALLDEVC - ZTRM - 1 - 0002 - X - X - - - - - diff --git a/src/ztrm_integrity.tabl.xml b/src/ztrm_integrity.tabl.xml index 877ba28..863044b 100644 --- a/src/ztrm_integrity.tabl.xml +++ b/src/ztrm_integrity.tabl.xml @@ -8,7 +8,6 @@ TRANSP Package integrity E - X A 1 diff --git a/src/ztrm_skip_trkorrs.tobj.xml b/src/ztrm_skip_trkorrs.tobj.xml deleted file mode 100644 index 09ad408..0000000 --- a/src/ztrm_skip_trkorrs.tobj.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - ZTRM_SKIP_TRKORR - S - CUSY - 3 - - - E - ZTRM_SKIP_TRKORR - S - Transports ignored by TRM - - - - ZTRM_SKIP_TRKORR - S - ZTRM_SKIP_TRKORR - X - X - - - - - ZTRM_SKIP_TRKORR - &NC& - - - ZTRM_SKIP_TRKORR - ZTRM - 1 - 0001 - X - X - - - - - diff --git a/src/ztrm_src_trkorr.tabl.xml b/src/ztrm_src_trkorr.tabl.xml index 5ab7338..1245954 100644 --- a/src/ztrm_src_trkorr.tabl.xml +++ b/src/ztrm_src_trkorr.tabl.xml @@ -8,7 +8,6 @@ TRANSP Transports from source E - X A 1 diff --git a/src/ztrm_src_trkorrs.tobj.xml b/src/ztrm_src_trkorrs.tobj.xml deleted file mode 100644 index 964559b..0000000 --- a/src/ztrm_src_trkorrs.tobj.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - ZTRM_SRC_TRKORR - S - APPL - 3 - - - E - ZTRM_SRC_TRKORR - S - Transports from source - - - - ZTRM_SRC_TRKORR - S - ZTRM_SRC_TRKORR - X - X - - - - - ZTRM_SRC_TRKORR - &NC& - - - ZTRM_SRC_TRKORR - ZTRM - 1 - 0004 - X - X - - - - - diff --git a/src/ztrm_userss.tobj.xml b/src/ztrm_userss.tobj.xml deleted file mode 100644 index a850a4f..0000000 --- a/src/ztrm_userss.tobj.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - ZTRM_USERS - S - X - APPL - 3 - - - E - ZTRM_USERS - S - TRM Authorized users - - - - ZTRM_USERS - S - ZTRM_USERS - X - X - - - - - ZTRM_USERS - &NC& - - - ZTRM_USERS - ZTRM - 1 - 0003 - X - X - - - - -