文章目录
- ABAP 类与对象 EXCEPTIONS与RAISE
- 系统示例
- 代码
- 执行结果
- RAISE的系统文档
- 测试
ABAP 类与对象 EXCEPTIONS与RAISE
系统示例
代码
CLASS cls DEFINITION.PUBLIC SECTION.CLASS-METHODS meth EXCEPTIONS exc.
ENDCLASS.CLASS cls IMPLEMENTATION.METHOD meth....RAISE exc....ENDMETHOD.
ENDCLASS.START-OF-SELECTION.cls=>meth( EXCEPTIONS exc = 4 ).CASE sy-subrc.WHEN 4.cl_demo_output=>display( 'Exception' ).WHEN OTHERS....ENDCASE.