cancel
Showing results for 
Search instead for 
Did you mean: 

Region Specific Date Format

0 Kudos

Hi Gurus,

I have an application developed in Web Dynpro Java. The application should work in two languages (Spanish and English). Earlier the application, had to be run in English only and with date format mm.dd.yyyy. Now extended to Spanish language and with date format dd.mm.yyyy. So I applied internationalization for the application. So the portal is displayed in English and Spanish depending on the user. Now the problem is regarding the date format. Even if I set required date format in SU01, it is displaying in mm.dd.yyyy. I changed date format in Control Panel of Computer, but no use. How to handle this. Please help.

Thanks in Advance Ann.

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos
0 Kudos

Hi Jun,

I am getting details from ECC backend system using a BAPI and displaying it in a table. Date is one of the column in the table as shown in below image.

The output of BAPI is in dd/mm/yyyy format. But on displaying the format is getting changed.The Column Submitted Date is textview element only.

Please suggest a solution and they don't prefer doing changes in the layout also .

junwu
Active Contributor
0 Kudos

what's the data type for that column?

0 Kudos

Hi Jun,

Data type is string. \

junwu
Active Contributor
0 Kudos

the rfc give you string? or you defined?

0 Kudos

RFC output field in date format. But the displaying table field is of string

junwu
Active Contributor
0 Kudos

create a calculated field which will do the conversion, just follow the link I gave before.

govardan_raj
Contributor
0 Kudos

hi ann,

if rfc feild is of date type, than use simpledate format , get the string format of the date in dd.MM.yyyy and then set it to the column attribute of the above table that will sort out the issue.

SimpleDateFormat sdf = new SimpledateFormat("dd.MM.yyyy");

String DateInStringformat =  sdf.format("date filed");

sdf.format

Regards

Govardan

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

you can get user locale

IUser user = WDClientUser.getCurrentUser().getSAPUser();

Locale userLocale = user.getLocale();