‎2008 Dec 12 9:58 AM
Hi,
This is my requirement : I have an inbound IDOC in which there is a date field .I need to check within my function module whether the incoming date has the format YYYYMMDD or not .If not then post an error.Also this date must be less than or equal to today's date .If not ,post an error .I wanted to know how we can satisfy both the above conditions
‎2008 Dec 12 10:04 AM
hi,
as u will be getting the format of mmddyyyy now using offset take 3 variables and change it.
as follows.
date : 12252008
v_1 = date+0(2).month
v_2 = date+2(2).day
v_3 = date+4(2). year.
concatenate v3 v1 v2 into date1.
this will be survive ur purpose.
‎2008 Dec 12 10:10 AM
Hi,
Use :
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2.
Check sy-subrc .
I hope this helps,
Regards
Raju Chitale
‎2008 Dec 12 10:05 AM
‎2008 Dec 12 10:17 AM
Use this FM DATE_CHECK_PLAUSIBILITY
See this code.
DATA s TYPE d VALUE '20085645' .
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = s
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.