1.界面

2.代码

 *&---------------------------------------------------------------------*
*& Report ZRICO_TEST21
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report zrico_test21.
tables: sscrfields.
data: itab_code type standard table of char72.
data: v_line type i.
data: s_message type trmsg.
data: v_word type char72.
data: v_report type syrepid value 'Z_TEST_REPORT_11'.
data: v_time1 type i.
data: v_time2 type i.
data: v_repid type sy-repid.
data: x_docking type ref to cl_gui_docking_container,
x_editor type ref to cl_gui_textedit.
parameters:p_report() default 'REPORT zrico_test23.'.
selection-screen skip .
selection-screen begin of line.
selection-screen comment () v_text.
selection-screen end of line.
selection-screen begin of line.
selection-screen comment () v_text1.
selection-screen end of line.
selection-screen function key . initialization.
v_repid = sy-repid.
v_text = 'Report Z_TEST_REPORT_11 will be generated'.
v_text1 = 'This is a small utility program to get the run time for the given code.'.
sscrfields-functxt_01 = 'Check syntax'. at selection-screen output.
loop at screen.
if screen-name = 'REPORT'.
screen-input = .
modify screen.
endif.
endloop.
if x_docking is initial .
create object x_docking
exporting
repid = v_repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_bottom
extension = ''
exceptions
cntl_error =
cntl_system_error =
create_error =
lifetime_error =
lifetime_dynpro_dynpro_link = .
endif .
if x_editor is initial.
create object x_editor
exporting
parent = x_docking
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position =
max_number_chars = .
endif . at selection-screen.
check sy-ucomm = 'FC01'.
perform code_and_syntax_check. start-of-selection.
perform code_and_syntax_check.
insert report 'Z_TEST_REPORT_11' from itab_code.
if sy-subrc <> .
message i398() with 'Errors in generating'.
leave list-processing.
endif.
generate report 'Z_TEST_REPORT_11'.
if sy-subrc <> .
message i398() with 'Errors in generating'.
leave list-processing.
else.
message s398() with 'Code generated successfully'.
endif.
get run time field v_time1.
submit (v_report) and return.
get run time field v_time2.
v_time2 = v_time2 - v_time1.
write: / 'Run time in micro seconds = ', v_time2.
*&---------------------------------------------------------------------*
*& Form code_and_syntax_check
*&---------------------------------------------------------------------*
form code_and_syntax_check.
refresh: itab_code.
call method x_editor->get_text_as_r3table
importing
table = itab_code
exceptions
error_dp =
error_cntl_call_method =
error_dp_create =
potential_data_loss =
others = .
if sy-subrc <> .
message i398() with 'Error in getting the code'.
leave program.
endif.
insert p_report into itab_code index .
syntax-check for itab_code message s_message line v_line word v_word.
if sy-subrc <> .
message i398() with s_message-msgtext 'Line' v_line.
leave list-processing.
else.
message s398() with 'No syntax errors'.
endif.
endform. " code_and_syntax_check

最新文章

  1. Python3.5+selenium操作Chrome浏览器
  2. 51nod DP 最大子段和
  3. 快速上手制作Icon Font
  4. Python3 升级pip
  5. tcp 重发 应用层重传
  6. nagios&ndash;配置文件
  7. mongodb基本概念解析
  8. Swift - 05 - 数值型字面量
  9. servlet方式通过Cookie记住登录时的用户名和密码
  10. 第一篇--认识Jmeter
  11. 【经验分享】Trachtenberg system(特拉亨伯格速算系统)
  12. Python 面向对象(四) 反射及其魔术方法
  13. Eclipse中如何忽略报错的js文件
  14. Vue 进阶之路(五)
  15. [Alpha阶段]第二次Scrum Meeting
  16. curl的Get请求,封装方法
  17. common.php
  18. android复制包需要修改的几个地方
  19. windows下安装pthreads扩展注意问题
  20. Python基础语法习题一

热门文章

  1. 1125 Chain the Ropes (25 分)
  2. go语言笔记——切片函数常见操作,增删改查和搜索、排序
  3. [UE4]嵌套Canvas
  4. [UE4]Lock Always
  5. 知识点:linux数据库备份
  6. VS远程调试与附加调试
  7. Synchronized常用用法
  8. Spark2.X分布式弹性数据集
  9. angularjs的cache
  10. 提示:pip install --upgrade pip