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

Function module to verify if date is valid.

dev_parbutteea
Active Contributor
0 Likes
41,628

Anyone know a function module to verify if date is valid?thx

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
14,051

hiiii

This function module will be useful.check.

FM CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'

EXPORTING

date = pre_date

EXCEPTIONS

plausibility_check_failed = 1

OTHERS = 2.

IF sy-subrc 0.

MESSAGE e002(0s) WITH pre_date.

ENDIF.

reward if useful

thx

twinkal

7 REPLIES 7
Read only

Former Member
0 Likes
14,052

hiiii

This function module will be useful.check.

FM CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'

EXPORTING

date = pre_date

EXCEPTIONS

plausibility_check_failed = 1

OTHERS = 2.

IF sy-subrc 0.

MESSAGE e002(0s) WITH pre_date.

ENDIF.

reward if useful

thx

twinkal

Read only

0 Likes
14,051

this cann't work properly

Read only

Former Member
14,051

DATE_CHECK_PLAUSIBILITY

Check to see if a date is in a valid format for SAP. Works well when validating dates being passed in from other systems.

Read only

Former Member
0 Likes
14,051

Hi,

Can you explain little more abt your question.

Regards

Adil

Read only

Former Member
0 Likes
14,051

Hi,

refer

Read only

Former Member
0 Likes
14,051

hi,

DATE_CHECK_PLAUSIBILITY is the FM useful to you. Pass your date to the FM and check for exceptions. If there is one, the date is wrong else right.

thanks

Nayan

Read only

Former Member
0 Likes
14,051

Maybe is useful the class

CALL METHOD cl_isu_date_check=>date_check_plausibility
   EXPORTING
     x_date                    = lv_date
   EXCEPTIONS
     plausibility_check_failed = 1
     others                    = 2.


also verified by

if x_date < cl_isu_date=>co_date_finite
   or x_date > cl_isu_date=>co_date_infinite.
     message e073(e9) raising plausibility_check_failed.
   endif.