Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DATE Validation

Former Member
0 Likes
511

Hi All,

I want validate the date field

i was given 113006 make this date as 11.30.06 then this date is validate is in correct ot not

from the flat file the given date : 113006

then convert into

data : v_date(8)

using concatenate mm'.'dd'.yy into v_date.

once we convert into this formate 11.30.06

Example : 11.30.06 Correct

13.12.06 Error

How to validate above example

plz send me he samle code

i look forward to ypur reply

Thanks & Regards

SEK

3 REPLIES 3
Read only

Former Member
0 Likes
475

Try to use the conversion exits, CONVERT_DATE_TO_EXTERNAL. For invalid date it through exceptions.

Regards

Kathirvel

Read only

suresh_datti
Active Contributor
0 Likes
475

try the function mdoule DATE_CHECK_PLAUSIBILITY

~Suresh

Read only

Former Member
0 Likes
475

Hi

U can use fm DATE_CHECK_PLAUSIBILITY, but you have to transfer the date in YYYYMMDD format:

data : v_date(8),
       CHECK_DATE TYPE SY-DATUM.

CONCATENATE FILE-DATE(2)   '.'
            FILE-DATE+2(2) '.'
            FILE-DATE+4(2) INTO  V_DATE.

CHECK_DATE(2)   = '20'.
CHECK_DATE+2(2) = FILE-DATE+4(2).
CHECK_DATE+4(2) = FILE-DATE(2).
CHECK_DATE+6(2) = FILE-DATE+2(2).

So you can transfer CHECK_DATE to fm DATE_CHECK_PLAUSIBILITY.

Max