程序运行时,一个进度条显示INCLUDE程序

*&---------------------------------------------------------------------*
*& Include ZSHOWGUI *
*&---------------------------------------------------------------------*
*& Author : Louis Zhou *
*& Create Date : 2005-07-17 *
*& Program Type : Report *
*& SAP Release : 4.7C *
*& Description : 用来做信息类型 *
*&---------------------------------------------------------------------*

*&---------------------------------------------------------------------*
*& Form SCHEDULE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --&gt p1 text
* *----------------------------------------------------------------------*
form schedule using
c_message type c
i_percent type i.
data: c_sche(204).

if i_percent <= 0 or i_percent > 100 .
c_sche = '百分比错误!'.
else.
data: c_percent(4),
c_block(6) type c value '■■',
i_blocklen type i,
i_count type i,
i_col type i,
i_len type i,
i_temp type i value 0,
i_mod type i.
i_blocklen = strlen( c_block ).
c_percent = i_percent.
condense c_percent.
c_percent+3(1) = '%'.
c_sche = c_percent.
i_count = i_percent / 4.
do i_count times.
i_col = ( i_temp * i_blocklen ) + 4.
c_sche+i_col(i_blocklen) = c_block.
i_temp = i_temp + 1.
enddo.
i_len = strlen( c_message ).
i_mod = i_len mod 2.
if i_mod = 1.
i_len = i_len + 1.
endif.
if i_len > 0.
c_sche+4(i_len) = c_message.
endif.
i_len = strlen( c_sche ).
endif.
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
percentage = 0
text = c_sche
exceptions
others = 1.
endform. " SCHEDULE

以下是调用这个INCLUDE的示例程序:
*&---------------------------------------------------------------------*
*& Report Z_GUAGE *
*& *
*&---------------------------------------------------------------------*
*& Author : Louis Zhou *
*& Create Date : 2005-07-17 *
*& Program Type : Report *
*& SAP Release : 4.7C *
*&---------------------------------------------------------------------*

report Z_GUAGE .
include zshowgui.
data: i_prog type i,
i_prog2 type i.

START-OF-SELECTION.
do 100 times .
do 100000 times.
i_prog2 = i_prog2 + 1.
enddo.
i_prog = i_prog + 1.
write: / '第' no-gap , i_prog no-gap , '次运行:',i_prog2.
perform schedule using '' i_prog. "调用上面的INCLUDE显示进度
enddo.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7941665/viewspace-971989/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7941665/viewspace-971989/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值