
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
DATA:il_bef_percent TYPE int4. " 上一次使用的点比,如是本次与上一次一样,则直接返回 DATA:ls_MSGNO TYPE msgno. *&---------------------------------------------------------------------* *& Form schedule *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->C_MESSAGE text * -->I_PERCENT text *----------------------------------------------------------------------* form schedule using c_message type c i_percent type i. data: c_sche(204). IF SY-BATCH = 'X'."后台执行,不显示进度 RETURN. ENDIF. if i_percent = il_bef_percent. return. ENDIF. il_bef_percent = i_percent . if i_percent 100 . i_percent = 1. endif. 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. i_col = ( i_temp * i_blocklen ). 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. CONCATENATE C_PERCENT c_message c_sche INTO c_sche. i_len = strlen( c_sche ). call function 'SAPGUI_PROGRESS_INDICATOR' EXPORTING percentage = 0 text = c_sche EXCEPTIONS others = 1. endform. " SCHEDULE |