函数:DELTA_TIME_DAY_HOUR
其实就是:
DAYS = D2 - D1.
TINT = T2 - T1.
MINUTES = ( DAYS * 24 * 60 ) + TINT / 60.
计算两个时间相距的分秒数
REPORT z_barry_second .
PARAMETERS: d1 LIKE sy-datum DEFAULT sy-datum ,
d2 LIKE sy-datum DEFAULT sy-datum ,
t1 LIKE sy-uzeit ,
t2 LIKE sy-uzeit .
DATA sec TYPE i.
PERFORM get_second USING d1 d2 t1 t2 sec.
WRITE sec.
*---------------------------------------------------------------------*
* FORM get_second *
*---------------------------------------------------------------------*
FORM get_second USING d1 d2 t1 t2 second.
DATA: days TYPE i,
tint TYPE i.
IF d2 GE d1.
days = d2 - d1.
tint = t2 - t1.
second = ( days * 24 * 60 * 60 ) + tint .
ELSE.
second = 0.
ENDIF.
ENDFORM.
阅读(5589) | 评论(0) | 转发(0) |