1:异常

https://www.cnblogs.com/rainysblog/p/6665455.html

2:update module

https://www.cnblogs.com/cindyLu/p/3645423.html

https://wenku.baidu.com/view/81ce505d0508763230121209.html

3:程序:

  1. REPORT demo_catch_exception.
  2.  
  3. DATA(in) = cl_demo_input=>new( ).
  4. DATA: resumable TYPE abap_bool VALUE abap_false,
  5. before_unwind TYPE abap_bool VALUE abap_false,
  6. resume TYPE abap_bool VALUE abap_false.
  7. in->add_field( EXPORTING as_checkbox = 'X'
  8. text = 'RAISE RESUMABLE'
  9. CHANGING field = resumable
  10. )->add_field( EXPORTING as_checkbox = 'X'
  11. text = 'CATCH BEFORE UNWIND'
  12. CHANGING field = before_unwind
  13. )->add_field( EXPORTING as_checkbox = 'X'
  14. text = 'RESUME'
  15. CHANGING field = resume
  16. )->request( ).
  17.  
  18. CLASS lcx_exception DEFINITION INHERITING FROM cx_static_check.
  19. ENDCLASS.
  20.  
  21. CLASS exc_demo DEFINITION.
  22. PUBLIC SECTION.
  23. CLASS-DATA out TYPE REF TO if_demo_output.
  24. CLASS-METHODS: main,
  25. meth1 RAISING lcx_exception,
  26. meth2 RAISING RESUMABLE(lcx_exception).
  27. ENDCLASS.
  28.  
  29. FIELD-SYMBOLS <fs> TYPE any.
  30.  
  31. CLASS exc_demo IMPLEMENTATION.
  32. METHOD main.
  33. out = cl_demo_output=>new( ).
  34. DATA exc TYPE REF TO lcx_exception.
  35. IF before_unwind = abap_false.
  36. TRY.
  37. out->write( 'Trying method call' ).
  38. IF resumable = abap_false.
  39. exc_demo=>meth1( ).
  40. ELSEIF resumable = abap_true.
  41. exc_demo=>meth2( ).
  42. ENDIF.
  43. CATCH lcx_exception.
  44. IF <fs> IS ASSIGNED.
  45. out->write( 'Context of method available' ).
  46. ELSE.
  47. out->write( 'Context of method not available' ).
  48. ENDIF.
  49. ENDTRY.
  50. out->write( 'Continue after main TRY block' ).
  51. ELSEIF before_unwind = abap_true.
  52. TRY.
  53. out->write( 'Trying method call' ).
  54. IF resumable = abap_false.
  55. exc_demo=>meth1( ).
  56. ELSEIF resumable = abap_true.
  57. exc_demo=>meth2( ).
  58. ENDIF.
  59. CATCH BEFORE UNWIND lcx_exception INTO exc.
  60. IF <fs> IS ASSIGNED.
  61. out->write( 'Context of method available' ).
  62. ELSE.
  63. out->write( 'Context of method not available' ).
  64. ENDIF.
  65. IF resume = abap_true.
  66. IF exc->is_resumable = abap_true.
  67. RESUME.
  68. ELSE.
  69. out->write( 'Resumption not possible' ).
  70. ENDIF.
  71. ENDIF.
  72. ENDTRY.
  73. out->write( 'Continue after main TRY block' ).
  74. ENDIF.
  75. out->display( ).
  76. ENDMETHOD.
  77. METHOD meth1.
  78. DATA loc TYPE i.
  79. ASSIGN loc TO <fs>.
  80. TRY.
  81. out->write( 'Raising non-resumable exception' ).
  82. RAISE EXCEPTION TYPE lcx_exception.
  83. out->write( 'Never executed' ).
  84. CLEANUP.
  85. out->write( 'Cleanup in method' ).
  86. ENDTRY.
  87. out->write( 'Continue after TRY block in method' ).
  88. ENDMETHOD.
  89. METHOD meth2.
  90. DATA loc TYPE i.
  91. ASSIGN loc TO <fs>.
  92. TRY.
  93. out->write( 'Raising resumable exception' ).
  94. RAISE RESUMABLE EXCEPTION TYPE lcx_exception.
  95. out->write( 'Resuming method' ).
  96. CLEANUP.
  97. out->write( 'Cleanup in method' ).
  98. ENDTRY.
  99. out->write( 'Continue after TRY block in method' ).
  100. ENDMETHOD.
  101. ENDCLASS.
  102.  
  103. START-OF-SELECTION.
  104. exc_demo=>main( ).

abap异常处理 , update module的更多相关文章

  1. ABAP术语-Update Module

    Update Module 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/20/1114178.html Part of an update ...

  2. abap开发中update module 的创建和使用

    一.update module 的创建和使用 最近遇到这样一个需求,需要先删除(delete)表中的数据,再将传递过来的新数据添加(modify)到表中. 但是如果下面modify的时候出现错误,使用 ...

  3. update module (更新模块)

    [转自http://blog.csdn.net/zhongguomao/article/details/6712568] function module:更新程序必须用一个特殊的FM(update m ...

  4. ABAP术语-V2 Module

    V2 Module 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/21/1115720.html Analogously to V1 the ...

  5. ABAP术语-V1 Module

    V1 Module 原文;http://www.cnblogs.com/qiangsheng/archive/2008/03/21/1115707.html Function module creat ...

  6. ABAP术语-Update Task

    Update Task 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/20/1114184.html Part of an ABAP pro ...

  7. ABAP术语-Function Module

    Function Module 原文:http://www.cnblogs.com/qiangsheng/archive/2008/02/18/1071827.html General-purpose ...

  8. ABAP术语-Update Data

    Update Data 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/20/1114169.html The data which is t ...

  9. ABAP术语-Update Key

    Update Key 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/20/1114171.html Unique character str ...

随机推荐

  1. xml和json格式输出

    <?php   class Response{     const JSON ='json';       /*     * 按综合方式输出通信数据     * @param integer $ ...

  2. [LintCode] Max Points on a Line 共线点个数

    Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. ...

  3. Tarjan 强连通分量 及 双联通分量(求割点,割边)

    Tarjan 强连通分量 及 双联通分量(求割点,割边) 众所周知,Tarjan的三大算法分别为 (1)         有向图的强联通分量 (2)         无向图的双联通分量(求割点,桥) ...

  4. cobbler搭建本地的yum仓库源

    cobbler自动化安装参考文档 https://www.cnblogs.com/minseo/p/8537266.html 使用cobbler可以快速搭建一个本地的yum仓库 cobbler rep ...

  5. API(三)之Class-based Views

    使用基于类的视图重写API 我们首先将根视图重写为基于类的视图.所有这一切都涉及到重构views.py. from snippets.models import Snippet from snippe ...

  6. 初探Spring Cloud Config

    Spring Cloud Config提供了分布式系统中配置功能的服务端与客户端支持.对于不同环境的应用程序它的服务端提供了一种中心化的配置管理方式.并且其不仅适用于Spring的应用程序,其它语言开 ...

  7. React 60S倒计时

    React 60S倒计时 1.设置状态: 2.函数主体: 3.应用: 4..效果图:

  8. 应用打开其xlspptdoc等

    http://www.libxl.com/documentation.html  xls读写编辑类库libxl https://blog.csdn.net/songbob/article/detail ...

  9. https://pypi.org/project/py-mysql2pgsql/

    https://packages.ubuntu.com/trusty/postgresql-server-dev-9.3 所以使用下面的命令即可安装python-dev: yum install py ...

  10. [daily][mariadb][mysql] mariadb快速设置

    参考: https://wiki.archlinux.org/index.php/MySQL 1. 安装 使用pacman常规安装 2. btrfs 禁用CoW mariadb的数据文件如果存储在bt ...