赛跑网

 找回密码
 注册

QQ登录

只需一步,快速开始

快捷登录

查看: 1237|回复: 0

[ABAP] 进度条代码分享

[复制链接]
发表于 2013-10-21 00:17:31 | 显示全部楼层 |阅读模式
当出具一个很大的报表时 往往需要耗费一定的时间 孤儿出个进度条让用户知道处理的进度 可调用如下代码 也可以给用户看到执行的百分比

FORM SCHEDULE  USING c_message type c
                     i_percent type i.

  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 / 6.
    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





上一篇:开发过程中的模糊查询-更好的提高用户体验
下一篇:开发过程中的模糊查询-更好的提高用户体验
本楼点评(0) 收起
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|联系我们|赛跑网 ( QQ:108519493QQfsq

GMT+8, 2024-5-5 14:35 , Processed in 1.530968 second(s), 29 queries .

Powered by 91SAP X3.4

© 2001-2023 91sap Team.

快速回复 返回顶部 返回列表