mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 11:46:38 +08:00
BRF+ System Application (#4856)
* BRF+ System Application - Clear user/time/system-specific fields - Fix deletion of object - Remove unnecessary "exists check" - Updated test case https://github.com/abapGit-tests/FDT0 * Lint * Lint * WEBI: Improve error handling Pass messages to log * Reverse WEBI Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
73496a2755
commit
ab3f24fe06
|
@ -3,10 +3,10 @@ CLASS zcl_abapgit_object_fdt0 DEFINITION
|
|||
INHERITING FROM zcl_abapgit_objects_super
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
INTERFACES zif_abapgit_object .
|
||||
ALIASES mo_files
|
||||
FOR zif_abapgit_object~mo_files .
|
||||
PROTECTED SECTION.
|
||||
|
||||
PRIVATE SECTION.
|
||||
|
@ -32,6 +32,14 @@ CLASS zcl_abapgit_object_fdt0 DEFINITION
|
|||
!co_ixml_element TYPE REF TO if_ixml_element
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS set_field
|
||||
IMPORTING
|
||||
!iv_name TYPE string
|
||||
!iv_value TYPE string DEFAULT ''
|
||||
CHANGING
|
||||
!co_ixml_element TYPE REF TO if_ixml_element
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
|
@ -42,10 +50,13 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
METHOD before_xml_deserialize.
|
||||
|
||||
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
|
||||
DATA lv_package_xml_value TYPE string.
|
||||
DATA lv_timestamp TYPE timestamp.
|
||||
DATA lv_transport TYPE string.
|
||||
DATA lv_dlvunit TYPE tdevc-dlvunit.
|
||||
DATA lo_node_local TYPE REF TO if_ixml_element.
|
||||
DATA lo_node_package TYPE REF TO if_ixml_element.
|
||||
DATA lo_node_id TYPE REF TO if_ixml_element.
|
||||
DATA lo_xml_element TYPE REF TO if_ixml_element.
|
||||
DATA lv_count TYPE i.
|
||||
|
||||
lo_node_local = co_dom_tree->find_from_name( name = 'Local'
|
||||
|
@ -56,16 +67,15 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
ENDIF.
|
||||
|
||||
lo_node_package = co_dom_tree->find_from_name(
|
||||
name = 'DevelopmentPackage'
|
||||
namespace = 'FDTNS' ).
|
||||
name = 'DevelopmentPackage'
|
||||
namespace = 'FDTNS' ).
|
||||
IF lo_node_package IS BOUND.
|
||||
lv_package_xml_value = iv_package.
|
||||
lo_node_package->set_value( value = lv_package_xml_value ).
|
||||
lo_node_package->set_value( value = |{ iv_package }| ).
|
||||
ENDIF.
|
||||
|
||||
lo_node_id = co_dom_tree->find_from_name(
|
||||
name = 'ApplicationId'
|
||||
namespace = 'FDTNS' ).
|
||||
name = 'ApplicationId'
|
||||
namespace = 'FDTNS' ).
|
||||
IF lo_node_id IS BOUND.
|
||||
lv_application_id = lo_node_id->get_value( ).
|
||||
SELECT COUNT( * ) FROM fdt_admn_0000s INTO lv_count
|
||||
|
@ -75,14 +85,141 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
ev_create = boolc( lv_count = 0 ).
|
||||
ENDIF.
|
||||
|
||||
" Fill in user/time/system-specific fields
|
||||
GET TIME STAMP FIELD lv_timestamp.
|
||||
lv_transport = |${ sy-sysid }0000000000000001|.
|
||||
|
||||
lo_xml_element = co_dom_tree->get_root_element( ).
|
||||
|
||||
IF ev_create = abap_true.
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'CreationUser'
|
||||
iv_value = |{ sy-uname }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'CreationTimestamp'
|
||||
iv_value = |{ lv_timestamp }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
ENDIF.
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'ChangeUser'
|
||||
iv_value = |{ sy-uname }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'ChangeTimestamp'
|
||||
iv_value = |{ lv_timestamp }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'User'
|
||||
iv_value = |{ sy-uname }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Timestamp'
|
||||
iv_value = |{ lv_timestamp }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trrequest'
|
||||
iv_value = lv_transport
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trversion'
|
||||
iv_value = '000001'
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trtimestamp'
|
||||
iv_value = |{ lv_timestamp }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trsysid'
|
||||
iv_value = |{ sy-sysid }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trclient'
|
||||
iv_value = |{ sy-mandt }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'OversId'
|
||||
iv_value = |{ lv_application_id }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
|
||||
SELECT SINGLE dlvunit FROM tdevc INTO lv_dlvunit WHERE devclass = iv_package.
|
||||
IF sy-subrc = 0.
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'SoftwareComponent'
|
||||
iv_value = |{ lv_dlvunit }|
|
||||
CHANGING
|
||||
co_ixml_element = lo_xml_element ).
|
||||
ENDIF.
|
||||
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'Client'
|
||||
value = |{ sy-mandt }| ).
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'Date'
|
||||
value = |{ sy-datum }| ).
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'SAPRelease'
|
||||
value = |{ sy-saprl }| ).
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'Server'
|
||||
value = |{ sy-host }| ).
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'SourceExportReqID'
|
||||
value = lv_transport ).
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'SystemID'
|
||||
value = |{ sy-sysid }| ).
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'Time'
|
||||
value = |{ sy-uzeit }| ).
|
||||
lo_xml_element->set_attribute(
|
||||
name = 'User'
|
||||
value = |{ sy-uname }| ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD check_is_local.
|
||||
|
||||
SELECT SINGLE local_object FROM fdt_admn_0000s INTO rv_is_local
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name.
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
@ -97,14 +234,146 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
co_ixml_element->remove_child( old_child = lo_components_node ).
|
||||
ENDIF.
|
||||
|
||||
" Clear user/time/system-specific fields
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'CreationUser'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'CreationTimestamp'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'ChangeUser'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'ChangeTimestamp'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'User'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Timestamp'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trrequest'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trversion'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trtimestamp'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trsysid'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'Trclient'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'OversId'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'SoftwareComponent'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
set_field(
|
||||
EXPORTING
|
||||
iv_name = 'DevelopmentPackage'
|
||||
CHANGING
|
||||
co_ixml_element = co_ixml_element ).
|
||||
|
||||
" Clear attributes of root FDTNS:Fdt node
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'Client'
|
||||
value = '' ).
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'Date'
|
||||
value = '' ).
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'SAPRelease'
|
||||
value = '' ).
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'Server'
|
||||
value = '' ).
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'SourceExportReqID'
|
||||
value = '' ).
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'SystemID'
|
||||
value = '' ).
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'Time'
|
||||
value = '' ).
|
||||
co_ixml_element->set_attribute(
|
||||
name = 'User'
|
||||
value = '' ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD get_application_id.
|
||||
|
||||
SELECT SINGLE application_id FROM fdt_admn_0000s INTO rv_application_id
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name.
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD set_field.
|
||||
|
||||
DATA:
|
||||
lo_node_collection TYPE REF TO if_ixml_node_collection,
|
||||
lo_node TYPE REF TO if_ixml_node,
|
||||
lv_index TYPE i.
|
||||
|
||||
lo_node_collection = co_ixml_element->get_elements_by_tag_name(
|
||||
namespace = 'FDTNS'
|
||||
name = iv_name ).
|
||||
|
||||
lv_index = 0.
|
||||
WHILE lv_index < lo_node_collection->get_length( ).
|
||||
lo_node = lo_node_collection->get_item( lv_index ).
|
||||
lo_node->set_value( iv_value ).
|
||||
lv_index = lv_index + 1.
|
||||
ENDWHILE.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
@ -114,8 +383,8 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
DATA lv_ch_user TYPE fdt_admn_0000s-ch_user.
|
||||
|
||||
SELECT SINGLE ch_user FROM fdt_admn_0000s INTO lv_ch_user
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name.
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name.
|
||||
|
||||
rv_user = lv_ch_user.
|
||||
|
||||
|
@ -126,59 +395,98 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
|
||||
DATA lv_is_local TYPE abap_bool.
|
||||
DATA lv_ordernum TYPE trkorr.
|
||||
DATA lt_application_sel TYPE if_fdt_query=>ts_selection.
|
||||
DATA ls_application_sel TYPE if_fdt_query=>s_selection.
|
||||
DATA lt_application_id TYPE TABLE OF fdt_admn_0000s-application_id.
|
||||
DATA ls_object_category_sel TYPE if_fdt_query=>s_object_category_sel.
|
||||
DATA lv_failure TYPE abap_bool.
|
||||
|
||||
IF zif_abapgit_object~exists( ) = abap_false.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
|
||||
|
||||
lv_is_local = check_is_local( ).
|
||||
IF lv_is_local = abap_false.
|
||||
lv_ordernum = zcl_abapgit_default_transport=>get_instance( )->get( )-ordernum.
|
||||
ENDIF.
|
||||
|
||||
ls_application_sel-queryfield = 'NAME'.
|
||||
ls_application_sel-sign = 'I'.
|
||||
ls_application_sel-option = 'EQ'.
|
||||
ls_application_sel-low = ms_item-obj_name.
|
||||
INSERT ls_application_sel INTO TABLE lt_application_sel.
|
||||
SELECT application_id FROM fdt_admn_0000s INTO TABLE lt_application_id
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name.
|
||||
|
||||
ls_object_category_sel-system_objects = 'X'.
|
||||
|
||||
TRY.
|
||||
IF lv_is_local = abap_true.
|
||||
|
||||
IF lv_is_local = abap_true. "Local Object
|
||||
|
||||
cl_fdt_delete_handling=>delete_logical_via_job(
|
||||
cl_fdt_delete_handling=>mark_for_delete_via_job(
|
||||
EXPORTING
|
||||
its_application_selection = lt_application_sel
|
||||
iv_retention_time = 0
|
||||
iv_background = abap_true
|
||||
iv_local_option = '1'
|
||||
iv_appl_transported_option = '2'
|
||||
iv_obj_transported_option = '2'
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
ita_application_id = lt_application_id
|
||||
iv_background = abap_true
|
||||
iv_local_option = '1'
|
||||
iv_appl_transported_option = '2'
|
||||
iv_obj_transported_option = '2'
|
||||
IMPORTING
|
||||
ev_failure = lv_failure ).
|
||||
ev_failure = lv_failure ).
|
||||
IF lv_failure IS INITIAL.
|
||||
cl_fdt_delete_handling=>delete_logical_via_job(
|
||||
EXPORTING
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
ita_application_id = lt_application_id
|
||||
iv_retention_time = 0
|
||||
iv_background = abap_true
|
||||
iv_local_option = '1'
|
||||
iv_appl_transported_option = '2'
|
||||
iv_obj_transported_option = '2'
|
||||
IMPORTING
|
||||
ev_failure = lv_failure ).
|
||||
IF lv_failure IS INITIAL.
|
||||
cl_fdt_delete_handling=>delete_physical_via_job(
|
||||
EXPORTING
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
ita_application_id = lt_application_id
|
||||
iv_retention_time = 0
|
||||
iv_background = abap_true
|
||||
iv_local_option = '1'
|
||||
iv_appl_transported_option = '2'
|
||||
IMPORTING
|
||||
ev_failure = lv_failure ).
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
ELSE.
|
||||
|
||||
ELSE. "Transportable Object
|
||||
|
||||
cl_fdt_delete_handling=>delete_logical_via_job(
|
||||
EXPORTING
|
||||
its_application_selection = lt_application_sel
|
||||
iv_retention_time = 0
|
||||
iv_background = abap_true
|
||||
iv_local_option = '2'
|
||||
cl_fdt_delete_handling=>mark_for_delete_via_job(
|
||||
EXPORTING
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
ita_application_id = lt_application_id
|
||||
iv_background = abap_true
|
||||
iv_local_option = '2'
|
||||
iv_appl_transported_option = '1'
|
||||
iv_obj_transported_option = '1'
|
||||
IMPORTING
|
||||
ev_failure = lv_failure ).
|
||||
IF lv_failure IS INITIAL.
|
||||
cl_fdt_delete_handling=>delete_logical_via_job(
|
||||
EXPORTING
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
ita_application_id = lt_application_id
|
||||
iv_retention_time = 0
|
||||
iv_background = abap_true
|
||||
iv_local_option = '2'
|
||||
iv_appl_transported_option = '1'
|
||||
iv_obj_transported_option = '1'
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
iv_transport_request_w = lv_ordernum
|
||||
IMPORTING
|
||||
ev_failure = lv_failure ).
|
||||
iv_obj_transported_option = '1'
|
||||
IMPORTING
|
||||
ev_failure = lv_failure ).
|
||||
IF lv_failure IS INITIAL.
|
||||
cl_fdt_delete_handling=>delete_physical_via_job(
|
||||
EXPORTING
|
||||
is_object_category_sel = ls_object_category_sel
|
||||
ita_application_id = lt_application_id
|
||||
iv_retention_time = 0
|
||||
iv_background = abap_true
|
||||
iv_local_option = '2'
|
||||
iv_appl_transported_option = '1'
|
||||
IMPORTING
|
||||
ev_failure = lv_failure ).
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
ENDIF.
|
||||
|
||||
|
@ -186,7 +494,8 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
zcx_abapgit_exception=>raise( |Error deleting { ms_item-obj_type } { ms_item-obj_name }| ).
|
||||
ENDIF.
|
||||
|
||||
CATCH cx_fdt_input. "
|
||||
CATCH cx_fdt_input INTO lx_fdt_input.
|
||||
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
@ -195,12 +504,13 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
METHOD zif_abapgit_object~deserialize.
|
||||
|
||||
DATA lo_dexc TYPE REF TO if_fdt_data_exchange.
|
||||
DATA lx_root TYPE REF TO cx_root.
|
||||
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
|
||||
DATA lo_dom_tree TYPE REF TO if_ixml_document.
|
||||
DATA lv_is_local TYPE abap_bool.
|
||||
DATA lv_ordernum TYPE trkorr.
|
||||
DATA lt_message TYPE if_fdt_types=>t_message.
|
||||
DATA lv_create TYPE abap_bool.
|
||||
|
||||
FIELD-SYMBOLS <ls_message> TYPE if_fdt_types=>s_message.
|
||||
|
||||
lo_dom_tree = io_xml->get_raw( ).
|
||||
|
@ -223,11 +533,11 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
lo_dexc->import_xml(
|
||||
EXPORTING
|
||||
io_dom_tree = lo_dom_tree
|
||||
iv_create = lv_create
|
||||
iv_create = lv_create
|
||||
iv_activate = abap_true
|
||||
iv_simulate = abap_false
|
||||
IMPORTING
|
||||
et_message = lt_message ).
|
||||
et_message = lt_message ).
|
||||
|
||||
ELSE. "Transportable Object
|
||||
|
||||
|
@ -235,24 +545,24 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
|
||||
lo_dexc->import_xml(
|
||||
EXPORTING
|
||||
io_dom_tree = lo_dom_tree
|
||||
iv_create = lv_create
|
||||
iv_activate = abap_true
|
||||
iv_simulate = abap_false
|
||||
io_dom_tree = lo_dom_tree
|
||||
iv_create = lv_create
|
||||
iv_activate = abap_true
|
||||
iv_simulate = abap_false
|
||||
iv_workbench_trrequest = lv_ordernum
|
||||
IMPORTING
|
||||
et_message = lt_message ).
|
||||
et_message = lt_message ).
|
||||
|
||||
ENDIF.
|
||||
|
||||
LOOP AT lt_message ASSIGNING <ls_message>.
|
||||
ii_log->add(
|
||||
iv_msg = <ls_message>-text
|
||||
iv_type = <ls_message>-msgty ).
|
||||
iv_msg = <ls_message>-text
|
||||
iv_type = <ls_message>-msgty ).
|
||||
ENDLOOP.
|
||||
|
||||
CATCH cx_fdt_input INTO lx_root. "
|
||||
zcx_abapgit_exception=>raise( lx_root->get_text( ) ).
|
||||
CATCH cx_fdt_input INTO lx_fdt_input.
|
||||
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
@ -263,9 +573,9 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
DATA lv_count TYPE i.
|
||||
|
||||
SELECT COUNT( * ) FROM fdt_admn_0000s INTO lv_count
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name
|
||||
AND deleted = ''.
|
||||
WHERE object_type = 'AP'
|
||||
AND name = ms_item-obj_name
|
||||
AND deleted = ''.
|
||||
|
||||
rv_bool = boolc( lv_count > 0 ).
|
||||
|
||||
|
@ -292,16 +602,13 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
|
||||
|
||||
METHOD zif_abapgit_object~get_deserialize_steps.
|
||||
|
||||
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD zif_abapgit_object~get_metadata.
|
||||
|
||||
rs_metadata = get_metadata( ).
|
||||
|
||||
rs_metadata-delete_tadir = abap_true.
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
@ -311,16 +618,21 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
|
||||
DATA lo_instance TYPE REF TO if_fdt_admin_data.
|
||||
DATA lt_version TYPE if_fdt_admin_data=>ts_version.
|
||||
DATA lv_index LIKE sy-tabix.
|
||||
DATA lv_index TYPE sy-tabix.
|
||||
|
||||
FIELD-SYMBOLS <ls_version> LIKE LINE OF lt_version.
|
||||
|
||||
lv_application_id = get_application_id( ).
|
||||
|
||||
TRY.
|
||||
cl_fdt_factory=>get_instance_generic( EXPORTING iv_id = lv_application_id
|
||||
IMPORTING eo_instance = lo_instance ).
|
||||
CATCH cx_fdt_input INTO lx_fdt_input. "
|
||||
zcx_abapgit_exception=>raise( lx_fdt_input->get_text( ) ).
|
||||
cl_fdt_factory=>get_instance_generic(
|
||||
EXPORTING
|
||||
iv_id = lv_application_id
|
||||
IMPORTING
|
||||
eo_instance = lo_instance ).
|
||||
|
||||
CATCH cx_fdt_input INTO lx_fdt_input.
|
||||
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
|
||||
ENDTRY.
|
||||
|
||||
lo_instance->get_versions( IMPORTING ets_version = lt_version ).
|
||||
|
@ -333,11 +645,15 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
|
||||
|
||||
METHOD zif_abapgit_object~is_locked.
|
||||
|
||||
DATA lv_application_id TYPE string.
|
||||
|
||||
lv_application_id = get_application_id( ).
|
||||
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'FDT_ENQUEUE_ID'
|
||||
iv_argument = |$ST{ lv_application_id }| ).
|
||||
|
||||
rv_is_locked = exists_a_lock_entry_for(
|
||||
iv_lock_object = 'FDT_ENQUEUE_ID'
|
||||
iv_argument = |$ST{ lv_application_id }| ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
@ -354,7 +670,7 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
lo_fdt_wd = cl_fdt_wd_factory=>if_fdt_wd_factory~get_instance( ).
|
||||
lo_fdt_wd->get_ui_execution( )->execute_workbench( iv_id = lv_application_id ).
|
||||
CATCH cx_root INTO lx_root.
|
||||
zcx_abapgit_exception=>raise( lx_root->get_text( ) ).
|
||||
zcx_abapgit_exception=>raise_with_text( lx_root ).
|
||||
ENDTRY.
|
||||
ELSE.
|
||||
zcx_abapgit_exception=>raise( 'Could not open BRF+ Workbench' ).
|
||||
|
@ -367,7 +683,7 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
|
||||
DATA lo_dexc TYPE REF TO if_fdt_data_exchange.
|
||||
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
|
||||
DATA lx_root TYPE REF TO cx_root.
|
||||
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
|
||||
DATA lv_xml_fdt0_application TYPE string.
|
||||
DATA lo_xml_document TYPE REF TO if_ixml_document.
|
||||
DATA lo_xml_element TYPE REF TO if_ixml_element.
|
||||
|
@ -375,14 +691,15 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
lv_application_id = get_application_id( ).
|
||||
|
||||
lo_dexc = cl_fdt_factory=>if_fdt_factory~get_instance( )->get_data_exchange( ).
|
||||
|
||||
TRY.
|
||||
lo_dexc->export_xml_application(
|
||||
EXPORTING
|
||||
iv_application_id = lv_application_id
|
||||
iv_schema = if_fdt_data_exchange=>gc_xml_schema_type_external
|
||||
iv_xml_version = if_fdt_data_exchange=>gc_xml_version
|
||||
iv_schema = if_fdt_data_exchange=>gc_xml_schema_type_external
|
||||
iv_xml_version = if_fdt_data_exchange=>gc_xml_version
|
||||
IMPORTING
|
||||
ev_string = lv_xml_fdt0_application ).
|
||||
ev_string = lv_xml_fdt0_application ).
|
||||
|
||||
lo_xml_document = cl_ixml_80_20=>parse_to_document( stream_string = lv_xml_fdt0_application ).
|
||||
lo_xml_element = lo_xml_document->get_root_element( ).
|
||||
|
@ -391,8 +708,8 @@ CLASS ZCL_ABAPGIT_OBJECT_FDT0 IMPLEMENTATION.
|
|||
|
||||
io_xml->set_raw( lo_xml_element ).
|
||||
|
||||
CATCH cx_fdt_input INTO lx_root. "
|
||||
zcx_abapgit_exception=>raise( lx_root->get_text( ) ).
|
||||
CATCH cx_fdt_input INTO lx_fdt_input.
|
||||
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
Loading…
Reference in New Issue
Block a user