1 *&---------------------------------------------------------------------* 2 *& Report ZCHENH028 3 *& 4 *&---------------------------------------------------------------------* 5 *& 6 *& 7 *&---------------------------------------------------------------------* 8 9 REPORT zchenh028. 10 11 DATA:count TYPE string. " 内表总数据条数 12 DATA:msg TYPE string. " 显示的消息 13 DATA:index TYPE string. " 当前处理的索引 14 15 DATA:BEGIN OF gt_tab OCCURS 0, 16 col1 TYPE string, 17 END OF gt_tab . 18 19 20 " 插入100条空数据 21 DO 10000 TIMES. 22 APPEND gt_tab. 23 ENDDO. 24 DESCRIBE TABLE gt_tab LINES count. 25 26 27 * 进度条显示 28 LOOP AT gt_tab. 29 CLEAR:msg,index. 30 index = sy-tabix. 31 CONCATENATE '正在处理。。。' index '/' count INTO msg. " 拼接消息 32 index = index / count * 100. " 时钟显示的百分比 33 34 CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' 35 EXPORTING 36 percentage = index " 处理的百分比 37 text = msg. 38 ENDLOOP.
效果如图:
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/18030.html