- 方法一
(1)SD_DATETIME_DIFFERENCE
CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
EXPORTING
DATE1 = g_tab-BEDAT
TIME1 ='000001'
DATE2 = g_tab-BLDAT
TIME2 ='000001'
IMPORTING
DATEDIFF = zs
EXCEPTIONS
INVALID_DATETIME = 1
OTHERS = 2 .
- 方法二
(2)FIMA_DAYS_AND_MONTHS_AND_YEARS
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = g_tab-BEDAT
I_DATE_TO = g_tab-BLDAT
i_flg_separate = ' '
IMPORTING
E_DAYS = zs.
ZS是data出来的一个对象,类型为P。