Skip to content

Commit

Permalink
SICF: Decouple from core, #1941
Browse files Browse the repository at this point in the history
Change calls to static SICF methods to dynamic, in order to be able to support systems which do not have SICF objects.
  • Loading branch information
larshp committed Sep 27, 2018
1 parent eb34b7e commit ba787d3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/objects/zcl_abapgit_object_sicf.clas.abap
Expand Up @@ -293,6 +293,8 @@ CLASS ZCL_ABAPGIT_OBJECT_SICF IMPLEMENTATION.

METHOD read_sicf_url.

* note: this method is called dynamically from some places

DATA: lv_name TYPE icfname,
lv_url TYPE string,
lv_parguid TYPE icfparguid.
Expand Down Expand Up @@ -322,6 +324,8 @@ CLASS ZCL_ABAPGIT_OBJECT_SICF IMPLEMENTATION.

METHOD read_tadir_sicf.

* note: this method is called dynamically from some places

DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
lv_hash TYPE text25,
lv_obj_name TYPE tadir-obj_name.
Expand Down
29 changes: 22 additions & 7 deletions src/zcl_abapgit_tadir.clas.abap
Expand Up @@ -54,9 +54,9 @@ CLASS ZCL_ABAPGIT_TADIR IMPLEMENTATION.
DATA: lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic.
DATA: last_package TYPE devclass VALUE cl_abap_char_utilities=>horizontal_tab.

FIELD-SYMBOLS: <ls_tdevc> LIKE LINE OF lt_tdevc,
<ls_tadir> LIKE LINE OF rt_tadir,
<lv_package> TYPE devclass.
FIELD-SYMBOLS: <ls_tdevc> LIKE LINE OF lt_tdevc,
<ls_tadir> LIKE LINE OF rt_tadir,
<lv_package> TYPE devclass.

"Determine Packages to Read
DATA: lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt.
Expand Down Expand Up @@ -139,7 +139,15 @@ CLASS ZCL_ABAPGIT_TADIR IMPLEMENTATION.
CASE <ls_tadir>-object.
WHEN 'SICF'.
* replace the internal GUID with a hash of the path
<ls_tadir>-obj_name+15 = zcl_abapgit_object_sicf=>read_sicf_url( <ls_tadir>-obj_name ).
TRY.
CALL METHOD ('ZCL_ABAPGIT_OBJECT_SICF')=>read_sicf_url
EXPORTING
iv_obj_name = <ls_tadir>-obj_name
RECEIVING
rv_hash = <ls_tadir>-obj_name+15.
CATCH cx_sy_dyn_call_illegal_method.
* SICF might not be supported in some systems, assume this code is not called
ENDTRY.
ENDCASE.
ENDLOOP.

Expand Down Expand Up @@ -251,9 +259,16 @@ CLASS ZCL_ABAPGIT_TADIR IMPLEMENTATION.
METHOD zif_abapgit_tadir~read_single.

IF iv_object = 'SICF'.
rs_tadir = zcl_abapgit_object_sicf=>read_tadir_sicf(
iv_pgmid = iv_pgmid
iv_obj_name = iv_obj_name ).
TRY.
CALL METHOD ('ZCL_ABAPGIT_OBJECT_SICF')=>read_tadir
EXPORTING
iv_pgmid = iv_pgmid
iv_obj_name = iv_obj_name
RECEIVING
rs_tadir = rs_tadir.
CATCH cx_sy_dyn_call_illegal_method.
* SICF might not be supported in some systems, assume this code is not called
ENDTRY.
ELSE.
SELECT SINGLE * FROM tadir INTO CORRESPONDING FIELDS OF rs_tadir
WHERE pgmid = iv_pgmid
Expand Down

0 comments on commit ba787d3

Please sign in to comment.