se18 进行 class badi 创立
class baid 通过上述步骤会主动产生接口。
咱们给接口撸一个办法
接口的办法设定好参数
激活 咱们的 badi 就创立好了
接下来到 se19
咱们施行这个 badi
到这里 class badi 的创立和施行曾经实现
接下来咱们来通过 debug 全面解析下这个货色施行啥玩意
REPORT zrep_cls_51.
PARAMETERS p_ctry TYPE land1.
DATA:gv_str TYPE string VALUE 'Input:'.
DATA:go_ref TYPE REF TO zif_ex_badi_test_001.
CALL METHOD cl_exithandler=>get_instance
EXPORTING
exit_name = 'ZBADI_TEST_001'
null_instance_accepted = 'X'
* IMPORTING
* act_imp_existing =
CHANGING
instance = go_ref
EXCEPTIONS
no_reference = 1
no_interface_reference = 2
no_exit_interface = 3
class_not_implement_interface = 4
single_exit_multiply_active = 5
cast_error = 6
exit_not_existing = 7
data_incons_in_exit_managem = 8
OTHERS = 9.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc IS INITIAL.
CALL METHOD go_ref->get_value
EXPORTING
iv_input = gv_str
flt_val = p_ctry.
ENDIF.