ABAP顾问
分类:
2009-07-08 19:41:33
REPORT Z_BARRY_TEST NO STANDARD PAGE HEADING
LINE-COUNT 20
LINE-SIZE 200.
PARAMETERS: D1 LIKE SY-DATUM DEFAULT SY-DATUM ,
T1 LIKE SY-UZEIT DEFAULT SY-UZEIT .
DATA SEC TYPE I.
DATA: D2 TYPE D,
T2 TYPE T.
SEC = -60 * 3600 .
PERFORM GET_NEW_DATE USING D1 T1 SEC D2 T2.
WRITE: D1 , T1.
WRITE: / D2 , T2.
*---------------------------------------------------------------------*
* FORM get_second *
*---------------------------------------------------------------------*
FORM GET_NEW_DATE USING D1 T1 SECOND D2 T2.
DATA: DAYS TYPE I,
TINT TYPE I.
DAYS = SECOND DIV 86400 .
TINT = SECOND MOD 86400 .
D2 = D1 + DAYS .
T2 = T1 + TINT .
IF T2 < T1.
D2 = D2 + 1.
ENDIF.
ENDFORM. "get_new_date