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

Validate date in yyyymmdd format

Former Member
0 Likes
9,596

Hi All,

I am looping an internal table which has a date field and if date(comes from input file) is not in YYYYMMDD format, it should throw an error message.

Can anybody please tell me how to validate date for YYYYMMDD format

Is there any specific function module for that?

Regards,

Azra.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,184

Hi,

Check this FM DATE_CHECK_PLAUSIBILITY

Refer to this link..

Hi All,

I am looping an internal table which has a date field and if date(comes from input file) is not in YYYYMMDD format, it should throw an error message.

Can anybody please tell me how to validate date for YYYYMMDD format

Is there any specific function module for that?

Regards,

Azra.

6 REPLIES 6
Read only

Former Member
0 Likes
3,185

Hi,

Check this FM DATE_CHECK_PLAUSIBILITY

Refer to this link..

Read only

former_member195383
Active Contributor
0 Likes
3,184

change your SU3 settings to the desired date format, and then use FM

DATE_CHECK_PLAUSIBILITY

Check the below link for more info.

Read only

Former Member
0 Likes
3,184

Hi,

If for the internal table you have declared the field as sy-datum, then it will take the date in sy-datum format only.

But later to validate u cna loop in that internal table and pass the date value to the FM '/OSP/VALIDATE_DATE_TIME' to check whether its the required format.

Regards,

Mansi.

Read only

Former Member
0 Likes
3,184

Hope this function module will help you

FM : " /OSP/VALIDATE_DATE_TIME "

Read only

Former Member
0 Likes
3,184

hi,

use:

/OSP/VALIDATE_DATE_TIME

DATE_CHECK_PLAUSIBILITY

Read only

Former Member
0 Likes
3,184

Hi,

First declare the field as type d.

In the loop you check the data wiht offset values: v_datae+0(4) = 'YYYY',

v_date_4(2) = 'MM', v_date+6(2) = 'DD'.

If not then throw an error message.

Naveen M.