on 08-09-2007 3:16 PM
Hi All,
we are developing WebDynpro Application through RFC Adaptive model, everything is working fine except for number format.....
We are getting number format like 122.000,00 from backend.....but i want to display according to country specific.....
if any body done this coding according to country specific please tell me.
Really i appreciate your help.
Thanks and Regards,
Abhi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhilash,
Thanks for your immediate reply, i already tried that code.....i am not getting output.....
i am getting number like in this format 122.000,00....now i want to display like this format 122,000.00.....
please tell me how to write this code in webdynpro.
Really i appreciate your work.
Thanks and Regards,
Abhi.
This is little bit tricky. Becuase Java will not understand the format 12.00,00 but which is valid in SAP. I think you should change user settings to represent like 12,00.00.
Then you can use Locale.US or Locale.UK to get the corresponding countries formats with my previous code.
If you do not have option to change SAP user settings then programatically change the format fromt from 12.00,00 to 12,00.00
Regards
Abhilash
Hi
try this..
Date sapDate = wdContext.current<nodeName>Element.getMysapdate();
IUser currentUser = WDClientUser.getCurrentUser().getSAPUser();
Locale userLocale = currentUser.getLocale();
NumberFormat nFormat = NumberFormat.getNumberInstance(userLocale);
Number localeNumber = nFormat.parse(wdContext.currentContextElement().getSAPNumber());
Regards
Abhilash
Hmm......
There is no method called getSAPNumber. I referred it as context attribute.
Replace this with the actual field which holds numeric value in your application.
The code I mentioned above handles countrys specific formatting based on logged in user preferences.
I am not sure what else you need.
Regards
Abhilash
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.