zcl_abapgit_function_module: cloud compatiblity (#7002)

This commit is contained in:
Lars Hvam 2024-07-31 18:07:58 +02:00 committed by GitHub
parent 36d91e973e
commit 27e767e935
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.