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

SAP Internal Date Format

Former Member
0 Likes
1,702

Hi Experts,

I want to know that

how to verify the date entered by user is as per the current user settings date format ?

Is there any function module?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
856

Hi..,

these are stored in USR01 table..

regards,

sai ramesh

6 REPLIES 6
Read only

Former Member
0 Likes
857

Hi..,

these are stored in USR01 table..

regards,

sai ramesh

Read only

Former Member
0 Likes
856

Hi..,

here is the sample code that i have used in a program..

datfm -- Date format

dcpfm -- Decimal format

select single datfm dcpfm

from usr01

into (wa_datfm, wa_dcpfm )

where bname eq sy-uname.

case wa_datfm.

when 1.

concatenate lw_date6 lw_date3(2) lw_date+0(2) into lw_date.

when 2 or 3.

concatenate lw_date6 lw_date0(2) lw_date+3(2) into lw_date.

when 4 or 5 or 6.

translate lw_date using '. / - '.

condense lw_date no-gaps.

endcase.

reward if it helps u..

sai ramesh

Read only

Former Member
0 Likes
856

Hi,

chk the Functuon module:

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.

regards,

keerthi

Read only

0 Likes
856

Hi Keerthi,

Thanks a lot for reply.

I already acheived this by using one FM "SLS_MISC_CONVERT_TO_DATE".

My program is working fine. But my requirement is that when user enters the date irrespective of it's user setting then the program behaves as per the results I shown in bold below.For such results I have to match the user setting and as it's not proper (as shown in bold) I need to show an error message message.

So if there is any FM or logic that I want to know.

User settings DD.MM.YYYY

l_date before 18.04.2007

l_date after 18.04.2007

l_date before 18042007

l_date after 18.04.2007

<b>l_date before 04/18/2007

l_date after 00.2.418

l_date before 04182007

l_date after 7 .00.4182</b>

-


User settings MM/DD/YYYY

l_date before 04/18/2007

l_date after 04182007

l_date before 04182007

l_date after 04182007

<b>l_date before 18.04.2007

l_date after 4.2018.0

l_date before 18042007

l_date after 20071804</b>

-


Thanks,

Yogesh

Read only

0 Likes
856

first convert all the data into only one format that YYYYMMDD

by using key word WRITE to.

check documentation by pressing F1 on write,

after that u can call FMs.

Regards

Prabhu

Read only

0 Likes
856

Hi Keerthi,

Thanks a lot.FM:- DATE_CHECK_PLAUSIBILITY

is applicable to my requirement.

Thanks,

Yogesh