ABAP检查日期and时间合法性的函数

可以使用ABAP中函数 'DATE_CHECK_PLAUSIBILITY' 或'TIME_CHECK_PLAUSIBILITY'检查日期和时间值是否合法。
用法如下:
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = v_date
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc NE 0. "如果返回非0,则日期不合法
.
.
ENDIF.


CALL FUNCTION 'TIME_CHECK_PLAUSIBILITY'
EXPORTING
time = v_time
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.


IF sy-subrc NE 0. "如果返回非0,则时间不合法
.
.
ENDIF.

原文地址:https://www.cnblogs.com/hanmos/p/2891002.html