DATA: g_firstdate LIKE sy-datum, "当月第一天
g_lastdate LIKE sy-datum. "当月最后一天
IF <it_list>-afabg >= g_lastdate. "折旧计算开始日期 >="当月最后一天
CALL FUNCTION ‘HR_IT_TFR_MONTHS_BETWEEN_DATES’
EXPORTING
begda = g_lastdate
endda = <it_list>-afabg
IMPORTING
months = l_x.
ELSE.
CALL FUNCTION ‘HR_IT_TFR_MONTHS_BETWEEN_DATES’
EXPORTING
begda = <it_list>-afabg
endda = g_lastdate
IMPORTING
months = l_x.
ENDIF.
06-19
05-25