cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro-Java Number/Amount Formats as per Locale

Former Member
0 Kudos

Hi,

I tried searching for this in the forum but couldn't get a clear answer to my requirement.

Is setting the Locale in the code ( NumberFormat.getCurrencyInstance(locale) etc...) the only way to show the numbers and amounts (dots and commas) display in webdynpro application accordingly to locale?

Or is there any other setting in visual admin or webdynpro DC or iView settings or any other place where we can set this and it automatically takes care of it? If yes, can you please give the details..

I tried adding the sap-locale=de parameter to the webdynpro application URL but it is still showing the dates in MM/DD/YYYY format.

We want to show all the data displayed on the webdynpro application in locale specific format automatically without much coding.

Can anyone please advise?

Accepted Solutions (0)

Answers (1)

Answers (1)

Qualiture
Active Contributor
0 Kudos

Hi Aditya,

You can define the standard locale per Web Dynpro application, see http://help.sap.com/saphelp_nw04/helpdata/en/09/a4d6a674bc1d4a9e74abf81bed3ef6/content.htm for more information.

Or, if you're running a portal, you may want to set the default locale for the portal by setting the request.mandatorylanguage=<language> and request.mandatorycountry=<country> in the prtDefault.properties file

Hope this helps!

Robin

Former Member
0 Kudos

Thanks for the reply Robin.... Yes we are running a portal. But specifying a default locale in the portal or application properties will always make the application display the values in that specific locale format...no? What i want is the application should automatically adapt to the specific locale settings depending on the user's locale.

If my user is in Germany, it should show the comma as the delimiter for decimals and dates should be in DD/MM/YYYY format

And if my user is in USA. the date should be in MM/DD/YYYY format automatically without any additional coding.

The way it works in ECC.... If i set my date and amounts setting in myProfile (trx SU3) in ECC, it automatically displays all the values in that specific format. Is there anything like that in Webdynpro or Portal?

junwu
Active Contributor
0 Kudos

did you set the language for the user in ume?

Qualiture
Active Contributor
0 Kudos

Hi,

Ok, I was under the impression you were looking for a default systemwide locale.

If you need a different locale based on user location or locale, you can specify a user locale in UME as John suggested (so you have control how users will perceive number/date formats), or have the proper locale (language) predefined in the client browser in which case the locale is automatically picked up by these user settings (but it's up to the user how numbers and dates are displayed)

Former Member
0 Kudos

HI John and Robin,

Thanks for the replies. But when i checked in portal->user administration->General information tab, there is only "Language" field but not specifically "Locale". However i tried setting language to "German" and re-run my application. All the date fields are still showing in MM/DD/YYYY format when i am expecting it to show in DD/MM/YYYY format.

I have also tried to change the Browser language to "de" under Tools->internet options->Languages. This did not help either.

Can you please advise if i am missing anything?

Qualiture
Active Contributor
0 Kudos

Hi,

Have you already personalized your language via Portal Personalization? This might interfere..

Have a look at

note 947081 https://service.sap.com/sap/support/notes/947081 Locales, languages, date and time formats in Web Dynpro and

note 1496407 https://service.sap.com/sap/support/notes/1496407 Switch WD application locale through portal personalization

as it might help you solve your issue

Robin

Former Member
0 Kudos

Thank you very much Robin. And sorry for the late response. I was not well so...

The Webdynpro application is now showing the date in DD.MM.YYYY format when i change the language to "German".

Now the issue i have is, all the text on the portal is also changing to German. But we dont want that. We want everything in english only (as we are not ready for translation yet) but show the currency and number formats etc in locale specific format.

Is this possible using config settings or do we have to handle it in code only?

Thanks a lot for your advices.

junwu
Active Contributor
0 Kudos

i think you have to handle it by code specifically.