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

To check date validity

Former Member
0 Likes
2,668

Hi all,

I need to check date is valid or not . I need a function module which does the date validation

eg. If date = 30.2.2006 --> invalid

date = 31.04.2006--> invalid

I need it immm\

Thanks

Points will be awarded

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,984

Hi,

You can use FM DATE_CHECK_PLAUSIBILITY to validate the date.

Regards,

Shashank

Hi all,

I need to check date is valid or not . I need a function module which does the date validation

eg. If date = 30.2.2006 --> invalid

date = 31.04.2006--> invalid

I need it immm\

Thanks

Points will be awarded

7 REPLIES 7
Read only

Former Member
0 Likes
1,984

hi Jaya,

Check this link where you can find date related FM

http://www.geocities.com/victorav15/sapr3/abapfun.html

Use FM <b>'DATE_CHECK_PLAUSIBILITY'</b>

data : dat like sy-datum value '20060231'.

CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'

EXPORTING

DATE = dat.

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
1,984

Hi,

just defione that variable as the like sy-datum.

Then it will automatically validate the input...

cheers,

Simha.

Read only

Former Member
0 Likes
1,985

Hi,

You can use FM DATE_CHECK_PLAUSIBILITY to validate the date.

Regards,

Shashank

Read only

Former Member
0 Likes
1,984

Hi Jayasree,

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.

Thanks,

Vinay

Read only

Laxmana_Appana_
Active Contributor
0 Likes
1,984

Hi,

use FM : ISU_DATE_PLAUSIBLE_CHECK.

Regards

Appana

Read only

Former Member
0 Likes
1,984

Hi Jayashree,

Just define the variable type sy-datum, you needn check at all

DATA: ws_date type sy-datum.

This will display in the format 20.07.2006 but whereas for internal processing it will be as 20060720. So you needn worry while validating.

Reward if helpful.

Regards,

Tushar

Read only

Former Member
0 Likes
1,984

Hello Jayasree,

If you have the date as an input parameter...it would be better to define it as like sy-datum and it would do the trick. In case you are using a variable which might be getting its values via some ABAP logic..it is better to use the function DATE_CHECK_PLAUSIBILITY.

I hope the above helps !!

Regards

Anurag