DATE 相关的Function

2009-05-13 14:07:03来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

DATE 相關的Function
===========================================================
1、年月日相加減
Date +/- year/month/day (into the future/past)
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = l_date
days = '00'
months = p_month
signum = '-'
years = '00'
IMPORTING
calc_date = l_date.
date為輸入的日期,months要加或減的月份,也可以用days or years,signum為咚惴?..
2、得到本日是第幾周
Returns week for a date
*---> get week number
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = in_budat
IMPORTING
week = l_week
EXCEPTIONS
date_invalid = 1
OTHERS = 2.
3、得到本周的第一天
Return first day for a week
*---> get first day of week
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
week = l_week
IMPORTING
date = it_week-week_dt
EXCEPTIONS
week_invalid = 1
OTHERS = 2.
4、得到本日是本星期的第幾天
CALL FUNCTION 'DAY_IN_WEEK'
EXPORTING
datum = p_date1
IMPORTING
wotnr = l_day.
5、Check 轉入日期是否正確
Date plausibility check
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = it_excel-redat
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc  0.
it_err-ecode = '10'.
it_err-evalue = it_excel-redat.
it_err-ereason = 'Release Date is not valid'.
APPEND it_err.
endif.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/68743/showart_724957.html

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:/etc 下的全部文件

下一篇:make