From 27e767e93514e81d902c7111fc640b089bb48d36 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Wed, 31 Jul 2024 18:07:58 +0200 Subject: [PATCH] `zcl_abapgit_function_module`: cloud compatiblity (#7002) --- .../sap/zcl_abapgit_function_module.clas.abap | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/objects/sap/zcl_abapgit_function_module.clas.abap b/src/objects/sap/zcl_abapgit_function_module.clas.abap index a0537e6a6..2b6e425e4 100644 --- a/src/objects/sap/zcl_abapgit_function_module.clas.abap +++ b/src/objects/sap/zcl_abapgit_function_module.clas.abap @@ -18,17 +18,25 @@ CLASS zcl_abapgit_function_module IMPLEMENTATION. METHOD zif_abapgit_function_module~function_exists. - DATA: lv_function_module_name TYPE c LENGTH 30. + DATA lv_function_module_name TYPE c LENGTH 30. + DATA lv_exists TYPE string. lv_function_module_name = iv_function_module_name. + lv_exists = 'FUNCTION_EXISTS'. - CALL FUNCTION 'FUNCTION_EXISTS' - EXPORTING - funcname = lv_function_module_name - EXCEPTIONS - function_not_exist = 1 - OTHERS = 2. - rv_exists = boolc( sy-subrc = 0 ). + TRY. + CALL FUNCTION lv_exists + EXPORTING + funcname = lv_function_module_name + EXCEPTIONS + function_not_exist = 1 + OTHERS = 2. + rv_exists = boolc( sy-subrc = 0 ). + CATCH cx_sy_dyn_call_illegal_func. +* then its running in ABAP Cloud Programming Model, assume nothing is released +* I could not find any way to check for this -Hvam + rv_exists = abap_false. + ENDTRY. ENDMETHOD. ENDCLASS.