‎2006 Jul 20 11:39 AM
Hi,
Can you give me a function module for validation of date.
For example if the date is given as 31st of Feb it shoud give me an error message.
Thanks in advance.
-Reni
‎2006 Jul 20 11:45 AM
chk this
REPORT YCHATEST.
data : dat like sy-datum value '20060231'.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = dat.It will give status message at the bottom
Message was edited by: Chandrasekhar Jagarlamudi
‎2006 Jul 20 11:40 AM
‎2006 Jul 20 11:40 AM
Hi Reni,
Use Function module <b>DATE_CHECK_PLAUSIBILITY</b> to validate a date.
1)If you given a invalidate date then it will ask you to enter a valid date.
2)After changing it to correct value, you can click on SAVE button or if you want to continue with the invalid date then click on USE INVALID VALUE button.
Try with this code.
PARAMETER P_DATE TYPE SYDATUM.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = P_DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2.
<b>IF sy-subrc <> 0.
MESSAGE E000(ZI) WITH 'INPUT DATE IS INVALID DATE'.
ENDIF.</b>
Thanks,
Vinay
‎2006 Jul 20 11:45 AM
Hi,
Check the FM's <b>CONVERT_DATE_INPUT
DATE_CHECK_PLAUSIBILITY</b>
Regards
vijay
‎2006 Jul 20 11:45 AM
chk this
REPORT YCHATEST.
data : dat like sy-datum value '20060231'.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = dat.It will give status message at the bottom
Message was edited by: Chandrasekhar Jagarlamudi