Application Development 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: 

Function module to verify if date is valid.

dev_parbutteea
Active Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

this cann't work properly

Former Member

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.

former_member705122
Active Contributor
0 Kudos

Hi,

Can you explain little more abt your question.

Regards

Adil

Former Member
0 Kudos

Hi,

refer

Former Member
0 Kudos

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

Former Member
0 Kudos

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.