From 8f36fb77767719166e03fb3d9f8a1ebc3ef63ff7 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 11 Jul 2024 10:24:45 +0000 Subject: [PATCH 01/27] refactor check auth --- src/ztrm.fugr.lztrmf01.abap | 12 +++++++++++ src/ztrm.fugr.lztrmf01.xml | 21 +++++++++++++++++++ src/ztrm.fugr.saplztrm.abap | 1 + src/ztrm.fugr.xml | 1 + src/ztrm.fugr.ztrm_add_lang_tr.abap | 9 ++------ src/ztrm.fugr.ztrm_add_objs_tr.abap | 9 ++------ src/ztrm.fugr.ztrm_add_skip_trkorr.abap | 9 ++------ src/ztrm.fugr.ztrm_add_src_trkorr.abap | 9 ++------ src/ztrm.fugr.ztrm_check_auth.abap | 2 +- src/ztrm.fugr.ztrm_create_import_tr.abap | 9 ++------ src/ztrm.fugr.ztrm_create_package.abap | 9 ++------ src/ztrm.fugr.ztrm_create_toc.abap | 9 ++------ src/ztrm.fugr.ztrm_delete_transport.abap | 9 ++------ src/ztrm.fugr.ztrm_dequeue_tr.abap | 9 ++------ src/ztrm.fugr.ztrm_forward_tr.abap | 9 ++------ src/ztrm.fugr.ztrm_get_binary_file.abap | 9 ++------ src/ztrm.fugr.ztrm_get_devclass_objs.abap | 9 ++------ src/ztrm.fugr.ztrm_get_dir_trans.abap | 9 ++------ src/ztrm.fugr.ztrm_get_file_sys.abap | 9 ++------ src/ztrm.fugr.ztrm_get_obj_lock_tr.abap | 9 ++------ src/ztrm.fugr.ztrm_get_transport_layer.abap | 9 ++------ src/ztrm.fugr.ztrm_import_tr.abap | 9 ++------ src/ztrm.fugr.ztrm_list_object_types.abap | 9 ++------ src/ztrm.fugr.ztrm_ping.abap | 9 ++------ src/ztrm.fugr.ztrm_read_tms_queue.abap | 7 +------ src/ztrm.fugr.ztrm_release_tr.abap | 9 ++------ ...rm.fugr.ztrm_rename_transport_request.abap | 9 ++------ src/ztrm.fugr.ztrm_set_install_devc.abap | 9 ++------ src/ztrm.fugr.ztrm_set_integrity.abap | 9 ++------ src/ztrm.fugr.ztrm_set_transport_doc.abap | 9 ++------ src/ztrm.fugr.ztrm_tadir_interface.abap | 9 ++------ src/ztrm.fugr.ztrm_tdevc_interface.abap | 9 ++------ src/ztrm.fugr.ztrm_tr_copy.abap | 9 ++------ src/ztrm.fugr.ztrm_write_binary_file.abap | 9 ++------ 34 files changed, 93 insertions(+), 203 deletions(-) create mode 100644 src/ztrm.fugr.lztrmf01.abap create mode 100644 src/ztrm.fugr.lztrmf01.xml diff --git a/src/ztrm.fugr.lztrmf01.abap b/src/ztrm.fugr.lztrmf01.abap new file mode 100644 index 0000000..777803b --- /dev/null +++ b/src/ztrm.fugr.lztrmf01.abap @@ -0,0 +1,12 @@ +*&---------------------------------------------------------------------* +*& 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. diff --git a/src/ztrm.fugr.lztrmf01.xml b/src/ztrm.fugr.lztrmf01.xml new file mode 100644 index 0000000..2218071 --- /dev/null +++ b/src/ztrm.fugr.lztrmf01.xml @@ -0,0 +1,21 @@ + + + + + + LZTRMF01 + I + S + E + X + + + + R + Include LZTRMF01 + 16 + + + + + diff --git a/src/ztrm.fugr.saplztrm.abap b/src/ztrm.fugr.saplztrm.abap index aeb70b1..fe4ab25 100644 --- a/src/ztrm.fugr.saplztrm.abap +++ b/src/ztrm.fugr.saplztrm.abap @@ -47,6 +47,7 @@ * INCLUDE LZTRMP... " Local class implement. * INCLUDE LZTRMT99. " ABAP Unit tests INCLUDE LZTRMF00 . " subprograms + INCLUDE LZTRMF01 . " subprograms INCLUDE LZTRMI00 . " PAI modules INCLUDE LSVIMFXX . " subprograms INCLUDE LSVIMOXX . " PBO modules diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index 457006e..5ca093c 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -5,6 +5,7 @@ TRM Functions LZTRMF00 + LZTRMF01 LZTRMI00 LZTRMT00 LZTRMTOP diff --git a/src/ztrm.fugr.ztrm_add_lang_tr.abap b/src/ztrm.fugr.ztrm_add_lang_tr.abap index 5c63b08..a4b7cf4 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 @@ -25,12 +25,7 @@ FUNCTION ZTRM_ADD_LANG_TR. lt_date TYPE lxe_tt_date, lt_comp TYPE lxe_tt_comp. - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. IF it_devclass[] IS INITIAL. RAISE empty_devclass. diff --git a/src/ztrm.fugr.ztrm_add_objs_tr.abap b/src/ztrm.fugr.ztrm_add_objs_tr.abap index 03b0ae3..442029e 100644 --- a/src/ztrm.fugr.ztrm_add_objs_tr.abap +++ b/src/ztrm.fugr.ztrm_add_objs_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_ADD_OBJS_TR. +FUNCTION ztrm_add_objs_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -18,12 +18,7 @@ FUNCTION ZTRM_ADD_OBJS_TR. *" CANCELLED_BY_USER *" RECURSIVE_CALL *"---------------------------------------------------------------------- - 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 diff --git a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap index de8cf16..79c2534 100644 --- a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_ADD_SKIP_TRKORR. +FUNCTION ztrm_add_skip_trkorr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -7,12 +7,7 @@ FUNCTION ZTRM_ADD_SKIP_TRKORR. *" TRM_RFC_UNAUTHORIZED *" INSERT_ERROR *"---------------------------------------------------------------------- - 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. diff --git a/src/ztrm.fugr.ztrm_add_src_trkorr.abap b/src/ztrm.fugr.ztrm_add_src_trkorr.abap index 79c77c5..20f208a 100644 --- a/src/ztrm.fugr.ztrm_add_src_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_src_trkorr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_ADD_SRC_TRKORR. +FUNCTION ztrm_add_src_trkorr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -7,12 +7,7 @@ FUNCTION ZTRM_ADD_SRC_TRKORR. *" TRM_RFC_UNAUTHORIZED *" INSERT_ERROR *"---------------------------------------------------------------------- - 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_src_trkorr. ls_data-trkorr = iv_trkorr. diff --git a/src/ztrm.fugr.ztrm_check_auth.abap b/src/ztrm.fugr.ztrm_check_auth.abap index 5e9fffa..a6ce3d4 100644 --- a/src/ztrm.fugr.ztrm_check_auth.abap +++ b/src/ztrm.fugr.ztrm_check_auth.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_CHECK_AUTH. +FUNCTION ztrm_check_auth. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXCEPTIONS diff --git a/src/ztrm.fugr.ztrm_create_import_tr.abap b/src/ztrm.fugr.ztrm_create_import_tr.abap index b37fe9d..1756c2b 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 @@ -11,12 +11,7 @@ FUNCTION ZTRM_CREATE_IMPORT_TR. *" INSERT_FAILED *" ENQUEUE_FAILED *"---------------------------------------------------------------------- - 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' diff --git a/src/ztrm.fugr.ztrm_create_package.abap b/src/ztrm.fugr.ztrm_create_package.abap index b49b56c..387863d 100644 --- a/src/ztrm.fugr.ztrm_create_package.abap +++ b/src/ztrm.fugr.ztrm_create_package.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_CREATE_PACKAGE. +FUNCTION ztrm_create_package. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -38,12 +38,7 @@ FUNCTION ZTRM_CREATE_PACKAGE. *" OBJECT_NOT_EXISTING *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. DATA lo_package TYPE REF TO if_package. diff --git a/src/ztrm.fugr.ztrm_create_toc.abap b/src/ztrm.fugr.ztrm_create_toc.abap index 7fca3a4..66d746b 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 @@ -11,12 +11,7 @@ FUNCTION ZTRM_CREATE_TOC. *" INSERT_FAILED *" ENQUEUE_FAILED *"---------------------------------------------------------------------- - 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' diff --git a/src/ztrm.fugr.ztrm_delete_transport.abap b/src/ztrm.fugr.ztrm_delete_transport.abap index 4983eb8..db038b2 100644 --- a/src/ztrm.fugr.ztrm_delete_transport.abap +++ b/src/ztrm.fugr.ztrm_delete_transport.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_DELETE_TRANSPORT. +FUNCTION ztrm_delete_transport. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -22,12 +22,7 @@ FUNCTION ZTRM_DELETE_TRANSPORT. *" PROJECT_STILL_REFERENCED *" SUCCESSORS_ALREADY_RELEASED *"---------------------------------------------------------------------- - 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_DELETE_COMM' EXPORTING diff --git a/src/ztrm.fugr.ztrm_dequeue_tr.abap b/src/ztrm.fugr.ztrm_dequeue_tr.abap index b960f5f..fece244 100644 --- a/src/ztrm.fugr.ztrm_dequeue_tr.abap +++ b/src/ztrm.fugr.ztrm_dequeue_tr.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_DEQUEUE_TR. +FUNCTION ztrm_dequeue_tr. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -6,12 +6,7 @@ FUNCTION ZTRM_DEQUEUE_TR. *" 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. CALL FUNCTION 'DEQUEUE_E_TRKORR' EXPORTING diff --git a/src/ztrm.fugr.ztrm_forward_tr.abap b/src/ztrm.fugr.ztrm_forward_tr.abap index 1c1f71b..11f1e34 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 @@ -12,12 +12,7 @@ FUNCTION ZTRM_FORWARD_TR. *" TABLE_OF_REQUESTS_IS_EMPTY *" ERROR_MESSAGE *"---------------------------------------------------------------------- - 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 diff --git a/src/ztrm.fugr.ztrm_get_binary_file.abap b/src/ztrm.fugr.ztrm_get_binary_file.abap index 9be2928..42dad20 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 @@ -8,12 +8,7 @@ FUNCTION ZTRM_GET_BINARY_FILE. *" 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. OPEN DATASET iv_file_path FOR INPUT IN BINARY MODE. READ DATASET iv_file_path INTO ev_file. diff --git a/src/ztrm.fugr.ztrm_get_devclass_objs.abap b/src/ztrm.fugr.ztrm_get_devclass_objs.abap index be7a6f1..fac89f8 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 @@ -10,12 +10,7 @@ FUNCTION ZTRM_GET_DEVCLASS_OBJS. *" CANCELLED_BY_USER *" INVALID_INPUT *"---------------------------------------------------------------------- - 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 diff --git a/src/ztrm.fugr.ztrm_get_dir_trans.abap b/src/ztrm.fugr.ztrm_get_dir_trans.abap index 63a2678..4a264d7 100644 --- a/src/ztrm.fugr.ztrm_get_dir_trans.abap +++ b/src/ztrm.fugr.ztrm_get_dir_trans.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_GET_DIR_TRANS. +FUNCTION ztrm_get_dir_trans. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXPORTING @@ -7,12 +7,7 @@ FUNCTION ZTRM_GET_DIR_TRANS. *" TRM_RFC_UNAUTHORIZED *" NOT_FOUND *"---------------------------------------------------------------------- - 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'. diff --git a/src/ztrm.fugr.ztrm_get_file_sys.abap b/src/ztrm.fugr.ztrm_get_file_sys.abap index 4be43d4..c0d6606 100644 --- a/src/ztrm.fugr.ztrm_get_file_sys.abap +++ b/src/ztrm.fugr.ztrm_get_file_sys.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_GET_FILE_SYS. +FUNCTION ztrm_get_file_sys. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXPORTING @@ -7,12 +7,7 @@ FUNCTION ZTRM_GET_FILE_SYS. *" TRM_RFC_UNAUTHORIZED *" NOT_FOUND *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. SELECT SINGLE filesys INTO ev_file_sys FROM opsystem WHERE opsys = sy-opsys. diff --git a/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap b/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap index 13a1aab..edddec6 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 @@ -10,12 +10,7 @@ FUNCTION ZTRM_GET_OBJ_LOCK_TR. *" 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. DATA ls_e070 TYPE e070. SELECT SINGLE e070~trkorr e070~strkorr diff --git a/src/ztrm.fugr.ztrm_get_transport_layer.abap b/src/ztrm.fugr.ztrm_get_transport_layer.abap index 6a8c168..e362f44 100644 --- a/src/ztrm.fugr.ztrm_get_transport_layer.abap +++ b/src/ztrm.fugr.ztrm_get_transport_layer.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_GET_TRANSPORT_LAYER. +FUNCTION ztrm_get_transport_layer. *"---------------------------------------------------------------------- *"*"Local Interface: *" EXPORTING @@ -9,12 +9,7 @@ FUNCTION ZTRM_GET_TRANSPORT_LAYER. *" INVALID_INPUT *" CTS_INITIALIZATION_FAILURE *"---------------------------------------------------------------------- - 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 diff --git a/src/ztrm.fugr.ztrm_import_tr.abap b/src/ztrm.fugr.ztrm_import_tr.abap index 90b8639..4d555c1 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 @@ -10,12 +10,7 @@ FUNCTION ZTRM_IMPORT_TR. *" TABLE_OF_REQUESTS_IS_EMPTY *" ERROR_MESSAGE *"---------------------------------------------------------------------- - 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 diff --git a/src/ztrm.fugr.ztrm_list_object_types.abap b/src/ztrm.fugr.ztrm_list_object_types.abap index d098845..162bd22 100644 --- a/src/ztrm.fugr.ztrm_list_object_types.abap +++ b/src/ztrm.fugr.ztrm_list_object_types.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_LIST_OBJECT_TYPES. +FUNCTION ztrm_list_object_types. *"---------------------------------------------------------------------- *"*"Local Interface: *" TABLES @@ -6,12 +6,7 @@ FUNCTION ZTRM_LIST_OBJECT_TYPES. *" 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. CLEAR et_object_text. CALL FUNCTION 'TR_OBJECT_TABLE' 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..9215395 100644 --- a/src/ztrm.fugr.ztrm_read_tms_queue.abap +++ b/src/ztrm.fugr.ztrm_read_tms_queue.abap @@ -13,12 +13,7 @@ FUNCTION ztrm_read_tms_queue. DATA: ls_bufcnt TYPE tmsbufcnt, ls_alog TYPE tmsalog. - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. " 03072024 avoid display alert sy-batch = 'X'. diff --git a/src/ztrm.fugr.ztrm_release_tr.abap b/src/ztrm.fugr.ztrm_release_tr.abap index 0599563..a273b00 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 @@ -26,12 +26,7 @@ FUNCTION ZTRM_RELEASE_TR. *" ERROR_IN_EXPORT_METHODS *" OBJECT_LANG_ERROR *"---------------------------------------------------------------------- - 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_without_lock TYPE flag. IF iv_lock EQ 'X'. diff --git a/src/ztrm.fugr.ztrm_rename_transport_request.abap b/src/ztrm.fugr.ztrm_rename_transport_request.abap index eb32e06..b9d3c4d 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 @@ -8,12 +8,7 @@ FUNCTION ZTRM_RENAME_TRANSPORT_REQUEST. *" TRM_RFC_UNAUTHORIZED *" UPDATE_FAILED *"---------------------------------------------------------------------- - 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' diff --git a/src/ztrm.fugr.ztrm_set_install_devc.abap b/src/ztrm.fugr.ztrm_set_install_devc.abap index 9f1a9fd..ca67229 100644 --- a/src/ztrm.fugr.ztrm_set_install_devc.abap +++ b/src/ztrm.fugr.ztrm_set_install_devc.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_SET_INSTALL_DEVC. +FUNCTION ztrm_set_install_devc. *"---------------------------------------------------------------------- *"*"Local Interface: *" TABLES @@ -6,12 +6,7 @@ FUNCTION ZTRM_SET_INSTALL_DEVC. *" 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. DATA ls_installdevc LIKE LINE OF it_installdevc. LOOP AT it_installdevc INTO ls_installdevc. diff --git a/src/ztrm.fugr.ztrm_set_integrity.abap b/src/ztrm.fugr.ztrm_set_integrity.abap index 77b4a23..ea1ed39 100644 --- a/src/ztrm.fugr.ztrm_set_integrity.abap +++ b/src/ztrm.fugr.ztrm_set_integrity.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_SET_INTEGRITY. +FUNCTION ztrm_set_integrity. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -6,12 +6,7 @@ FUNCTION ZTRM_SET_INTEGRITY. *" 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. MODIFY ztrm_integrity FROM is_integrity. COMMIT WORK AND WAIT. diff --git a/src/ztrm.fugr.ztrm_set_transport_doc.abap b/src/ztrm.fugr.ztrm_set_transport_doc.abap index 98eb2f5..dde508e 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 @@ -9,12 +9,7 @@ FUNCTION ZTRM_SET_TRANSPORT_DOC. *" TRM_RFC_UNAUTHORIZED *" ERROR *"---------------------------------------------------------------------- - 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_DOCU_INTERFACE' EXPORTING diff --git a/src/ztrm.fugr.ztrm_tadir_interface.abap b/src/ztrm.fugr.ztrm_tadir_interface.abap index b6905f4..f091193 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 @@ -36,12 +36,7 @@ FUNCTION ZTRM_TADIR_INTERFACE. *" CHANGE_OF_CLASS_NOT_ALLOWED *" NO_CHANGE_FROM_SAP_TO_TMP *"---------------------------------------------------------------------- - 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 diff --git a/src/ztrm.fugr.ztrm_tdevc_interface.abap b/src/ztrm.fugr.ztrm_tdevc_interface.abap index 339bda0..131d396 100644 --- a/src/ztrm.fugr.ztrm_tdevc_interface.abap +++ b/src/ztrm.fugr.ztrm_tdevc_interface.abap @@ -1,4 +1,4 @@ -FUNCTION ZTRM_TDEVC_INTERFACE. +FUNCTION ztrm_tdevc_interface. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING @@ -9,12 +9,7 @@ FUNCTION ZTRM_TDEVC_INTERFACE. *" TRM_RFC_UNAUTHORIZED *" FACTORY_ERROR *"---------------------------------------------------------------------- - CALL FUNCTION 'ZTRM_CHECK_AUTH' - EXCEPTIONS - trm_rfc_unauthorized = 1. - IF sy-subrc EQ 1. - RAISE trm_rfc_unauthorized. - ENDIF. + PERFORM check_auth. IF iv_rm_parentcl EQ 'X'. "SAP Note 636704 diff --git a/src/ztrm.fugr.ztrm_tr_copy.abap b/src/ztrm.fugr.ztrm_tr_copy.abap index c870768..d06be82 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 @@ -19,12 +19,7 @@ FUNCTION ZTRM_TR_COPY. *" WRONG_CATEGORY *" OBJECT_NOT_PATCHABLE *"---------------------------------------------------------------------- - 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_COPY_COMM' EXPORTING diff --git a/src/ztrm.fugr.ztrm_write_binary_file.abap b/src/ztrm.fugr.ztrm_write_binary_file.abap index 7aeaaf0..49e44cf 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 @@ -7,12 +7,7 @@ FUNCTION ZTRM_WRITE_BINARY_FILE. *" 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. OPEN DATASET iv_file_path FOR OUTPUT IN BINARY MODE. TRANSFER iv_file TO iv_file_path. From 3cdc63418b3b7f669262b7174865b7ef926605c0 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 11 Jul 2024 15:56:48 +0000 Subject: [PATCH 02/27] exception class --- src/zcx_trm_exception.clas.abap | 51 +++++++++++++++++++++++++++++++++ src/zcx_trm_exception.clas.xml | 24 ++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/zcx_trm_exception.clas.abap create mode 100644 src/zcx_trm_exception.clas.xml diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap new file mode 100644 index 0000000..fb48cfd --- /dev/null +++ b/src/zcx_trm_exception.clas.abap @@ -0,0 +1,51 @@ +CLASS zcx_trm_exception DEFINITION + PUBLIC + INHERITING FROM cx_static_check + CREATE PROTECTED . + + PUBLIC SECTION. + + METHODS constructor + IMPORTING + !textid LIKE textid OPTIONAL + !previous LIKE previous OPTIONAL. + + METHODS reason + RETURNING VALUE(rv_reason) TYPE string. + + CLASS-METHODS raise + IMPORTING iv_message TYPE string + iv_reason TYPE string OPTIONAL + RAISING + zcx_trm_exception. + + PROTECTED SECTION. + DATA: gv_reason TYPE string. + PRIVATE SECTION. + +ENDCLASS. + + + +CLASS zcx_trm_exception IMPLEMENTATION. + + METHOD constructor ##ADT_SUPPRESS_GENERATION. + CALL METHOD super->constructor + EXPORTING + textid = textid + previous = previous. + ENDMETHOD. + + METHOD reason. + rv_reason = gv_reason. + ENDMETHOD. + + METHOD raise. + DATA lo_exc TYPE REF TO zcx_trm_exception. + cl_message_helper=>set_msg_vars_for_clike( iv_message ). + CREATE OBJECT lo_exc. + lo_exc->gv_reason = iv_reason. + 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 + + + + + From d2c2649ae1702100a7dc43105b7f7e47cbe976d6 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 11 Jul 2024 15:57:11 +0000 Subject: [PATCH 03/27] utility class (initial commit) --- src/zcl_trm_utility.clas.abap | 17 +++++++++++++++++ src/zcl_trm_utility.clas.xml | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/zcl_trm_utility.clas.abap create mode 100644 src/zcl_trm_utility.clas.xml diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap new file mode 100644 index 0000000..e5bfe32 --- /dev/null +++ b/src/zcl_trm_utility.clas.abap @@ -0,0 +1,17 @@ +CLASS zcl_trm_utility DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . + +PUBLIC SECTION. + +PROTECTED SECTION. +PRIVATE SECTION. +ENDCLASS. + + + +CLASS zcl_trm_utility IMPLEMENTATION. + + +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 + + + + From 8c9064557008a2b22a00cc722cd30846049c1441 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 11 Jul 2024 16:28:29 +0000 Subject: [PATCH 04/27] exception handling in fugr --- src/zcx_trm_exception.clas.abap | 27 ++++++++++++------ src/ztrm.fugr.lztrmf01.abap | 10 +++++++ src/ztrm.fugr.lztrmtop.abap | 2 ++ src/ztrm.fugr.xml | 50 +++------------------------------ 4 files changed, 35 insertions(+), 54 deletions(-) diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap index fb48cfd..aeeee67 100644 --- a/src/zcx_trm_exception.clas.abap +++ b/src/zcx_trm_exception.clas.abap @@ -5,19 +5,24 @@ CLASS zcx_trm_exception DEFINITION PUBLIC SECTION. + CONSTANTS: + BEGIN OF c_reason, + generic TYPE string VALUE 'GENERIC', + invalid_input TYPE string VALUE 'INVALID_INPUT', + END OF c_reason . + METHODS constructor IMPORTING - !textid LIKE textid OPTIONAL - !previous LIKE previous OPTIONAL. + !textid LIKE textid OPTIONAL + !previous LIKE previous OPTIONAL. METHODS reason RETURNING VALUE(rv_reason) TYPE string. CLASS-METHODS raise - IMPORTING iv_message TYPE string - iv_reason TYPE string OPTIONAL - RAISING - zcx_trm_exception. + IMPORTING iv_message TYPE string OPTIONAL + iv_reason TYPE string OPTIONAL + RAISING zcx_trm_exception. PROTECTED SECTION. DATA: gv_reason TYPE string. @@ -37,12 +42,18 @@ CLASS zcx_trm_exception IMPLEMENTATION. ENDMETHOD. METHOD reason. - rv_reason = gv_reason. + IF gv_reason IS INITIAL. + rv_reason = c_reason-generic. + ELSE. + rv_reason = gv_reason. + ENDIF. ENDMETHOD. METHOD raise. DATA lo_exc TYPE REF TO zcx_trm_exception. - cl_message_helper=>set_msg_vars_for_clike( iv_message ). + 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. RAISE EXCEPTION lo_exc. diff --git a/src/ztrm.fugr.lztrmf01.abap b/src/ztrm.fugr.lztrmf01.abap index 777803b..3802822 100644 --- a/src/ztrm.fugr.lztrmf01.abap +++ b/src/ztrm.fugr.lztrmf01.abap @@ -10,3 +10,13 @@ FORM check_auth. 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 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.lztrmtop.abap b/src/ztrm.fugr.lztrmtop.abap index 4ebc5f5..1af71c4 100644 --- a/src/ztrm.fugr.lztrmtop.abap +++ b/src/ztrm.fugr.lztrmtop.abap @@ -3,3 +3,5 @@ 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. diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index 5ca093c..421226b 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -288,28 +288,10 @@ 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 @@ -326,35 +308,11 @@ X - EMPTY_DEVCLASS - X - - - LANGUAGE_NOT_IN_CP - X - - - CREATE_REQUEST_FAILED - X - - - WRITE_TO_REQUEST_FAILED - X - - - RELEASE_REQUEST_FAILED - X - - - INVALID_REQUEST - X - - - NO_CORRECT_OBJECTS_AVAILABLE + INVALID_INPUT X - UNKNOWN + GENERIC X From 6ca839d96d78ab19b98e7fea97558721ae12798d Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 11 Jul 2024 16:28:46 +0000 Subject: [PATCH 05/27] initial refactor transports --- src/zcl_trm_transport.clas.abap | 109 +++++++++++++++++++++++++ src/zcl_trm_transport.clas.xml | 16 ++++ src/ztrm.fugr.ztrm_add_lang_tr.abap | 121 +++------------------------- 3 files changed, 136 insertions(+), 110 deletions(-) create mode 100644 src/zcl_trm_transport.clas.abap create mode 100644 src/zcl_trm_transport.clas.xml diff --git a/src/zcl_trm_transport.clas.abap b/src/zcl_trm_transport.clas.abap new file mode 100644 index 0000000..11c4673 --- /dev/null +++ b/src/zcl_trm_transport.clas.abap @@ -0,0 +1,109 @@ +CLASS zcl_trm_transport DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . + + PUBLIC SECTION. + TYPES: tyt_lxe_packg TYPE STANDARD TABLE OF lxe_tt_packg_line. + + CLASS-METHODS add_translations_to_transport + IMPORTING iv_trkorr TYPE trkorr + it_devclass TYPE tyt_lxe_packg + RAISING zcx_trm_exception. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS zcl_trm_transport IMPLEMENTATION. + + METHOD add_translations_to_transport. + 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 = 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 <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDLOOP. + 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/ztrm.fugr.ztrm_add_lang_tr.abap b/src/ztrm.fugr.ztrm_add_lang_tr.abap index a4b7cf4..776eb0e 100644 --- a/src/ztrm.fugr.ztrm_add_lang_tr.abap +++ b/src/ztrm.fugr.ztrm_add_lang_tr.abap @@ -7,117 +7,18 @@ 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. - 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 - 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. - - - - + TRY. + zcl_trm_transport=>add_translations_to_transport( + EXPORTING + iv_trkorr = iv_trkorr + it_devclass = it_devclass[] + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. From 8b84f21842abb82308fa11a2c34ee83e3e31e17b Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 11 Jul 2024 18:49:24 +0000 Subject: [PATCH 06/27] refactor OO --- src/zcl_trm_package.clas.abap | 73 ++++ src/zcl_trm_package.clas.xml | 16 + src/zcl_trm_transport.clas.abap | 117 +++++- src/zcl_trm_utility.clas.abap | 78 +++- src/zcx_trm_exception.clas.abap | 7 +- src/ztrm.fugr.lztrmf01.abap | 6 + src/ztrm.fugr.xml | 436 ++++------------------- src/ztrm.fugr.ztrm_add_lang_tr.abap | 2 +- src/ztrm.fugr.ztrm_add_objs_tr.abap | 58 +-- src/ztrm.fugr.ztrm_add_skip_trkorr.abap | 22 +- src/ztrm.fugr.ztrm_add_src_trkorr.abap | 26 +- src/ztrm.fugr.ztrm_check_auth.abap | 7 +- src/ztrm.fugr.ztrm_create_import_tr.abap | 34 +- src/ztrm.fugr.ztrm_create_package.abap | 183 +--------- src/ztrm.fugr.ztrm_create_toc.abap | 34 +- src/ztrm.fugr.ztrm_delete_transport.abap | 82 +---- 16 files changed, 450 insertions(+), 731 deletions(-) create mode 100644 src/zcl_trm_package.clas.abap create mode 100644 src/zcl_trm_package.clas.xml diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap new file mode 100644 index 0000000..e3b3a20 --- /dev/null +++ b/src/zcl_trm_package.clas.abap @@ -0,0 +1,73 @@ +CLASS zcl_trm_package DEFINITION + PUBLIC + FINAL + CREATE PUBLIC . + + PUBLIC SECTION. + + CLASS-METHODS create + IMPORTING is_data TYPE scompkdtln + RAISING zcx_trm_exception. + + PROTECTED SECTION. + PRIVATE SECTION. +ENDCLASS. + + + +CLASS zcl_trm_package IMPLEMENTATION. + + METHOD create. + DATA ls_data LIKE is_data. + DATA lo_package TYPE REF TO if_package. + MOVE is_data TO ls_data. + + TRY. + CALL METHOD ('CL_PACKAGE_FACTORY')=>('CREATE_NEW_PACKAGE') + EXPORTING + i_reuse_deleted_object = 'X' + i_suppress_dialog = 'X' + i_boh = '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. + + TRY. + CALL METHOD lo_package->('SAVE') + EXPORTING + i_suppress_dialog = 'X' + i_suppress_corr_insert = 'X' + 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. + + TRY. + CALL METHOD lo_package->('SET_CHANGEABLE') + EXPORTING + i_changeable = ' ' + i_suppress_dialog = 'X' + 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. + 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 index 11c4673..add809b 100644 --- a/src/zcl_trm_transport.clas.abap +++ b/src/zcl_trm_transport.clas.abap @@ -4,22 +4,52 @@ CLASS zcl_trm_transport DEFINITION CREATE PUBLIC . PUBLIC SECTION. - TYPES: tyt_lxe_packg TYPE STANDARD TABLE OF lxe_tt_packg_line. + 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. - CLASS-METHODS add_translations_to_transport + CLASS-METHODS add_translations IMPORTING iv_trkorr TYPE trkorr it_devclass TYPE tyt_lxe_packg RAISING zcx_trm_exception. + CLASS-METHODS add_objects + IMPORTING iv_lock TYPE flag + iv_trkorr TYPE trkorr + it_e071 TYPE tyt_e071 + EXPORTING et_log TYPE sprot_u_tab + RAISING zcx_trm_exception. + + CLASS-METHODS create_workbench + IMPORTING iv_text TYPE as4text + iv_target TYPE tr_target + EXPORTING ev_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS create_transport_of_copies + IMPORTING iv_text TYPE as4text + iv_target TYPE tr_target + EXPORTING ev_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS delete + IMPORTING iv_trkorr TYPE trkorr + 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 + EXPORTING ev_trkorr TYPE trkorr + RAISING zcx_trm_exception. ENDCLASS. CLASS zcl_trm_transport IMPLEMENTATION. - METHOD add_translations_to_transport. + 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, @@ -46,7 +76,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. OTHERS = 3. IF sy-subrc <> 0. - zcx_trm_exception=>raise( ). + zcx_trm_exception=>raise( ). ENDIF. CLEAR lo_explang. @@ -101,9 +131,86 @@ CLASS zcl_trm_transport IMPLEMENTATION. OTHERS = 6. IF sy-subrc <> 0. - zcx_trm_exception=>raise( ). + zcx_trm_exception=>raise( ). ENDIF. ENDLOOP. ENDMETHOD. + METHOD add_objects. + 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. + 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' + IMPORTING + ev_trkorr = ev_trkorr + ). + ENDMETHOD. + + METHOD create_transport_of_copies. + create( + EXPORTING + iv_text = iv_text + iv_target = iv_target + iv_type = 'T' + IMPORTING + ev_trkorr = ev_trkorr + ). + 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. + ev_trkorr = ls_header-trkorr. + ENDMETHOD. + + METHOD delete. + CALL FUNCTION 'TR_DELETE_COMM' + EXPORTING + wi_dialog = ' ' + wi_trkorr = iv_trkorr + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + ENDCLASS. diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap index e5bfe32..61d616e 100644 --- a/src/zcl_trm_utility.clas.abap +++ b/src/zcl_trm_utility.clas.abap @@ -3,15 +3,87 @@ CLASS zcl_trm_utility DEFINITION FINAL CREATE PUBLIC . -PUBLIC SECTION. + PUBLIC SECTION. -PROTECTED SECTION. -PRIVATE SECTION. + 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. + + 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. ENDCLASS. diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap index aeeee67..9d9f947 100644 --- a/src/zcx_trm_exception.clas.abap +++ b/src/zcx_trm_exception.clas.abap @@ -7,8 +7,11 @@ CLASS zcx_trm_exception DEFINITION CONSTANTS: BEGIN OF c_reason, - generic TYPE string VALUE 'GENERIC', - invalid_input TYPE string VALUE 'INVALID_INPUT', + 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', END OF c_reason . METHODS constructor diff --git a/src/ztrm.fugr.lztrmf01.abap b/src/ztrm.fugr.lztrmf01.abap index 3802822..e259985 100644 --- a/src/ztrm.fugr.lztrmf01.abap +++ b/src/ztrm.fugr.lztrmf01.abap @@ -16,6 +16,12 @@ FORM handle_exception. 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 OTHERS. MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING generic. ENDCASE. diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index 421226b..5cb8228 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -322,14 +322,15 @@ R Add objects to transport request - - IV_LOCK - FLAG - IV_TRKORR TRKORR + + IV_LOCK + X + FLAG + @@ -348,34 +349,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 @@ -391,31 +377,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 @@ -435,7 +401,16 @@ TRM_RFC_UNAUTHORIZED - INSERT_ERROR + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -448,7 +423,19 @@ X - INSERT_ERROR + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X @@ -468,7 +455,16 @@ TRM_RFC_UNAUTHORIZED - INSERT_ERROR + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -481,7 +477,19 @@ X - INSERT_ERROR + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X @@ -526,10 +534,10 @@ TRM_RFC_UNAUTHORIZED - INSERT_FAILED + INVALID_INPUT - ENQUEUE_FAILED + GENERIC @@ -550,11 +558,11 @@ X - INSERT_FAILED + INVALID_INPUT X - ENQUEUE_FAILED + GENERIC X @@ -574,97 +582,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 @@ -677,127 +601,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 @@ -827,10 +639,10 @@ TRM_RFC_UNAUTHORIZED - INSERT_FAILED + INVALID_INPUT - ENQUEUE_FAILED + GENERIC @@ -851,11 +663,11 @@ X - INSERT_FAILED + INVALID_INPUT X - ENQUEUE_FAILED + GENERIC X @@ -875,52 +687,10 @@ 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 + INVALID_INPUT - SUCCESSORS_ALREADY_RELEASED + GENERIC @@ -933,67 +703,11 @@ 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 - - - NO_AUTHORIZATION - X - - - WRONG_CLIENT - X - - - PROJECT_STILL_REFERENCED + INVALID_INPUT X - SUCCESSORS_ALREADY_RELEASED + GENERIC X diff --git a/src/ztrm.fugr.ztrm_add_lang_tr.abap b/src/ztrm.fugr.ztrm_add_lang_tr.abap index 776eb0e..44b4730 100644 --- a/src/ztrm.fugr.ztrm_add_lang_tr.abap +++ b/src/ztrm.fugr.ztrm_add_lang_tr.abap @@ -13,7 +13,7 @@ FUNCTION ztrm_add_lang_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>add_translations_to_transport( + zcl_trm_transport=>add_translations( EXPORTING iv_trkorr = iv_trkorr it_devclass = it_devclass[] diff --git a/src/ztrm.fugr.ztrm_add_objs_tr.abap b/src/ztrm.fugr.ztrm_add_objs_tr.abap index 442029e..5c0e9d3 100644 --- a/src/ztrm.fugr.ztrm_add_objs_tr.abap +++ b/src/ztrm.fugr.ztrm_add_objs_tr.abap @@ -2,57 +2,29 @@ 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 *"---------------------------------------------------------------------- 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. - - 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. + TRY. + zcl_trm_transport=>add_objects( + EXPORTING + iv_lock = iv_lock + iv_trkorr = iv_trkorr + it_e071 = it_e071[] + IMPORTING + et_log = et_log + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap index 79c2534..5bb148f 100644 --- a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap @@ -5,18 +5,20 @@ FUNCTION ztrm_add_skip_trkorr. *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_ERROR +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- 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 20f208a..6d6cb52 100644 --- a/src/ztrm.fugr.ztrm_add_src_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_src_trkorr.abap @@ -5,22 +5,20 @@ FUNCTION ztrm_add_src_trkorr. *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_ERROR +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - 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. - - - - + 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 a6ce3d4..6d883a6 100644 --- a/src/ztrm.fugr.ztrm_check_auth.abap +++ b/src/ztrm.fugr.ztrm_check_auth.abap @@ -4,13 +4,8 @@ FUNCTION ztrm_check_auth. *" 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 1756c2b..297bc55 100644 --- a/src/ztrm.fugr.ztrm_create_import_tr.abap +++ b/src/ztrm.fugr.ztrm_create_import_tr.abap @@ -8,29 +8,21 @@ FUNCTION ztrm_create_import_tr. *" VALUE(EV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_FAILED -*" ENQUEUE_FAILED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- 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 + IMPORTING + ev_trkorr = ev_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 387863d..24b9041 100644 --- a/src/ztrm.fugr.ztrm_create_package.abap +++ b/src/ztrm.fugr.ztrm_create_package.abap @@ -5,180 +5,19 @@ FUNCTION ztrm_create_package. *" 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 *"---------------------------------------------------------------------- - PERFORM check_auth. - - 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. + 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 66d746b..d569194 100644 --- a/src/ztrm.fugr.ztrm_create_toc.abap +++ b/src/ztrm.fugr.ztrm_create_toc.abap @@ -8,29 +8,21 @@ FUNCTION ztrm_create_toc. *" VALUE(EV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" INSERT_FAILED -*" ENQUEUE_FAILED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- 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 + IMPORTING + ev_trkorr = ev_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 db038b2..c16422a 100644 --- a/src/ztrm.fugr.ztrm_delete_transport.abap +++ b/src/ztrm.fugr.ztrm_delete_transport.abap @@ -5,80 +5,18 @@ FUNCTION ztrm_delete_transport. *" 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 *"---------------------------------------------------------------------- PERFORM check_auth. - 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. - + TRY. + zcl_trm_transport=>delete( + EXPORTING + iv_trkorr = iv_trkorr + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. From 5c3b524bf9923b28b3fff25bc3fe3ced912c6803 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Fri, 12 Jul 2024 18:21:18 +0000 Subject: [PATCH 07/27] refactor OO --- src/zcl_trm_package.clas.abap | 19 + src/zcl_trm_transport.clas.abap | 268 ++++++++++++- src/zcl_trm_utility.clas.abap | 103 +++++ src/zcx_trm_exception.clas.abap | 2 + src/ztrm.fugr.lztrmf01.abap | 4 + src/ztrm.fugr.xml | 367 ++++++++++-------- src/ztrm.fugr.ztrm_dequeue_tr.abap | 14 +- src/ztrm.fugr.ztrm_forward_tr.abap | 34 +- src/ztrm.fugr.ztrm_get_binary_file.abap | 16 +- src/ztrm.fugr.ztrm_get_devclass_objs.abap | 27 +- src/ztrm.fugr.ztrm_get_dir_trans.abap | 23 +- src/ztrm.fugr.ztrm_get_file_sys.abap | 14 +- src/ztrm.fugr.ztrm_get_obj_lock_tr.abap | 28 +- src/ztrm.fugr.ztrm_get_transport_layer.abap | 29 +- src/ztrm.fugr.ztrm_import_tr.abap | 44 +-- src/ztrm.fugr.ztrm_list_object_types.abap | 16 +- src/ztrm.fugr.ztrm_read_tms_queue.abap | 53 +-- src/ztrm.fugr.ztrm_release_tr.abap | 100 +---- ...rm.fugr.ztrm_rename_transport_request.abap | 82 +--- src/ztrm.fugr.ztrm_set_install_devc.abap | 20 +- src/ztrm.fugr.ztrm_set_integrity.abap | 16 +- src/ztrm.fugr.ztrm_set_transport_doc.abap | 26 +- 22 files changed, 796 insertions(+), 509 deletions(-) diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap index e3b3a20..eb3e326 100644 --- a/src/zcl_trm_package.clas.abap +++ b/src/zcl_trm_package.clas.abap @@ -9,6 +9,11 @@ CLASS zcl_trm_package DEFINITION IMPORTING is_data TYPE scompkdtln RAISING zcx_trm_exception. + CLASS-METHODS get_objects + IMPORTING iv_devclass TYPE devclass + EXPORTING et_tadir TYPE scts_tadir + RAISING zcx_trm_exception. + PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. @@ -70,4 +75,18 @@ CLASS zcl_trm_package IMPLEMENTATION. ENDIF. ENDMETHOD. + METHOD get_objects. + CALL FUNCTION 'TRINT_SELECT_OBJECTS' + EXPORTING + iv_devclass = iv_devclass + iv_via_selscreen = ' ' + IMPORTING + et_objects_tadir = et_tadir + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + ENDCLASS. diff --git a/src/zcl_trm_transport.clas.abap b/src/zcl_trm_transport.clas.abap index add809b..2d4bcf1 100644 --- a/src/zcl_trm_transport.clas.abap +++ b/src/zcl_trm_transport.clas.abap @@ -5,7 +5,8 @@ CLASS zcl_trm_transport DEFINITION 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_e071 TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY, + tyt_tline TYPE STANDARD TABLE OF tline WITH DEFAULT KEY. CLASS-METHODS add_translations IMPORTING iv_trkorr TYPE trkorr @@ -35,6 +36,54 @@ CLASS zcl_trm_transport DEFINITION IMPORTING iv_trkorr TYPE trkorr RAISING zcx_trm_exception. + CLASS-METHODS enqueue + IMPORTING iv_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS dequeue + IMPORTING iv_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS forward + IMPORTING iv_trkorr TYPE trkorr + iv_target TYPE tmssysnam + iv_source TYPE tmssysnam + iv_import_again TYPE flag + RAISING zcx_trm_exception. + + CLASS-METHODS find_object_lock + IMPORTING iv_pgmid TYPE pgmid + iv_object TYPE trobjtype + iv_obj_name TYPE trobj_name + EXPORTING ev_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS import + IMPORTING iv_system TYPE tmssysnam + iv_trkorr TYPE trkorr + RAISING zcx_trm_exception. + + CLASS-METHODS read_queue + IMPORTING iv_target TYPE tmssysnam + EXPORTING et_requests TYPE tmsiqreqs + RAISING zcx_trm_exception. + + CLASS-METHODS release + IMPORTING iv_trkorr TYPE trkorr + iv_lock TYPE flag + EXPORTING et_messages TYPE ctsgerrmsgs + RAISING zcx_trm_exception. + + CLASS-METHODS rename + IMPORTING iv_trkorr TYPE trkorr + iv_as4text TYPE as4text + RAISING zcx_trm_exception. + + CLASS-METHODS set_documentation + IMPORTING iv_trkorr TYPE trkorr + it_doc TYPE tyt_tline + RAISING zcx_trm_exception. + PROTECTED SECTION. PRIVATE SECTION. CLASS-METHODS create @@ -213,4 +262,221 @@ CLASS zcl_trm_transport IMPLEMENTATION. ENDIF. ENDMETHOD. + METHOD enqueue. + CALL FUNCTION 'ENQUEUE_E_TRKORR' + EXPORTING + trkorr = iv_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 = iv_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. + 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 + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + + METHOD find_object_lock. + 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. + ENDMETHOD. + + METHOD import. + 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 + 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 = iv_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( iv_trkorr ). + "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 = 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 + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + + dequeue( iv_trkorr ). + + 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. + CALL FUNCTION 'TRINT_DOCU_INTERFACE' + EXPORTING + iv_object = iv_trkorr + iv_action = 'M' + iv_modify_appending = '' + TABLES + tt_line = it_doc + EXCEPTIONS + OTHERS = 1. + IF sy-subrc <> 0. + zcx_trm_exception=>raise( ). + ENDIF. + ENDMETHOD. + ENDCLASS. diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap index 61d616e..3d26084 100644 --- a/src/zcl_trm_utility.clas.abap +++ b/src/zcl_trm_utility.clas.abap @@ -5,6 +5,9 @@ CLASS zcl_trm_utility DEFINITION PUBLIC SECTION. + TYPES: tyt_ko100 TYPE STANDARD TABLE OF ko100 WITH DEFAULT KEY, + tyt_installdevc TYPE STANDARD TABLE OF ztrm_installdevc WITH DEFAULT KEY. + CLASS-METHODS check_functions_authorization RETURNING VALUE(rv_authorized) TYPE flag. @@ -16,6 +19,35 @@ CLASS zcl_trm_utility DEFINITION 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 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. + PROTECTED SECTION. PRIVATE SECTION. CLASS-METHODS enqueue @@ -86,4 +118,75 @@ CLASS zcl_trm_utility IMPLEMENTATION. 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. + 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. + ENDCLASS. diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap index 9d9f947..7112214 100644 --- a/src/zcx_trm_exception.clas.abap +++ b/src/zcx_trm_exception.clas.abap @@ -12,6 +12,8 @@ CLASS zcx_trm_exception DEFINITION 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', END OF c_reason . METHODS constructor diff --git a/src/ztrm.fugr.lztrmf01.abap b/src/ztrm.fugr.lztrmf01.abap index e259985..2b96d5f 100644 --- a/src/ztrm.fugr.lztrmf01.abap +++ b/src/ztrm.fugr.lztrmf01.abap @@ -22,6 +22,10 @@ FORM handle_exception. 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 OTHERS. MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING generic. ENDCASE. diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index 5cb8228..cf36ce8 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -726,6 +726,15 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + DEQUEUE_ERROR + + + GENERIC + @@ -736,6 +745,18 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + DEQUEUE_ERROR + X + + + GENERIC + X + @@ -767,13 +788,10 @@ TRM_RFC_UNAUTHORIZED - READ_CONFIG_FAILED - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT - ERROR_MESSAGE + GENERIC @@ -798,15 +816,11 @@ X - READ_CONFIG_FAILED - X - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT X - ERROR_MESSAGE + GENERIC X @@ -831,6 +845,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -845,6 +865,14 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + @@ -868,10 +896,10 @@ TRM_RFC_UNAUTHORIZED - CANCELLED_BY_USER + INVALID_INPUT - INVALID_INPUT + GENERIC @@ -888,11 +916,11 @@ X - CANCELLED_BY_USER + INVALID_INPUT X - INVALID_INPUT + GENERIC X @@ -912,7 +940,10 @@ TRM_RFC_UNAUTHORIZED - NOT_FOUND + INVALID_INPUT + + + GENERIC @@ -925,7 +956,11 @@ X - NOT_FOUND + INVALID_INPUT + X + + + GENERIC X @@ -944,9 +979,15 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + NOT_FOUND + + GENERIC + @@ -957,10 +998,18 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + NOT_FOUND X + + GENERIC + X + @@ -991,6 +1040,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -1013,6 +1068,14 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + @@ -1029,14 +1092,11 @@ TRM_RFC_UNAUTHORIZED - - WRONG_CALL - INVALID_INPUT - CTS_INITIALIZATION_FAILURE + GENERIC @@ -1048,16 +1108,12 @@ TRM_RFC_UNAUTHORIZED X - - WRONG_CALL - X - INVALID_INPUT X - CTS_INITIALIZATION_FAILURE + GENERIC X @@ -1081,13 +1137,10 @@ TRM_RFC_UNAUTHORIZED - READ_CONFIG_FAILED - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT - ERROR_MESSAGE + GENERIC @@ -1104,15 +1157,11 @@ X - READ_CONFIG_FAILED - X - - - TABLE_OF_REQUESTS_IS_EMPTY + INVALID_INPUT X - ERROR_MESSAGE + GENERIC X @@ -1131,6 +1180,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -1141,6 +1196,14 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + @@ -1190,11 +1253,14 @@ TRM_RFC_UNAUTHORIZED - READ_QUEUE_FAILED + INVALID_INPUT TMS_ALERT + + GENERIC + @@ -1210,13 +1276,17 @@ X - READ_QUEUE_FAILED + INVALID_INPUT X TMS_ALERT X + + GENERIC + X + @@ -1244,55 +1314,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 @@ -1313,71 +1338,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 @@ -1401,7 +1366,16 @@ TRM_RFC_UNAUTHORIZED - UPDATE_FAILED + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -1418,7 +1392,19 @@ X - UPDATE_FAILED + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X @@ -1437,6 +1423,18 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC + @@ -1447,6 +1445,22 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC + X + @@ -1463,6 +1477,18 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC + @@ -1473,6 +1499,22 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC + X + @@ -1496,7 +1538,16 @@ TRM_RFC_UNAUTHORIZED - ERROR + INVALID_INPUT + + + ENQUEUE_ERROR + + + DEQUEUE_ERROR + + + GENERIC @@ -1513,7 +1564,19 @@ X - ERROR + INVALID_INPUT + X + + + ENQUEUE_ERROR + X + + + DEQUEUE_ERROR + X + + + GENERIC X diff --git a/src/ztrm.fugr.ztrm_dequeue_tr.abap b/src/ztrm.fugr.ztrm_dequeue_tr.abap index fece244..97b9cd0 100644 --- a/src/ztrm.fugr.ztrm_dequeue_tr.abap +++ b/src/ztrm.fugr.ztrm_dequeue_tr.abap @@ -5,11 +5,19 @@ FUNCTION ztrm_dequeue_tr. *" VALUE(IV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - CALL FUNCTION 'DEQUEUE_E_TRKORR' - EXPORTING - trkorr = iv_trkorr. + TRY. + zcl_trm_transport=>dequeue( + EXPORTING + iv_trkorr = iv_trkorr + ). + 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 11f1e34..77fe146 100644 --- a/src/ztrm.fugr.ztrm_forward_tr.abap +++ b/src/ztrm.fugr.ztrm_forward_tr.abap @@ -8,29 +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 *"---------------------------------------------------------------------- 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. + zcl_trm_transport=>forward( + EXPORTING + iv_trkorr = iv_trkorr + 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 42dad20..811f60f 100644 --- a/src/ztrm.fugr.ztrm_get_binary_file.abap +++ b/src/ztrm.fugr.ztrm_get_binary_file.abap @@ -7,12 +7,20 @@ FUNCTION ztrm_get_binary_file. *" VALUE(EV_FILE) TYPE XSTRING *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - OPEN DATASET iv_file_path FOR INPUT IN BINARY MODE. - READ DATASET iv_file_path INTO ev_file. - CLOSE DATASET iv_file_path. - + 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 fac89f8..2d536ec 100644 --- a/src/ztrm.fugr.ztrm_get_devclass_objs.abap +++ b/src/ztrm.fugr.ztrm_get_devclass_objs.abap @@ -7,25 +7,20 @@ FUNCTION ztrm_get_devclass_objs. *" VALUE(ET_TADIR) TYPE SCTS_TADIR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" CANCELLED_BY_USER *" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- 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. + zcl_trm_package=>get_objects( + EXPORTING + iv_devclass = iv_devclass + 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 4a264d7..388a001 100644 --- a/src/ztrm.fugr.ztrm_get_dir_trans.abap +++ b/src/ztrm.fugr.ztrm_get_dir_trans.abap @@ -5,21 +5,18 @@ FUNCTION ztrm_get_dir_trans. *" VALUE(EV_DIR_TRANS) TYPE PFEVALUE *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" NOT_FOUND +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- 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 c0d6606..682a3af 100644 --- a/src/ztrm.fugr.ztrm_get_file_sys.abap +++ b/src/ztrm.fugr.ztrm_get_file_sys.abap @@ -5,13 +5,19 @@ FUNCTION ztrm_get_file_sys. *" VALUE(EV_FILE_SYS) TYPE FILESYS *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT *" NOT_FOUND +*" GENERIC *"---------------------------------------------------------------------- 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 edddec6..12261f7 100644 --- a/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap +++ b/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap @@ -9,22 +9,22 @@ FUNCTION ztrm_get_obj_lock_tr. *" VALUE(EV_TRKORR) TYPE TRKORR *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- 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 + IMPORTING + ev_trkorr = ev_trkorr + ). + 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 e362f44..1efd85f 100644 --- a/src/ztrm.fugr.ztrm_get_transport_layer.abap +++ b/src/ztrm.fugr.ztrm_get_transport_layer.abap @@ -5,29 +5,18 @@ FUNCTION ztrm_get_transport_layer. *" VALUE(EV_LAYER) TYPE DEVLAYER *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" WRONG_CALL *" INVALID_INPUT -*" CTS_INITIALIZATION_FAILURE +*" GENERIC *"---------------------------------------------------------------------- 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 4d555c1..7b41757 100644 --- a/src/ztrm.fugr.ztrm_import_tr.abap +++ b/src/ztrm.fugr.ztrm_import_tr.abap @@ -6,41 +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 *"---------------------------------------------------------------------- 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. + zcl_trm_transport=>import( + EXPORTING + iv_system = iv_system + iv_trkorr = iv_trkorr + ). + 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 162bd22..7fff5d0 100644 --- a/src/ztrm.fugr.ztrm_list_object_types.abap +++ b/src/ztrm.fugr.ztrm_list_object_types.abap @@ -5,14 +5,18 @@ FUNCTION ztrm_list_object_types. *" ET_OBJECT_TEXT STRUCTURE KO100 *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - CLEAR et_object_text. - CALL FUNCTION 'TR_OBJECT_TABLE' - TABLES - wt_object_text = et_object_text. - - + 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_read_tms_queue.abap b/src/ztrm.fugr.ztrm_read_tms_queue.abap index 9215395..7e32cc2 100644 --- a/src/ztrm.fugr.ztrm_read_tms_queue.abap +++ b/src/ztrm.fugr.ztrm_read_tms_queue.abap @@ -7,50 +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. - " 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' - EXPORTING - iv_alert_id = ls_bufcnt-alertid - iv_no_display = 'X' - 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. + TRY. + zcl_trm_transport=>read_queue( + EXPORTING + iv_target = iv_target + IMPORTING + 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 a273b00..29a5c8b 100644 --- a/src/ztrm.fugr.ztrm_release_tr.abap +++ b/src/ztrm.fugr.ztrm_release_tr.abap @@ -8,95 +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 *"---------------------------------------------------------------------- PERFORM check_auth. - 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. - + TRY. + zcl_trm_transport=>release( + EXPORTING + iv_trkorr = iv_trkorr + 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 b9d3c4d..5a4ba28 100644 --- a/src/ztrm.fugr.ztrm_rename_transport_request.abap +++ b/src/ztrm.fugr.ztrm_rename_transport_request.abap @@ -6,77 +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 *"---------------------------------------------------------------------- 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' - 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. - + TRY. + zcl_trm_transport=>rename( + EXPORTING + iv_trkorr = iv_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 ca67229..8d6042a 100644 --- a/src/ztrm.fugr.ztrm_set_install_devc.abap +++ b/src/ztrm.fugr.ztrm_set_install_devc.abap @@ -5,16 +5,20 @@ FUNCTION ztrm_set_install_devc. *" IT_INSTALLDEVC STRUCTURE ZTRM_INSTALLDEVC *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - 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. - - + 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 ea1ed39..f1490e5 100644 --- a/src/ztrm.fugr.ztrm_set_integrity.abap +++ b/src/ztrm.fugr.ztrm_set_integrity.abap @@ -5,12 +5,20 @@ FUNCTION ztrm_set_integrity. *" VALUE(IS_INTEGRITY) TYPE ZTRM_INTEGRITY *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - MODIFY ztrm_integrity FROM is_integrity. - COMMIT WORK AND WAIT. - - + 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 dde508e..25ccc8c 100644 --- a/src/ztrm.fugr.ztrm_set_transport_doc.abap +++ b/src/ztrm.fugr.ztrm_set_transport_doc.abap @@ -7,21 +7,21 @@ FUNCTION ztrm_set_transport_doc. *" IT_DOC STRUCTURE TLINE *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" ERROR +*" INVALID_INPUT +*" ENQUEUE_ERROR +*" DEQUEUE_ERROR +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - 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. - + TRY. + zcl_trm_transport=>set_documentation( + EXPORTING + iv_trkorr = iv_trkorr + it_doc = it_doc[] + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. + ENDTRY. ENDFUNCTION. From 6ec60bb16c4b2cc4833b68cf6d3c1ad1c58d32cc Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Sat, 13 Jul 2024 12:22:41 +0000 Subject: [PATCH 08/27] refactor OO --- src/zcl_trm_package.clas.abap | 16 +- src/zcl_trm_transport.clas.abap | 164 ++++++++++-------- src/ztrm.fugr.lztrmtop.abap | 10 +- src/ztrm.fugr.ztrm_add_lang_tr.abap | 15 +- src/ztrm.fugr.ztrm_add_objs_tr.abap | 21 +-- src/ztrm.fugr.ztrm_add_skip_trkorr.abap | 12 +- src/ztrm.fugr.ztrm_add_src_trkorr.abap | 12 +- src/ztrm.fugr.ztrm_create_import_tr.abap | 19 +- src/ztrm.fugr.ztrm_create_toc.abap | 19 +- src/ztrm.fugr.ztrm_delete_transport.abap | 10 +- src/ztrm.fugr.ztrm_dequeue_tr.abap | 10 +- src/ztrm.fugr.ztrm_forward_tr.abap | 18 +- src/ztrm.fugr.ztrm_get_binary_file.abap | 16 +- src/ztrm.fugr.ztrm_get_devclass_objs.abap | 15 +- src/ztrm.fugr.ztrm_get_dir_trans.abap | 12 +- src/ztrm.fugr.ztrm_get_file_sys.abap | 12 +- src/ztrm.fugr.ztrm_get_obj_lock_tr.abap | 21 +-- src/ztrm.fugr.ztrm_import_tr.abap | 14 +- src/ztrm.fugr.ztrm_list_object_types.abap | 12 +- src/ztrm.fugr.ztrm_read_tms_queue.abap | 16 +- src/ztrm.fugr.ztrm_release_tr.abap | 18 +- ...rm.fugr.ztrm_rename_transport_request.abap | 14 +- src/ztrm.fugr.ztrm_set_install_devc.abap | 12 +- src/ztrm.fugr.ztrm_set_integrity.abap | 12 +- src/ztrm.fugr.ztrm_set_transport_doc.abap | 14 +- 25 files changed, 271 insertions(+), 243 deletions(-) diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap index eb3e326..2e12d24 100644 --- a/src/zcl_trm_package.clas.abap +++ b/src/zcl_trm_package.clas.abap @@ -5,23 +5,31 @@ CLASS zcl_trm_package DEFINITION 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. - CLASS-METHODS get_objects - IMPORTING iv_devclass TYPE devclass + METHODS get_objects EXPORTING et_tadir TYPE scts_tadir RAISING zcx_trm_exception. PROTECTED SECTION. PRIVATE SECTION. + DATA: gv_devclass TYPE devclass. 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. @@ -73,12 +81,14 @@ CLASS zcl_trm_package IMPLEMENTATION. IF sy-subrc <> 0. zcx_trm_exception=>raise( ). ENDIF. + + CREATE OBJECT ro_package EXPORTING iv_devclass = ls_data-devclass. ENDMETHOD. METHOD get_objects. CALL FUNCTION 'TRINT_SELECT_OBJECTS' EXPORTING - iv_devclass = iv_devclass + iv_devclass = gv_devclass iv_via_selscreen = ' ' IMPORTING et_objects_tadir = et_tadir diff --git a/src/zcl_trm_transport.clas.abap b/src/zcl_trm_transport.clas.abap index 2d4bcf1..df7e5ca 100644 --- a/src/zcl_trm_transport.clas.abap +++ b/src/zcl_trm_transport.clas.abap @@ -8,80 +8,77 @@ CLASS zcl_trm_transport DEFINITION tyt_e071 TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY, tyt_tline TYPE STANDARD TABLE OF tline WITH DEFAULT KEY. - CLASS-METHODS add_translations - IMPORTING iv_trkorr TYPE trkorr - it_devclass TYPE tyt_lxe_packg - RAISING zcx_trm_exception. - - CLASS-METHODS add_objects - IMPORTING iv_lock TYPE flag - iv_trkorr TYPE trkorr - it_e071 TYPE tyt_e071 - EXPORTING et_log TYPE sprot_u_tab + 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 - EXPORTING ev_trkorr TYPE trkorr + 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 - EXPORTING ev_trkorr TYPE trkorr + RETURNING VALUE(ro_transport) TYPE REF TO zcl_trm_transport RAISING zcx_trm_exception. - CLASS-METHODS delete - IMPORTING iv_trkorr TYPE trkorr + 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 enqueue - IMPORTING iv_trkorr TYPE trkorr + CLASS-METHODS read_queue + IMPORTING iv_target TYPE tmssysnam + EXPORTING et_requests TYPE tmsiqreqs RAISING zcx_trm_exception. - CLASS-METHODS dequeue - IMPORTING iv_trkorr TYPE trkorr + METHODS get_trkorr + RETURNING VALUE(rv_trkorr) TYPE trkorr. + + METHODS add_translations + IMPORTING it_devclass TYPE tyt_lxe_packg RAISING zcx_trm_exception. - CLASS-METHODS forward - IMPORTING iv_trkorr TYPE trkorr - iv_target TYPE tmssysnam - iv_source TYPE tmssysnam - iv_import_again TYPE flag + METHODS add_objects + IMPORTING iv_lock TYPE flag + it_e071 TYPE tyt_e071 + EXPORTING et_log TYPE sprot_u_tab RAISING zcx_trm_exception. - CLASS-METHODS find_object_lock - IMPORTING iv_pgmid TYPE pgmid - iv_object TYPE trobjtype - iv_obj_name TYPE trobj_name - EXPORTING ev_trkorr TYPE trkorr + METHODS delete RAISING zcx_trm_exception. - CLASS-METHODS import - IMPORTING iv_system TYPE tmssysnam - iv_trkorr TYPE trkorr + METHODS enqueue RAISING zcx_trm_exception. - CLASS-METHODS read_queue - IMPORTING iv_target TYPE tmssysnam - EXPORTING et_requests TYPE tmsiqreqs + METHODS dequeue RAISING zcx_trm_exception. - CLASS-METHODS release - IMPORTING iv_trkorr TYPE trkorr - iv_lock TYPE flag + 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. - CLASS-METHODS rename - IMPORTING iv_trkorr TYPE trkorr - iv_as4text TYPE as4text + METHODS rename + IMPORTING iv_as4text TYPE as4text RAISING zcx_trm_exception. - CLASS-METHODS set_documentation - IMPORTING iv_trkorr TYPE trkorr - it_doc TYPE tyt_tline + METHODS set_documentation + IMPORTING it_doc TYPE tyt_tline RAISING zcx_trm_exception. PROTECTED SECTION. @@ -90,14 +87,24 @@ CLASS zcl_trm_transport DEFINITION IMPORTING iv_text TYPE as4text iv_target TYPE tr_target iv_type TYPE trfunction - EXPORTING ev_trkorr TYPE trkorr + 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, @@ -160,7 +167,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. CALL METHOD lo_explang->export_objects EXPORTING tr_auto = '' - tr_request = iv_trkorr + tr_request = gv_trkorr force = '' forcekey = '' object_transport = '' @@ -186,17 +193,19 @@ CLASS zcl_trm_transport IMPLEMENTATION. 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 = iv_trkorr + iv_request = gv_trkorr IMPORTING et_log = et_log TABLES - it_e071 = it_e071 + it_e071 = lt_e071 EXCEPTIONS invalid_request = 1 invalid_request_type = 2 @@ -213,22 +222,22 @@ CLASS zcl_trm_transport IMPLEMENTATION. METHOD create_workbench. create( EXPORTING - iv_text = iv_text - iv_target = iv_target - iv_type = 'K' - IMPORTING - ev_trkorr = ev_trkorr + 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' - IMPORTING - ev_trkorr = ev_trkorr + iv_text = iv_text + iv_target = iv_target + iv_type = 'T' + RECEIVING + ro_transport = ro_transport ). ENDMETHOD. @@ -247,14 +256,14 @@ CLASS zcl_trm_transport IMPLEMENTATION. IF sy-subrc <> 0. zcx_trm_exception=>raise( ). ENDIF. - ev_trkorr = ls_header-trkorr. + CREATE OBJECT ro_transport EXPORTING iv_trkorr = ls_header-trkorr. ENDMETHOD. METHOD delete. CALL FUNCTION 'TR_DELETE_COMM' EXPORTING wi_dialog = ' ' - wi_trkorr = iv_trkorr + wi_trkorr = gv_trkorr EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. @@ -265,7 +274,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. METHOD enqueue. CALL FUNCTION 'ENQUEUE_E_TRKORR' EXPORTING - trkorr = iv_trkorr + trkorr = gv_trkorr EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. @@ -276,7 +285,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. METHOD dequeue. CALL FUNCTION 'DEQUEUE_E_TRKORR' EXPORTING - trkorr = iv_trkorr + trkorr = gv_trkorr EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. @@ -287,7 +296,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. METHOD forward. CALL FUNCTION 'TMS_MGR_FORWARD_TR_REQUEST' EXPORTING - iv_request = iv_trkorr + iv_request = gv_trkorr iv_target = iv_target iv_source = iv_source iv_import_again = iv_import_again @@ -299,7 +308,8 @@ CLASS zcl_trm_transport IMPLEMENTATION. ENDMETHOD. METHOD find_object_lock. - DATA ls_e070 TYPE e070. + 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 @@ -309,9 +319,13 @@ CLASS zcl_trm_transport IMPLEMENTATION. AND e070~trstatus EQ 'D'. IF ls_e070-strkorr IS NOT INITIAL. - ev_trkorr = ls_e070-strkorr. + lv_trkorr = ls_e070-strkorr. ELSE. - ev_trkorr = ls_e070-trkorr. + lv_trkorr = ls_e070-trkorr. + ENDIF. + + IF lv_trkorr IS NOT INITIAL. + CREATE OBJECT ro_transport EXPORTING iv_trkorr = lv_trkorr. ENDIF. ENDMETHOD. @@ -319,7 +333,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. CALL FUNCTION 'TMS_MGR_IMPORT_TR_REQUEST' EXPORTING iv_system = iv_system - iv_request = iv_trkorr + iv_request = gv_trkorr iv_ctc_active = ' ' iv_overtake = 'X' iv_import_again = 'X' @@ -393,7 +407,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. CALL FUNCTION 'TRINT_RELEASE_REQUEST' EXPORTING - iv_trkorr = iv_trkorr + iv_trkorr = gv_trkorr iv_dialog = ' ' iv_success_message = ' ' iv_display_export_log = ' ' @@ -407,7 +421,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. ENDMETHOD. METHOD rename. - enqueue( iv_trkorr ). + enqueue( ). "LSTR6F02 - e070_update DATA: ls_e070 TYPE e070, ls_e070c TYPE e070c, @@ -418,12 +432,12 @@ CLASS zcl_trm_transport IMPLEMENTATION. SELECT SINGLE * INTO ls_e070 FROM e070 - WHERE trkorr = iv_trkorr. + WHERE trkorr = gv_trkorr. SELECT SINGLE * INTO ls_e070c "read additional fields - note 2231381 FROM e070c - WHERE trkorr = iv_trkorr. + WHERE trkorr = gv_trkorr. - ls_e07t-trkorr = iv_trkorr. + ls_e07t-trkorr = gv_trkorr. ls_e07t-langu = sy-langu. ls_e07t-as4text = iv_as4text. @@ -446,7 +460,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. zcx_trm_exception=>raise( ). ENDIF. - dequeue( iv_trkorr ). + dequeue( ). lv_msgtext1 = ls_e070-trkorr. lv_msgtext2 = sy-uname. @@ -465,13 +479,15 @@ CLASS zcl_trm_transport IMPLEMENTATION. ENDMETHOD. METHOD set_documentation. + DATA lt_doc LIKE it_doc. + MOVE it_doc[] TO lt_doc[]. CALL FUNCTION 'TRINT_DOCU_INTERFACE' EXPORTING - iv_object = iv_trkorr + iv_object = gv_trkorr iv_action = 'M' iv_modify_appending = '' TABLES - tt_line = it_doc + tt_line = lt_doc EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. diff --git a/src/ztrm.fugr.lztrmtop.abap b/src/ztrm.fugr.lztrmtop.abap index 1af71c4..3828760 100644 --- a/src/ztrm.fugr.lztrmtop.abap +++ b/src/ztrm.fugr.lztrmtop.abap @@ -1,7 +1,9 @@ -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. + INCLUDE lsvimdat . "general data decl. + INCLUDE lztrmt00 . "view rel. data dcl. -DATA lo_exc TYPE REF TO zcx_trm_exception. +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.ztrm_add_lang_tr.abap b/src/ztrm.fugr.ztrm_add_lang_tr.abap index 44b4730..680bf7d 100644 --- a/src/ztrm.fugr.ztrm_add_lang_tr.abap +++ b/src/ztrm.fugr.ztrm_add_lang_tr.abap @@ -13,12 +13,13 @@ FUNCTION ztrm_add_lang_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>add_translations( - EXPORTING - iv_trkorr = iv_trkorr - it_devclass = it_devclass[] - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->add_translations( + EXPORTING + it_devclass = it_devclass[] + ). + 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 5c0e9d3..2724c65 100644 --- a/src/ztrm.fugr.ztrm_add_objs_tr.abap +++ b/src/ztrm.fugr.ztrm_add_objs_tr.abap @@ -16,15 +16,16 @@ FUNCTION ztrm_add_objs_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>add_objects( - EXPORTING - iv_lock = iv_lock - iv_trkorr = iv_trkorr - it_e071 = it_e071[] - IMPORTING - et_log = et_log - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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. + ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap index 5bb148f..34faa22 100644 --- a/src/ztrm.fugr.ztrm_add_skip_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_skip_trkorr.abap @@ -13,12 +13,12 @@ FUNCTION ztrm_add_skip_trkorr. PERFORM check_auth. TRY. - zcl_trm_utility=>add_skip_trkorr( - EXPORTING - iv_trkorr = iv_trkorr - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 6d6cb52..31f6c84 100644 --- a/src/ztrm.fugr.ztrm_add_src_trkorr.abap +++ b/src/ztrm.fugr.ztrm_add_src_trkorr.abap @@ -13,12 +13,12 @@ FUNCTION ztrm_add_src_trkorr. 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. + 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_create_import_tr.abap b/src/ztrm.fugr.ztrm_create_import_tr.abap index 297bc55..575fdb9 100644 --- a/src/ztrm.fugr.ztrm_create_import_tr.abap +++ b/src/ztrm.fugr.ztrm_create_import_tr.abap @@ -14,15 +14,16 @@ FUNCTION ztrm_create_import_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>create_workbench( - EXPORTING - iv_text = iv_text - iv_target = iv_target - IMPORTING - ev_trkorr = ev_trkorr - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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_toc.abap b/src/ztrm.fugr.ztrm_create_toc.abap index d569194..30ac78c 100644 --- a/src/ztrm.fugr.ztrm_create_toc.abap +++ b/src/ztrm.fugr.ztrm_create_toc.abap @@ -14,15 +14,16 @@ FUNCTION ztrm_create_toc. PERFORM check_auth. TRY. - zcl_trm_transport=>create_transport_of_copies( - EXPORTING - iv_text = iv_text - iv_target = iv_target - IMPORTING - ev_trkorr = ev_trkorr - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 c16422a..a65a0ae 100644 --- a/src/ztrm.fugr.ztrm_delete_transport.abap +++ b/src/ztrm.fugr.ztrm_delete_transport.abap @@ -11,12 +11,10 @@ FUNCTION ztrm_delete_transport. PERFORM check_auth. TRY. - zcl_trm_transport=>delete( - EXPORTING - iv_trkorr = iv_trkorr - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 97b9cd0..14458b8 100644 --- a/src/ztrm.fugr.ztrm_dequeue_tr.abap +++ b/src/ztrm.fugr.ztrm_dequeue_tr.abap @@ -12,12 +12,10 @@ FUNCTION ztrm_dequeue_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>dequeue( - EXPORTING - iv_trkorr = iv_trkorr - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 77fe146..d93c5e2 100644 --- a/src/ztrm.fugr.ztrm_forward_tr.abap +++ b/src/ztrm.fugr.ztrm_forward_tr.abap @@ -14,15 +14,15 @@ FUNCTION ztrm_forward_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>forward( - EXPORTING - iv_trkorr = iv_trkorr - iv_target = iv_target - iv_source = iv_source - iv_import_again = iv_import_again - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 811f60f..f25bfbc 100644 --- a/src/ztrm.fugr.ztrm_get_binary_file.abap +++ b/src/ztrm.fugr.ztrm_get_binary_file.abap @@ -13,14 +13,14 @@ FUNCTION ztrm_get_binary_file. 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. + 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 2d536ec..f39269c 100644 --- a/src/ztrm.fugr.ztrm_get_devclass_objs.abap +++ b/src/ztrm.fugr.ztrm_get_devclass_objs.abap @@ -13,14 +13,13 @@ FUNCTION ztrm_get_devclass_objs. PERFORM check_auth. TRY. - zcl_trm_package=>get_objects( - EXPORTING - iv_devclass = iv_devclass - IMPORTING - et_tadir = et_tadir - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 388a001..a4adb35 100644 --- a/src/ztrm.fugr.ztrm_get_dir_trans.abap +++ b/src/ztrm.fugr.ztrm_get_dir_trans.abap @@ -11,12 +11,12 @@ FUNCTION ztrm_get_dir_trans. PERFORM check_auth. TRY. - zcl_trm_utility=>get_dir_trans( - IMPORTING - ev_dir_trans = ev_dir_trans - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 682a3af..0e16785 100644 --- a/src/ztrm.fugr.ztrm_get_file_sys.abap +++ b/src/ztrm.fugr.ztrm_get_file_sys.abap @@ -12,12 +12,12 @@ FUNCTION ztrm_get_file_sys. 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. + zcl_trm_utility=>get_file_sys( + IMPORTING + ev_file_sys = ev_file_sys + ). + CATCH zcx_trm_exception INTO lo_exc. + PERFORM handle_exception. ENDTRY. ENDFUNCTION. diff --git a/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap b/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap index 12261f7..471fb80 100644 --- a/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap +++ b/src/ztrm.fugr.ztrm_get_obj_lock_tr.abap @@ -15,16 +15,17 @@ FUNCTION ztrm_get_obj_lock_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>find_object_lock( - EXPORTING - iv_pgmid = iv_pgmid - iv_object = iv_object - iv_obj_name = iv_obj_name - IMPORTING - ev_trkorr = ev_trkorr - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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_import_tr.abap b/src/ztrm.fugr.ztrm_import_tr.abap index 7b41757..901abb6 100644 --- a/src/ztrm.fugr.ztrm_import_tr.abap +++ b/src/ztrm.fugr.ztrm_import_tr.abap @@ -12,13 +12,13 @@ FUNCTION ztrm_import_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>import( - EXPORTING - iv_system = iv_system - iv_trkorr = iv_trkorr - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 7fff5d0..433ab85 100644 --- a/src/ztrm.fugr.ztrm_list_object_types.abap +++ b/src/ztrm.fugr.ztrm_list_object_types.abap @@ -11,12 +11,12 @@ FUNCTION ztrm_list_object_types. 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. + 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_read_tms_queue.abap b/src/ztrm.fugr.ztrm_read_tms_queue.abap index 7e32cc2..b22f75f 100644 --- a/src/ztrm.fugr.ztrm_read_tms_queue.abap +++ b/src/ztrm.fugr.ztrm_read_tms_queue.abap @@ -14,14 +14,14 @@ FUNCTION ztrm_read_tms_queue. PERFORM check_auth. TRY. - zcl_trm_transport=>read_queue( - EXPORTING - iv_target = iv_target - IMPORTING - et_requests = et_requests - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + zcl_trm_transport=>read_queue( + EXPORTING + iv_target = iv_target + IMPORTING + 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 29a5c8b..3898736 100644 --- a/src/ztrm.fugr.ztrm_release_tr.abap +++ b/src/ztrm.fugr.ztrm_release_tr.abap @@ -14,15 +14,15 @@ FUNCTION ztrm_release_tr. PERFORM check_auth. TRY. - zcl_trm_transport=>release( - EXPORTING - iv_trkorr = iv_trkorr - iv_lock = iv_lock - IMPORTING - et_messages = et_messages - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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 5a4ba28..d3fc32a 100644 --- a/src/ztrm.fugr.ztrm_rename_transport_request.abap +++ b/src/ztrm.fugr.ztrm_rename_transport_request.abap @@ -14,13 +14,13 @@ FUNCTION ztrm_rename_transport_request. PERFORM check_auth. TRY. - zcl_trm_transport=>rename( - EXPORTING - iv_trkorr = iv_trkorr - iv_as4text = iv_as4text - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + CREATE OBJECT lo_transport EXPORTING iv_trkorr = iv_trkorr. + lo_transport->rename( + EXPORTING + 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 8d6042a..8047b82 100644 --- a/src/ztrm.fugr.ztrm_set_install_devc.abap +++ b/src/ztrm.fugr.ztrm_set_install_devc.abap @@ -13,12 +13,12 @@ FUNCTION ztrm_set_install_devc. 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. + 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 f1490e5..92683c4 100644 --- a/src/ztrm.fugr.ztrm_set_integrity.abap +++ b/src/ztrm.fugr.ztrm_set_integrity.abap @@ -13,12 +13,12 @@ FUNCTION ztrm_set_integrity. 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. + 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 25ccc8c..844b440 100644 --- a/src/ztrm.fugr.ztrm_set_transport_doc.abap +++ b/src/ztrm.fugr.ztrm_set_transport_doc.abap @@ -15,13 +15,13 @@ FUNCTION ztrm_set_transport_doc. PERFORM check_auth. TRY. - zcl_trm_transport=>set_documentation( - EXPORTING - iv_trkorr = iv_trkorr - it_doc = it_doc[] - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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. From 547a6d9a30f7ca7212407b71f7d92c0284fbbdd7 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Fri, 19 Jul 2024 17:21:35 +0000 Subject: [PATCH 09/27] refactor OO --- src/zcl_trm_package.clas.abap | 164 ++++++++++++- src/zcl_trm_transport.clas.abap | 55 +++-- src/zcl_trm_utility.clas.abap | 46 ++++ src/ztrm.fugr.xml | 258 +++------------------ src/ztrm.fugr.ztrm_tadir_interface.abap | 126 ++-------- src/ztrm.fugr.ztrm_tdevc_interface.abap | 269 +--------------------- src/ztrm.fugr.ztrm_tr_copy.abap | 67 +----- src/ztrm.fugr.ztrm_write_binary_file.abap | 16 +- 8 files changed, 326 insertions(+), 675 deletions(-) diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap index 2e12d24..6496a9b 100644 --- a/src/zcl_trm_package.clas.abap +++ b/src/zcl_trm_package.clas.abap @@ -9,17 +9,29 @@ CLASS zcl_trm_package DEFINITION IMPORTING iv_devclass TYPE devclass. CLASS-METHODS create - IMPORTING is_data TYPE scompkdtln + 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 + EXPORTING et_tadir TYPE scts_tadir + RAISING zcx_trm_exception. + + METHODS interface + IMPORTING iv_parentcl TYPE devclass OPTIONAL + iv_rm_parentcl TYPE flag 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. @@ -99,4 +111,152 @@ CLASS zcl_trm_package IMPLEMENTATION. 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. + 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 = 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 + ). + 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. + ENDMETHOD. + ENDCLASS. diff --git a/src/zcl_trm_transport.clas.abap b/src/zcl_trm_transport.clas.abap index df7e5ca..cdbf41e 100644 --- a/src/zcl_trm_transport.clas.abap +++ b/src/zcl_trm_transport.clas.abap @@ -13,21 +13,21 @@ CLASS zcl_trm_transport DEFINITION RAISING zcx_trm_exception. CLASS-METHODS create_workbench - IMPORTING iv_text TYPE as4text - iv_target TYPE tr_target + 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 + 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 + 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. @@ -44,19 +44,19 @@ CLASS zcl_trm_transport DEFINITION RAISING zcx_trm_exception. METHODS add_objects - IMPORTING iv_lock TYPE flag - it_e071 TYPE tyt_e071 - EXPORTING et_log TYPE sprot_u_tab + 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. + RAISING zcx_trm_exception. METHODS enqueue - RAISING zcx_trm_exception. + RAISING zcx_trm_exception. METHODS dequeue - RAISING zcx_trm_exception. + RAISING zcx_trm_exception. METHODS forward IMPORTING iv_target TYPE tmssysnam @@ -78,15 +78,20 @@ CLASS zcl_trm_transport DEFINITION RAISING zcx_trm_exception. METHODS set_documentation - IMPORTING it_doc TYPE tyt_tline + 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 + 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. @@ -308,7 +313,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. ENDMETHOD. METHOD find_object_lock. - DATA: ls_e070 TYPE e070, + DATA: ls_e070 TYPE e070, lv_trkorr TYPE trkorr. SELECT SINGLE e070~trkorr e070~strkorr FROM e071 @@ -495,4 +500,18 @@ CLASS zcl_trm_transport IMPLEMENTATION. 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_utility.clas.abap b/src/zcl_trm_utility.clas.abap index 3d26084..a55e4ac 100644 --- a/src/zcl_trm_utility.clas.abap +++ b/src/zcl_trm_utility.clas.abap @@ -24,6 +24,11 @@ CLASS zcl_trm_utility DEFINITION 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. @@ -48,6 +53,16 @@ CLASS zcl_trm_utility DEFINITION 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. + PROTECTED SECTION. PRIVATE SECTION. CLASS-METHODS enqueue @@ -122,6 +137,18 @@ CLASS zcl_trm_utility IMPLEMENTATION. 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. @@ -189,4 +216,23 @@ CLASS zcl_trm_utility IMPLEMENTATION. 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. + ENDCLASS. diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index cf36ce8..c3a46e2 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -1624,76 +1624,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 @@ -1730,99 +1664,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 @@ -1852,7 +1698,10 @@ TRM_RFC_UNAUTHORIZED - FACTORY_ERROR + INVALID_INPUT + + + GENERIC @@ -1873,7 +1722,11 @@ X - FACTORY_ERROR + INVALID_INPUT + X + + + GENERIC X @@ -1901,37 +1754,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 @@ -1952,47 +1778,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 @@ -2032,6 +1822,12 @@ TRM_RFC_UNAUTHORIZED + + INVALID_INPUT + + + GENERIC + @@ -2046,6 +1842,14 @@ TRM_RFC_UNAUTHORIZED X + + INVALID_INPUT + X + + + GENERIC + X + diff --git a/src/ztrm.fugr.ztrm_tadir_interface.abap b/src/ztrm.fugr.ztrm_tadir_interface.abap index f091193..9fa6dd5 100644 --- a/src/ztrm.fugr.ztrm_tadir_interface.abap +++ b/src/ztrm.fugr.ztrm_tadir_interface.abap @@ -11,118 +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 *"---------------------------------------------------------------------- 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 131d396..5014bcc 100644 --- a/src/ztrm.fugr.ztrm_tdevc_interface.abap +++ b/src/ztrm.fugr.ztrm_tdevc_interface.abap @@ -7,267 +7,20 @@ FUNCTION ztrm_tdevc_interface. *" VALUE(IV_RM_PARENTCL) TYPE FLAG OPTIONAL *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED -*" FACTORY_ERROR +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - 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( + TRY. + CREATE OBJECT lo_package EXPORTING iv_devclass = iv_devclass. + lo_package->interface( 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. - - - + iv_parentcl = iv_parentcl + iv_rm_parentcl = iv_rm_parentcl + ). + 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 d06be82..2288ad8 100644 --- a/src/ztrm.fugr.ztrm_tr_copy.abap +++ b/src/ztrm.fugr.ztrm_tr_copy.abap @@ -7,63 +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 *"---------------------------------------------------------------------- PERFORM check_auth. - 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. - - + 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 49e44cf..8ae60b4 100644 --- a/src/ztrm.fugr.ztrm_write_binary_file.abap +++ b/src/ztrm.fugr.ztrm_write_binary_file.abap @@ -6,13 +6,19 @@ FUNCTION ztrm_write_binary_file. *" VALUE(IV_FILE) TYPE XSTRING *" EXCEPTIONS *" TRM_RFC_UNAUTHORIZED +*" INVALID_INPUT +*" GENERIC *"---------------------------------------------------------------------- PERFORM check_auth. - OPEN DATASET iv_file_path FOR OUTPUT IN BINARY MODE. - TRANSFER iv_file TO iv_file_path. - CLOSE DATASET iv_file_path. - - + 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. From 3c1e9318ff7dae936e782365a3c442042ee30596 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Wed, 7 Aug 2024 16:41:40 +0000 Subject: [PATCH 10/27] version -> 2.0.0 --- src/zif_trm.intf.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From eab8a2083f2195bb6437d718bc6b3ad3e8036f9d Mon Sep 17 00:00:00 2001 From: simonegaffurini <87023474+simonegaffurini@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:07:45 +0200 Subject: [PATCH 11/27] More info on update --- docs/setup.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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. From 3b9595c64fd1e98617195974e2bf254c98c20133 Mon Sep 17 00:00:00 2001 From: simonegaffurini Date: Wed, 11 Sep 2024 12:48:11 +0200 Subject: [PATCH 12/27] add publish trm workflow --- .github/workflows/publishTrmRelease.yml | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/publishTrmRelease.yml diff --git a/.github/workflows/publishTrmRelease.yml b/.github/workflows/publishTrmRelease.yml new file mode 100644 index 0000000..a6bd159 --- /dev/null +++ b/.github/workflows/publishTrmRelease.yml @@ -0,0 +1,55 @@ +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-samples + - name: Pull from main branch + id: api-request + uses: muhfaris/request-action@v1 + with: + url: ${{ steps.nuveInstance.outputs.webDomain }}/zrestabapgit/pull + body: '{ "repoUrl": "${{ github.repositoryUrl }}", "trkorr": "${{ vars.NUVE_PULL_TRKORR }}" }' + method: POST + - 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: TRM (Transport Request Manager) Server + 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 From e66cbafc40704edf664a072f0ea75e845ab8da94 Mon Sep 17 00:00:00 2001 From: simonegaffurini Date: Wed, 11 Sep 2024 12:49:32 +0200 Subject: [PATCH 13/27] update trm publish workflow --- .github/workflows/publishTrmRelease.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publishTrmRelease.yml b/.github/workflows/publishTrmRelease.yml index a6bd159..4cbfe30 100644 --- a/.github/workflows/publishTrmRelease.yml +++ b/.github/workflows/publishTrmRelease.yml @@ -16,7 +16,7 @@ jobs: password: ${{ secrets.NUVE_PASSWORD }} backup: ${{ vars.NUVE_INSTANCE_BACKUP_NAME }} instanceName: ${{ vars.NUVE_INSTANCE_NAME }} - instanceProject: trm-samples + instanceProject: trm-publish - name: Pull from main branch id: api-request uses: muhfaris/request-action@v1 @@ -39,7 +39,7 @@ jobs: registryAuth: ${{ secrets.TRM_REGISTRY_AUTH }} packageName: trm-server packageVersion: ${{ github.event.release.tag_name }} - description: TRM (Transport Request Manager) Server + description: ${{ vars.TRM_DESCRIPTION }} private: false git: ${{ github.repositoryUrl }} website: https://www.trmregistry.com/ From d71f6ad3471f9a2c62500b748df910b783d01349 Mon Sep 17 00:00:00 2001 From: simonegaffurini Date: Wed, 11 Sep 2024 16:30:43 +0200 Subject: [PATCH 14/27] fix http request --- .github/workflows/publishTrmRelease.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publishTrmRelease.yml b/.github/workflows/publishTrmRelease.yml index 4cbfe30..9906397 100644 --- a/.github/workflows/publishTrmRelease.yml +++ b/.github/workflows/publishTrmRelease.yml @@ -18,12 +18,13 @@ jobs: instanceName: ${{ vars.NUVE_INSTANCE_NAME }} instanceProject: trm-publish - name: Pull from main branch - id: api-request - uses: muhfaris/request-action@v1 + uses: fjogeleit/http-request-action@v1 with: url: ${{ steps.nuveInstance.outputs.webDomain }}/zrestabapgit/pull - body: '{ "repoUrl": "${{ github.repositoryUrl }}", "trkorr": "${{ vars.NUVE_PULL_TRKORR }}" }' - method: POST + 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: From c7c11663db6565d0e13005a8f72e5e15830e9598 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Wed, 9 Oct 2024 17:00:29 +0000 Subject: [PATCH 15/27] update package class --- src/zcl_trm_package.clas.abap | 36 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap index 6496a9b..8194fce 100644 --- a/src/zcl_trm_package.clas.abap +++ b/src/zcl_trm_package.clas.abap @@ -48,7 +48,7 @@ CLASS zcl_trm_package IMPLEMENTATION. MOVE is_data TO ls_data. TRY. - CALL METHOD ('CL_PACKAGE_FACTORY')=>('CREATE_NEW_PACKAGE') + CALL METHOD ('CL_PACKAGE_FACTORY')=>('IF_PACKAGE_FACTORY~CREATE_NEW_PACKAGE') EXPORTING i_reuse_deleted_object = 'X' i_suppress_dialog = 'X' @@ -66,30 +66,24 @@ CLASS zcl_trm_package IMPLEMENTATION. zcx_trm_exception=>raise( ). ENDIF. - TRY. - CALL METHOD lo_package->('SAVE') - EXPORTING - i_suppress_dialog = 'X' - i_suppress_corr_insert = 'X' - 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. + 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. - TRY. - CALL METHOD lo_package->('SET_CHANGEABLE') - EXPORTING - i_changeable = ' ' - i_suppress_dialog = 'X' - 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. + lo_package->set_changeable( + EXPORTING + i_changeable = ' ' + i_suppress_dialog = 'X' + EXCEPTIONS + OTHERS = 1 + ). IF sy-subrc <> 0. zcx_trm_exception=>raise( ). ENDIF. From e92ded7559d04155ff1a08ded14d404f2e10f20f Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Wed, 9 Oct 2024 17:15:22 +0000 Subject: [PATCH 16/27] fix typo --- src/zcl_trm_package.clas.abap | 1 - 1 file changed, 1 deletion(-) diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap index 8194fce..4fc2d77 100644 --- a/src/zcl_trm_package.clas.abap +++ b/src/zcl_trm_package.clas.abap @@ -52,7 +52,6 @@ CLASS zcl_trm_package IMPLEMENTATION. EXPORTING i_reuse_deleted_object = 'X' i_suppress_dialog = 'X' - i_boh = 'X' IMPORTING e_package = lo_package CHANGING From e69006e3e7c2571a234efc82aea4a51a3a5b41cd Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Wed, 9 Oct 2024 18:06:03 +0000 Subject: [PATCH 17/27] add message to exception class --- src/zcx_trm_exception.clas.abap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap index 7112214..090b89a 100644 --- a/src/zcx_trm_exception.clas.abap +++ b/src/zcx_trm_exception.clas.abap @@ -29,6 +29,7 @@ CLASS zcx_trm_exception DEFINITION iv_reason TYPE string OPTIONAL RAISING zcx_trm_exception. + DATA: message TYPE symsg READ-ONLY. PROTECTED SECTION. DATA: gv_reason TYPE string. PRIVATE SECTION. @@ -44,6 +45,7 @@ CLASS zcx_trm_exception IMPLEMENTATION. EXPORTING textid = textid previous = previous. + MOVE-CORRESPONDING sy TO me->message. ENDMETHOD. METHOD reason. From 1a58940f74b336bb3523d972dfccde23d4e8f140 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 10 Oct 2024 12:55:26 +0000 Subject: [PATCH 18/27] add log to exception class --- src/zcl_trm_transport.clas.abap | 21 +++++++++++++++++++++ src/zcx_trm_exception.clas.abap | 13 ++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/zcl_trm_transport.clas.abap b/src/zcl_trm_transport.clas.abap index cdbf41e..07c4c7c 100644 --- a/src/zcl_trm_transport.clas.abap +++ b/src/zcl_trm_transport.clas.abap @@ -299,16 +299,37 @@ CLASS zcl_trm_transport IMPLEMENTATION. 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 IS NOT INITIAL. + 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. diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap index 090b89a..161042c 100644 --- a/src/zcx_trm_exception.clas.abap +++ b/src/zcx_trm_exception.clas.abap @@ -4,6 +4,7 @@ CLASS zcx_trm_exception DEFINITION CREATE PROTECTED . PUBLIC SECTION. + TYPES: tyt_log TYPE STANDARD TABLE OF tdline WITH DEFAULT KEY. CONSTANTS: BEGIN OF c_reason, @@ -24,14 +25,19 @@ CLASS zcx_trm_exception DEFINITION 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. + DATA: gv_reason TYPE string, + gt_log TYPE tyt_log. PRIVATE SECTION. ENDCLASS. @@ -56,6 +62,10 @@ CLASS zcx_trm_exception IMPLEMENTATION. 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. @@ -63,6 +73,7 @@ CLASS zcx_trm_exception IMPLEMENTATION. ENDIF. CREATE OBJECT lo_exc. lo_exc->gv_reason = iv_reason. + lo_exc->gt_log = it_log. RAISE EXCEPTION lo_exc. ENDMETHOD. From 41fbdd8ca588ee284e457a822ab7687c793d1ba7 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Thu, 10 Oct 2024 15:32:24 +0000 Subject: [PATCH 19/27] update transport forward error --- src/zcl_trm_transport.clas.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zcl_trm_transport.clas.abap b/src/zcl_trm_transport.clas.abap index 07c4c7c..1f35b16 100644 --- a/src/zcl_trm_transport.clas.abap +++ b/src/zcl_trm_transport.clas.abap @@ -318,7 +318,7 @@ CLASS zcl_trm_transport IMPLEMENTATION. OTHERS = 1. IF sy-subrc <> 0. zcx_trm_exception=>raise( ). - ELSEIF ls_exception IS NOT INITIAL. + 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. From 6f5ce583fda406d77f250737f1f40ccb9c8bafe5 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Tue, 5 Nov 2024 19:23:45 +0000 Subject: [PATCH 20/27] add namespace method --- src/zcl_trm_utility.clas.abap | 46 ++++++++++++++++++++- src/zcx_trm_exception.clas.abap | 1 + src/ztrm.fugr.lztrmf01.abap | 2 + src/ztrm.fugr.xml | 58 +++++++++++++++++++++++++++ src/ztrm.fugr.ztrm_add_namespace.abap | 26 ++++++++++++ 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 src/ztrm.fugr.ztrm_add_namespace.abap diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap index a55e4ac..9505347 100644 --- a/src/zcl_trm_utility.clas.abap +++ b/src/zcl_trm_utility.clas.abap @@ -6,7 +6,8 @@ CLASS zcl_trm_utility DEFINITION 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_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. @@ -63,6 +64,12 @@ CLASS zcl_trm_utility DEFINITION 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. + PROTECTED SECTION. PRIVATE SECTION. CLASS-METHODS enqueue @@ -235,4 +242,41 @@ CLASS zcl_trm_utility IMPLEMENTATION. 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. + 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. + ENDCLASS. diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap index 161042c..50d7b45 100644 --- a/src/zcx_trm_exception.clas.abap +++ b/src/zcx_trm_exception.clas.abap @@ -15,6 +15,7 @@ CLASS zcx_trm_exception DEFINITION 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', END OF c_reason . METHODS constructor diff --git a/src/ztrm.fugr.lztrmf01.abap b/src/ztrm.fugr.lztrmf01.abap index 2b96d5f..18a98e0 100644 --- a/src/ztrm.fugr.lztrmf01.abap +++ b/src/ztrm.fugr.lztrmf01.abap @@ -26,6 +26,8 @@ FORM handle_exception. 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-insert_error. + MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING insert_error. WHEN OTHERS. MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING generic. ENDCASE. diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index c3a46e2..60558ad 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -317,6 +317,64 @@ + + ZTRM_ADD_NAMESPACE + R + Add namespace + + + IV_NAMESPACE + NAMESPACE + + + IV_REPLICENSE + TRNLICENSE + + + + + IT_TEXTS + TRNSPACETT + + + + + TRM_RFC_UNAUTHORIZED + + + INSERT_ERROR + + + GENERIC + + + + + IV_NAMESPACE + P + + + IV_REPLICENSE + P + + + IT_TEXTS + P + + + TRM_RFC_UNAUTHORIZED + X + + + INSERT_ERROR + X + + + GENERIC + X + + + ZTRM_ADD_OBJS_TR R diff --git a/src/ztrm.fugr.ztrm_add_namespace.abap b/src/ztrm.fugr.ztrm_add_namespace.abap new file mode 100644 index 0000000..ef2d9df --- /dev/null +++ b/src/ztrm.fugr.ztrm_add_namespace.abap @@ -0,0 +1,26 @@ +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 +*" INSERT_ERROR +*" 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. From 679ba6f2e87e5c5c377c5d037e2607049ff7ad7c Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Fri, 15 Nov 2024 20:05:26 +0000 Subject: [PATCH 21/27] update table maintenance --- src/ztrm.fugr.lztrmf00.abap | 6 - src/ztrm.fugr.lztrmf00.xml | 19 - src/ztrm.fugr.lztrmf01.abap | 2 - src/ztrm.fugr.lztrmi00.abap | 5 - src/ztrm.fugr.lztrmi00.xml | 19 - src/ztrm.fugr.lztrmt00.abap | 39 - src/ztrm.fugr.lztrmt00.xml | 18 - src/ztrm.fugr.lztrmtop.abap | 2 - src/ztrm.fugr.saplztrm.abap | 5 - src/ztrm.fugr.tableframe_ztrm.abap | 10 - src/ztrm.fugr.tableproc_ztrm.abap | 8 - src/ztrm.fugr.xml | 1335 ------------------------- src/ztrm.fugr.ztrm_add_namespace.abap | 26 - src/ztrm_installdevc.tabl.xml | 1 - src/ztrm_installdevcs.tobj.xml | 42 - src/ztrm_integrity.tabl.xml | 1 - src/ztrm_skip_trkorrs.tobj.xml | 42 - src/ztrm_src_trkorr.tabl.xml | 1 - src/ztrm_src_trkorrs.tobj.xml | 42 - src/ztrm_userss.tobj.xml | 43 - 20 files changed, 1666 deletions(-) delete mode 100644 src/ztrm.fugr.lztrmf00.abap delete mode 100644 src/ztrm.fugr.lztrmf00.xml delete mode 100644 src/ztrm.fugr.lztrmi00.abap delete mode 100644 src/ztrm.fugr.lztrmi00.xml delete mode 100644 src/ztrm.fugr.lztrmt00.abap delete mode 100644 src/ztrm.fugr.lztrmt00.xml delete mode 100644 src/ztrm.fugr.tableframe_ztrm.abap delete mode 100644 src/ztrm.fugr.tableproc_ztrm.abap delete mode 100644 src/ztrm.fugr.ztrm_add_namespace.abap delete mode 100644 src/ztrm_installdevcs.tobj.xml delete mode 100644 src/ztrm_skip_trkorrs.tobj.xml delete mode 100644 src/ztrm_src_trkorrs.tobj.xml delete mode 100644 src/ztrm_userss.tobj.xml 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 index 18a98e0..2b96d5f 100644 --- a/src/ztrm.fugr.lztrmf01.abap +++ b/src/ztrm.fugr.lztrmf01.abap @@ -26,8 +26,6 @@ FORM handle_exception. 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-insert_error. - MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING insert_error. WHEN OTHERS. MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 RAISING generic. ENDCASE. 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.lztrmt00.xml b/src/ztrm.fugr.lztrmt00.xml deleted file mode 100644 index ed75861..0000000 --- a/src/ztrm.fugr.lztrmt00.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - LZTRMT00 - S - D$ - I - S - E - X - D$S - X - - - - diff --git a/src/ztrm.fugr.lztrmtop.abap b/src/ztrm.fugr.lztrmtop.abap index 3828760..44e6b9b 100644 --- a/src/ztrm.fugr.lztrmtop.abap +++ b/src/ztrm.fugr.lztrmtop.abap @@ -1,8 +1,6 @@ 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, diff --git a/src/ztrm.fugr.saplztrm.abap b/src/ztrm.fugr.saplztrm.abap index fe4ab25..1f5d059 100644 --- a/src/ztrm.fugr.saplztrm.abap +++ b/src/ztrm.fugr.saplztrm.abap @@ -46,9 +46,4 @@ * INCLUDE LZTRME... " Events * INCLUDE LZTRMP... " Local class implement. * INCLUDE LZTRMT99. " ABAP Unit tests - INCLUDE LZTRMF00 . " subprograms INCLUDE LZTRMF01 . " subprograms - INCLUDE LZTRMI00 . " PAI modules - INCLUDE LSVIMFXX . " subprograms - INCLUDE LSVIMOXX . " PBO modules - INCLUDE LSVIMIXX . " PAI modules 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 60558ad..3c0069b 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -4,269 +4,11 @@ TRM Functions - LZTRMF00 LZTRMF01 - LZTRMI00 - LZTRMT00 LZTRMTOP SAPLZTRM - - TABLEFRAME_ZTRM - Upper-level extended table maintenance - - - VIEW_ACTION - 'S' - - - VIEW_NAME - DD02V-TABNAME - - - CORR_NUMBER - E070-TRKORR - ' ' - - - - - DBA_SELLIST - VIMSELLIST - - - DPL_SELLIST - VIMSELLIST - - - EXCL_CUA_FUNCT - VIMEXCLFUN - - - X_HEADER - VIMDESC - - - X_NAMTAB - VIMNAMTAB - - - - - MISSING_CORR_NUMBER - - - - - 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 - - - SAVING_CORRECTION_FAILED - - - - - 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 - P - Tabelle, mit allen von der DB gelesenen Daten - - - X_HEADER - P - Kontrollblocktabelle für die Tabelle - - - X_NAMTAB - P - Kontrollblocktabelle für die Tabellen-Felder - - - MISSING_CORR_NUMBER - X - Korrekturnummer fehlt - - - SAVING_CORRECTION_FAILED - X - Fehler beim Sichern der Korrektureinträge - - - ZTRM_ADD_LANG_TR R @@ -317,64 +59,6 @@ - - ZTRM_ADD_NAMESPACE - R - Add namespace - - - IV_NAMESPACE - NAMESPACE - - - IV_REPLICENSE - TRNLICENSE - - - - - IT_TEXTS - TRNSPACETT - - - - - TRM_RFC_UNAUTHORIZED - - - INSERT_ERROR - - - GENERIC - - - - - IV_NAMESPACE - P - - - IV_REPLICENSE - P - - - IT_TEXTS - P - - - TRM_RFC_UNAUTHORIZED - X - - - INSERT_ERROR - X - - - GENERIC - X - - - ZTRM_ADD_OBJS_TR R @@ -1911,1025 +1595,6 @@ - - -
- 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_namespace.abap b/src/ztrm.fugr.ztrm_add_namespace.abap deleted file mode 100644 index ef2d9df..0000000 --- a/src/ztrm.fugr.ztrm_add_namespace.abap +++ /dev/null @@ -1,26 +0,0 @@ -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 -*" INSERT_ERROR -*" 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_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 - - - - - From 2967a77fc5468e208532f04eb214865624a35f9c Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Tue, 19 Nov 2024 18:00:24 +0000 Subject: [PATCH 22/27] update package with tadir entry --- src/zcl_trm_package.clas.abap | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap index 4fc2d77..7e2fa5e 100644 --- a/src/zcl_trm_package.clas.abap +++ b/src/zcl_trm_package.clas.abap @@ -47,6 +47,13 @@ CLASS zcl_trm_package IMPLEMENTATION. 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 @@ -87,6 +94,28 @@ CLASS zcl_trm_package IMPLEMENTATION. 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. From 3e5a3456a8def897108970a2be4837eb43b7a16b Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Wed, 20 Nov 2024 18:10:42 +0000 Subject: [PATCH 23/27] add r3trans info command --- src/zcl_trm_utility.clas.abap | 21 +++++++++++++ src/zcx_trm_exception.clas.abap | 1 + src/ztrm.fugr.lztrmf01.abap | 2 ++ src/ztrm.fugr.xml | 40 ++++++++++++++++++++++++ src/ztrm.fugr.ztrm_get_r3trans_info.abap | 19 +++++++++++ 5 files changed, 83 insertions(+) create mode 100644 src/ztrm.fugr.ztrm_get_r3trans_info.abap diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap index 9505347..9860b4f 100644 --- a/src/zcl_trm_utility.clas.abap +++ b/src/zcl_trm_utility.clas.abap @@ -70,6 +70,10 @@ CLASS zcl_trm_utility DEFINITION 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 @@ -279,4 +283,21 @@ CLASS zcl_trm_utility IMPLEMENTATION. 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 RESPECTING BLANKS SEPARATED BY cl_abap_char_utilities=>newline. + ENDMETHOD. + ENDCLASS. diff --git a/src/zcx_trm_exception.clas.abap b/src/zcx_trm_exception.clas.abap index 50d7b45..b1ec1d6 100644 --- a/src/zcx_trm_exception.clas.abap +++ b/src/zcx_trm_exception.clas.abap @@ -16,6 +16,7 @@ CLASS zcx_trm_exception DEFINITION 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 diff --git a/src/ztrm.fugr.lztrmf01.abap b/src/ztrm.fugr.lztrmf01.abap index 2b96d5f..a7e57c9 100644 --- a/src/ztrm.fugr.lztrmf01.abap +++ b/src/ztrm.fugr.lztrmf01.abap @@ -26,6 +26,8 @@ FORM handle_exception. 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. diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index 3c0069b..c9e83d5 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -820,6 +820,46 @@
+ + 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 + + + ZTRM_GET_TRANSPORT_LAYER R 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. From 5e3341eaa6d5a6cce0588464f5802c885cfe020e Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Wed, 20 Nov 2024 19:09:59 +0000 Subject: [PATCH 24/27] fix blank spaces --- src/zcl_trm_utility.clas.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap index 9860b4f..109eb62 100644 --- a/src/zcl_trm_utility.clas.abap +++ b/src/zcl_trm_utility.clas.abap @@ -297,7 +297,7 @@ CLASS zcl_trm_utility IMPLEMENTATION. zcx_trm_exception=>raise( iv_reason = zcx_trm_exception=>c_reason-r3trans_cmd_error ). ENDIF. - CONCATENATE LINES OF result INTO rv_r3trans RESPECTING BLANKS SEPARATED BY cl_abap_char_utilities=>newline. + CONCATENATE LINES OF result INTO rv_r3trans SEPARATED BY cl_abap_char_utilities=>newline. ENDMETHOD. ENDCLASS. From 4bfc16cc1d5f899339e55279b99fd7ba20f086fe Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Fri, 22 Nov 2024 16:58:07 +0000 Subject: [PATCH 25/27] add transport layer tdevc interface --- src/zcl_trm_package.clas.abap | 26 ++++++++++++++++++++++--- src/ztrm.fugr.xml | 9 +++++++++ src/ztrm.fugr.ztrm_tdevc_interface.abap | 18 +++++++++-------- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/zcl_trm_package.clas.abap b/src/zcl_trm_package.clas.abap index 7e2fa5e..c85c60a 100644 --- a/src/zcl_trm_package.clas.abap +++ b/src/zcl_trm_package.clas.abap @@ -20,6 +20,7 @@ CLASS zcl_trm_package DEFINITION 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. @@ -219,11 +220,11 @@ CLASS zcl_trm_package IMPLEMENTATION. 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 - 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 = gv_devclass. modify_package_data( @@ -234,6 +235,9 @@ CLASS zcl_trm_package IMPLEMENTATION. 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( @@ -279,6 +283,22 @@ CLASS zcl_trm_package IMPLEMENTATION. 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/ztrm.fugr.xml b/src/ztrm.fugr.xml index c9e83d5..327c1ff 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -1474,6 +1474,11 @@ X FLAG + + IV_DEVLAYER + X + DEVLAYER + @@ -1499,6 +1504,10 @@ IV_RM_PARENTCL P + + IV_DEVLAYER + P + TRM_RFC_UNAUTHORIZED X diff --git a/src/ztrm.fugr.ztrm_tdevc_interface.abap b/src/ztrm.fugr.ztrm_tdevc_interface.abap index 5014bcc..dae335b 100644 --- a/src/ztrm.fugr.ztrm_tdevc_interface.abap +++ b/src/ztrm.fugr.ztrm_tdevc_interface.abap @@ -5,6 +5,7 @@ FUNCTION ztrm_tdevc_interface. *" 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 *" INVALID_INPUT @@ -13,14 +14,15 @@ FUNCTION ztrm_tdevc_interface. 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 - ). - CATCH zcx_trm_exception INTO lo_exc. - PERFORM handle_exception. + 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. From 5a711b04d6375472a681c0b92ba3ad5d1dc10954 Mon Sep 17 00:00:00 2001 From: Simone Gaffurini Date: Wed, 27 Nov 2024 20:05:32 +0000 Subject: [PATCH 26/27] fix missing namespace methods --- src/zcl_trm_utility.clas.abap | 1 + src/ztrm.fugr.xml | 58 +++++++++++++++++++++++++++ src/ztrm.fugr.ztrm_add_namespace.abap | 27 +++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 src/ztrm.fugr.ztrm_add_namespace.abap diff --git a/src/zcl_trm_utility.clas.abap b/src/zcl_trm_utility.clas.abap index 109eb62..1c3581c 100644 --- a/src/zcl_trm_utility.clas.abap +++ b/src/zcl_trm_utility.clas.abap @@ -254,6 +254,7 @@ CLASS zcl_trm_utility IMPLEMENTATION. 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 ). diff --git a/src/ztrm.fugr.xml b/src/ztrm.fugr.xml index 327c1ff..83e9541 100644 --- a/src/ztrm.fugr.xml +++ b/src/ztrm.fugr.xml @@ -59,6 +59,64 @@ + + ZTRM_ADD_NAMESPACE + R + Add namespace + + + IV_NAMESPACE + NAMESPACE + + + IV_REPLICENSE + TRNLICENSE + + + + + IT_TEXTS + TRNSPACETT + + + + + TRM_RFC_UNAUTHORIZED + + + INVALID_INPUT + + + GENERIC + + + + + IV_NAMESPACE + P + + + IV_REPLICENSE + P + + + IT_TEXTS + P + + + TRM_RFC_UNAUTHORIZED + X + + + INVALID_INPUT + X + + + GENERIC + X + + + ZTRM_ADD_OBJS_TR R 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. From 6bad0360c37058ecae386f40cc58535807b49b36 Mon Sep 17 00:00:00 2001 From: simonegaffurini <87023474+simonegaffurini@users.noreply.github.com> Date: Fri, 29 Nov 2024 18:47:15 +0100 Subject: [PATCH 27/27] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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.