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

check if date has the correct format

mrahhaoui
Participant
0 Likes
591

HI Guru's,

Is there a function module or something else which allows to check if a date from a file is valid?

REgards,

Moha.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
562

Hi,

Try This

DATE_CHECK_PLAUSIBILITY

CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'

EXPORTING

DATE = W_BLDAT

EXCEPTIONS

PLAUSIBILITY_CHECK_FAILED = 1.

Regards

Krishna

Edited by: Krishna Gowrneni on May 6, 2009 7:36 PM

HI Guru's,

Is there a function module or something else which allows to check if a date from a file is valid?

REgards,

Moha.

3 REPLIES 3
Read only

Former Member
0 Likes
563

Hi,

Try This

DATE_CHECK_PLAUSIBILITY

CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'

EXPORTING

DATE = W_BLDAT

EXCEPTIONS

PLAUSIBILITY_CHECK_FAILED = 1.

Regards

Krishna

Edited by: Krishna Gowrneni on May 6, 2009 7:36 PM

Read only

Former Member
0 Likes
562

the FM 'DATE_CHECK_PLAUSIBILITY' is used to check the validity for date.

u can also chk 'CONVERT_DATE_TO_INTERNAL'

Read only

ThomasZloch
Active Contributor
0 Likes
562

funny, but it works:

DATA: date TYPE d.

date = '20090231'.
SUBTRACT 1 FROM date.
IF date IS INITIAL.
  WRITE: 'invalid date'.
ENDIF.