cancel
Showing results for 
Search instead for 
Did you mean: 

Date format issue in WD4A

Former Member
0 Kudos

Hi Gurus,

I have an Input field of type DATS.

The problem is, the input field automatically reformats the dates and that is not in accordance with the date format in the user profile.

Lets' assume that the user had DD.MM.YYYY set up as his default in his profile.

When the user enters 13.12.2009 it works fine.

However when he enters 13/12/2009 we get an error message stating invalid date format.

I undertsand that WD runtime treats the 13 (in 13/12/2009) as a month and hence pops up the error message.

The most interesting thing is if you create a program in se38 and declare a dats type parameter, the selection screen would not take any other format other than the one described in the user profile. Instead, it spits an error message.

My question is ... if the user has DD.MM.YYYY set up in his defaults and the user enters 01/02/2009(first of feb 2009) why does the runtime convert it to 02.01.2009(second of jan 2009)

Cheers, Avi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Avijit,

Please find the below facts, and do follow when you are handling with Dates in the WDC.

If you have a WDC in which one of the view's contain an UI element of type D or DATS.

1. Every attribute which has the type as D or DATS will have the Inputhelp as CALENDAR. This enables you to view the calendar at the input field.

2. Whenever you select somedate from the calendar, the format in which it displays on the input field is dependent on the Settings you make in the profile. In your case in the profile it was set to 'DD.MM.YYYY'.

3. Now, observe and note carefully, when ever you change the format other than the mentioned format in the user profile, then the format used by the WDC at runtime will be 'MM.DD.YYYY'.

For example, if you give the value in the IP as 09-02-2009 it will be considered as 02.09.2009.

This auto conversion happens internally in the WDC, but not in the classical reports.

This also happens only to a certain extent, i.e., till the MM value doesnt exceed 12. If it exceeds, then an error pops up on the screen.

Hope this information is useful..

Regards,

Shashikanth. D

Former Member
0 Kudos

thanks a lot for your help guys.

I have tried all the things mentioned here.

I have been to the internet options settings where in you can set the language and have selected EN-GB.

I have set my systems language to EN-GB.

Only thing that is left to do us change the language in useradmin in WAS.

I have gone through a Java webdynpro and amazingly shanging the browser locale and system locale seems to have resolved the java dynpros issue. However ABAP WD still behaves in the same old fashion. is there someting that I am missing?

Answers (2)

Answers (2)

Former Member
0 Kudos

I already have used the Input help calender. Nothing helps.

Former Member
0 Kudos

If your are using window OS then you can also control the date format from the OS settings

Control Pannel -> Regional & Language Option -> on the pop up u can customise the SHORT DATE FORMAT.

Greetiungs

Prashant

Former Member
0 Kudos

Hi Avijit,

Cant explain why automatic conversion happens in WD4A may be its runtime design decision. For WD when using date fields use inputfield, assign search help as CALENDER in the attribute, that binded to this inputfield

Greetings Prashant