mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
TYPE: Serialize active version (#4593)
* TYPE: Serialize active version When a new type-pools is created, SAP creates active version by default. SY-SUBRC is always set to 0 for the first function module call as there is always an active version hence, second function will never be called. Remove the second call. * Multiple changes Check existence of the object using TADIR entry If the active object doesn't exist, show proper message * Existence check using PROGDIR * Replace SELECT..ENDSELECT Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
b3de7a5189
commit
1a94c9a0f0
|
@ -11,7 +11,7 @@ CLASS zcl_abapgit_object_type DEFINITION PUBLIC INHERITING FROM zcl_abapgit_obje
|
||||||
METHODS read
|
METHODS read
|
||||||
EXPORTING ev_ddtext TYPE ddtypet-ddtext
|
EXPORTING ev_ddtext TYPE ddtypet-ddtext
|
||||||
et_source TYPE abaptxt255_tab
|
et_source TYPE abaptxt255_tab
|
||||||
RAISING zcx_abapgit_not_found.
|
RAISING zcx_abapgit_exception.
|
||||||
|
|
||||||
METHODS create
|
METHODS create
|
||||||
IMPORTING iv_ddtext TYPE ddtypet-ddtext
|
IMPORTING iv_ddtext TYPE ddtypet-ddtext
|
||||||
|
@ -23,7 +23,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_object_type IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_OBJECT_TYPE IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD create.
|
METHOD create.
|
||||||
|
@ -92,23 +92,7 @@ CLASS zcl_abapgit_object_type IMPLEMENTATION.
|
||||||
reps_not_exist = 2
|
reps_not_exist = 2
|
||||||
OTHERS = 3.
|
OTHERS = 3.
|
||||||
IF sy-subrc <> 0.
|
IF sy-subrc <> 0.
|
||||||
" Inactive version
|
zcx_abapgit_exception=>raise( |No active version found for { ms_item-obj_type } { ms_item-obj_name }| ).
|
||||||
CALL FUNCTION 'TYPD_GET_OBJECT'
|
|
||||||
EXPORTING
|
|
||||||
typdname = lv_typdname
|
|
||||||
r3state = 'I'
|
|
||||||
TABLES
|
|
||||||
psmodisrc = lt_psmodisrc
|
|
||||||
psmodilog = lt_psmodilog
|
|
||||||
psource = et_source
|
|
||||||
ptrdir = lt_ptrdir
|
|
||||||
EXCEPTIONS
|
|
||||||
version_not_found = 1
|
|
||||||
reps_not_exist = 2
|
|
||||||
OTHERS = 3.
|
|
||||||
ENDIF.
|
|
||||||
IF sy-subrc <> 0.
|
|
||||||
RAISE EXCEPTION TYPE zcx_abapgit_not_found.
|
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
@ -162,13 +146,17 @@ CLASS zcl_abapgit_object_type IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD zif_abapgit_object~exists.
|
METHOD zif_abapgit_object~exists.
|
||||||
|
|
||||||
TRY.
|
DATA: lv_progname TYPE progname,
|
||||||
read( ).
|
lv_state TYPE r3state.
|
||||||
rv_bool = abap_true.
|
|
||||||
CATCH zcx_abapgit_not_found
|
lv_progname = |%_C{ ms_item-obj_name }|.
|
||||||
zcx_abapgit_exception.
|
SELECT SINGLE state
|
||||||
rv_bool = abap_false.
|
FROM progdir
|
||||||
ENDTRY.
|
INTO lv_state
|
||||||
|
WHERE name = lv_progname.
|
||||||
|
IF lv_state IS NOT INITIAL.
|
||||||
|
rv_bool = abap_true.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -209,13 +197,8 @@ CLASS zcl_abapgit_object_type IMPLEMENTATION.
|
||||||
lt_source TYPE abaptxt255_tab.
|
lt_source TYPE abaptxt255_tab.
|
||||||
|
|
||||||
|
|
||||||
TRY.
|
read( IMPORTING ev_ddtext = lv_ddtext
|
||||||
read( IMPORTING
|
et_source = lt_source ).
|
||||||
ev_ddtext = lv_ddtext
|
|
||||||
et_source = lt_source ).
|
|
||||||
CATCH zcx_abapgit_not_found.
|
|
||||||
RETURN.
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
io_xml->add( iv_name = 'DDTEXT'
|
io_xml->add( iv_name = 'DDTEXT'
|
||||||
ig_data = lv_ddtext ).
|
ig_data = lv_ddtext ).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user