mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Fixes function modules with exception classes
This commit is contained in:
parent
e1c8a1e7c4
commit
926cbcefbc
|
@ -30,6 +30,7 @@ CLASS lcl_object_fugr DEFINITION INHERITING FROM lcl_objects_program FINAL.
|
||||||
tables TYPE STANDARD TABLE OF rstbl WITH DEFAULT KEY,
|
tables TYPE STANDARD TABLE OF rstbl WITH DEFAULT KEY,
|
||||||
exception TYPE STANDARD TABLE OF rsexc WITH DEFAULT KEY,
|
exception TYPE STANDARD TABLE OF rsexc WITH DEFAULT KEY,
|
||||||
documentation TYPE STANDARD TABLE OF rsfdo WITH DEFAULT KEY,
|
documentation TYPE STANDARD TABLE OF rsfdo WITH DEFAULT KEY,
|
||||||
|
exception_classes TYPE abap_bool,
|
||||||
END OF ty_function.
|
END OF ty_function.
|
||||||
|
|
||||||
TYPES: ty_function_tt TYPE STANDARD TABLE OF ty_function WITH DEFAULT KEY.
|
TYPES: ty_function_tt TYPE STANDARD TABLE OF ty_function WITH DEFAULT KEY.
|
||||||
|
@ -71,6 +72,11 @@ CLASS lcl_object_fugr DEFINITION INHERITING FROM lcl_objects_program FINAL.
|
||||||
iv_package TYPE devclass
|
iv_package TYPE devclass
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
|
METHODS are_exceptions_class_based
|
||||||
|
IMPORTING iv_function_name TYPE rs38l_fnam
|
||||||
|
RETURNING VALUE(rv_return) TYPE abap_bool
|
||||||
|
RAISING lcx_exception.
|
||||||
|
|
||||||
ENDCLASS. "lcl_object_fugr DEFINITION
|
ENDCLASS. "lcl_object_fugr DEFINITION
|
||||||
|
|
||||||
*----------------------------------------------------------------------*
|
*----------------------------------------------------------------------*
|
||||||
|
@ -247,6 +253,7 @@ CLASS lcl_object_fugr IMPLEMENTATION.
|
||||||
remote_call = <ls_func>-remote_call
|
remote_call = <ls_func>-remote_call
|
||||||
short_text = <ls_func>-short_text
|
short_text = <ls_func>-short_text
|
||||||
update_task = <ls_func>-update_task
|
update_task = <ls_func>-update_task
|
||||||
|
exception_class = <ls_func>-exception_classes
|
||||||
* NAMESPACE = ' ' todo
|
* NAMESPACE = ' ' todo
|
||||||
remote_basxml_supported = <ls_func>-remote_basxml
|
remote_basxml_supported = <ls_func>-remote_basxml
|
||||||
IMPORTING
|
IMPORTING
|
||||||
|
@ -276,10 +283,6 @@ CLASS lcl_object_fugr IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
INSERT REPORT lv_include FROM lt_source.
|
INSERT REPORT lv_include FROM lt_source.
|
||||||
|
|
||||||
* lcl_objects_activation=>add( iv_type = 'FUNC'
|
|
||||||
* iv_name = <ls_func>-funcname ).
|
|
||||||
|
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
ENDMETHOD. "deserialize_functions
|
ENDMETHOD. "deserialize_functions
|
||||||
|
@ -537,7 +540,7 @@ CLASS lcl_object_fugr IMPLEMENTATION.
|
||||||
lt_source TYPE TABLE OF rssource,
|
lt_source TYPE TABLE OF rssource,
|
||||||
lt_functab TYPE ty_rs38l_incl_tt,
|
lt_functab TYPE ty_rs38l_incl_tt,
|
||||||
lt_new_source TYPE rsfb_source,
|
lt_new_source TYPE rsfb_source,
|
||||||
ls_ret LIKE LINE OF rt_functions.
|
ls_function LIKE LINE OF rt_functions.
|
||||||
|
|
||||||
FIELD-SYMBOLS: <ls_func> LIKE LINE OF lt_functab.
|
FIELD-SYMBOLS: <ls_func> LIKE LINE OF lt_functab.
|
||||||
|
|
||||||
|
@ -547,8 +550,8 @@ CLASS lcl_object_fugr IMPLEMENTATION.
|
||||||
LOOP AT lt_functab ASSIGNING <ls_func>.
|
LOOP AT lt_functab ASSIGNING <ls_func>.
|
||||||
* fm RPY_FUNCTIONMODULE_READ does not support source code
|
* fm RPY_FUNCTIONMODULE_READ does not support source code
|
||||||
* lines longer than 72 characters
|
* lines longer than 72 characters
|
||||||
CLEAR ls_ret.
|
CLEAR ls_function.
|
||||||
MOVE-CORRESPONDING <ls_func> TO ls_ret.
|
MOVE-CORRESPONDING <ls_func> TO ls_function.
|
||||||
|
|
||||||
CLEAR lt_new_source.
|
CLEAR lt_new_source.
|
||||||
CLEAR lt_source.
|
CLEAR lt_source.
|
||||||
|
@ -557,18 +560,18 @@ CLASS lcl_object_fugr IMPLEMENTATION.
|
||||||
EXPORTING
|
EXPORTING
|
||||||
functionname = <ls_func>-funcname
|
functionname = <ls_func>-funcname
|
||||||
IMPORTING
|
IMPORTING
|
||||||
global_flag = ls_ret-global_flag
|
global_flag = ls_function-global_flag
|
||||||
remote_call = ls_ret-remote_call
|
remote_call = ls_function-remote_call
|
||||||
update_task = ls_ret-update_task
|
update_task = ls_function-update_task
|
||||||
short_text = ls_ret-short_text
|
short_text = ls_function-short_text
|
||||||
remote_basxml_supported = ls_ret-remote_basxml
|
remote_basxml_supported = ls_function-remote_basxml
|
||||||
TABLES
|
TABLES
|
||||||
import_parameter = ls_ret-import
|
import_parameter = ls_function-import
|
||||||
changing_parameter = ls_ret-changing
|
changing_parameter = ls_function-changing
|
||||||
export_parameter = ls_ret-export
|
export_parameter = ls_function-export
|
||||||
tables_parameter = ls_ret-tables
|
tables_parameter = ls_function-tables
|
||||||
exception_list = ls_ret-exception
|
exception_list = ls_function-exception
|
||||||
documentation = ls_ret-documentation
|
documentation = ls_function-documentation
|
||||||
source = lt_source
|
source = lt_source
|
||||||
CHANGING
|
CHANGING
|
||||||
new_source = lt_new_source
|
new_source = lt_new_source
|
||||||
|
@ -583,7 +586,9 @@ CLASS lcl_object_fugr IMPLEMENTATION.
|
||||||
lcx_exception=>raise( 'Error from RPY_FUNCTIONMODULE_READ_NEW' ).
|
lcx_exception=>raise( 'Error from RPY_FUNCTIONMODULE_READ_NEW' ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
APPEND ls_ret TO rt_functions.
|
ls_function-exception_classes = are_exceptions_class_based( <ls_func>-funcname ).
|
||||||
|
|
||||||
|
APPEND ls_function TO rt_functions.
|
||||||
|
|
||||||
IF NOT lt_new_source IS INITIAL.
|
IF NOT lt_new_source IS INITIAL.
|
||||||
mo_files->add_abap( iv_extra = <ls_func>-funcname
|
mo_files->add_abap( iv_extra = <ls_func>-funcname
|
||||||
|
@ -618,6 +623,35 @@ CLASS lcl_object_fugr IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD. "serialize_includes
|
ENDMETHOD. "serialize_includes
|
||||||
|
|
||||||
|
METHOD are_exceptions_class_based.
|
||||||
|
DATA:
|
||||||
|
lt_dokumentation TYPE TABLE OF funct,
|
||||||
|
lt_exception_list TYPE TABLE OF rsexc,
|
||||||
|
lt_export_parameter TYPE TABLE OF rsexp,
|
||||||
|
lt_import_parameter TYPE TABLE OF rsimp,
|
||||||
|
lt_tables_parameter TYPE TABLE OF rstbl.
|
||||||
|
|
||||||
|
CALL FUNCTION 'FUNCTION_IMPORT_DOKU'
|
||||||
|
EXPORTING
|
||||||
|
funcname = iv_function_name
|
||||||
|
IMPORTING
|
||||||
|
exception_class = rv_return
|
||||||
|
TABLES
|
||||||
|
dokumentation = lt_dokumentation
|
||||||
|
exception_list = lt_exception_list
|
||||||
|
export_parameter = lt_export_parameter
|
||||||
|
import_parameter = lt_import_parameter
|
||||||
|
tables_parameter = lt_tables_parameter
|
||||||
|
EXCEPTIONS
|
||||||
|
error_message = 1
|
||||||
|
function_not_found = 2
|
||||||
|
invalid_name = 3
|
||||||
|
OTHERS = 4.
|
||||||
|
IF sy-subrc <> 0.
|
||||||
|
lcx_exception=>raise( 'Error from FUNCTION_IMPORT_DOKU' ).
|
||||||
|
ENDIF.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
METHOD lif_object~serialize.
|
METHOD lif_object~serialize.
|
||||||
|
|
||||||
DATA: lt_functions TYPE ty_function_tt,
|
DATA: lt_functions TYPE ty_function_tt,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user