on 09-25-2006 5:12 AM
i have a inputField(name input1),which bind to a javaBean(myBean) attribute(price: Float type).
for example:
myBean.setPrice(11000.42).
but i wanna disply such a format: 11,000,420000 in my inputField of web dynpro view.
how to set it?
you know u cann't set to a simple type in u DD.
Hi
You have to change the format of the DD simple type in the dictionary.
1. Open the Simple Type
2.Click Representation Tab.
3.Goto the format field and supply your desired format.
For a list of format visit this link
http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html
Hope this helps
Ananda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI WINGOAL,
THR ARE STANDARD FORMATTING FUNCTIONS AVAILABLE IN JAVA.
U CAN USE CURRENCY FORMAT FUNCTION .
[nt : see java API for formatting]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you want to show in to your Input Field, use type String. Runtime you change it String with your desired format(11,000,420000) like (,) and zero's concatenating.
I don't think, there is any ready made solution for this.
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Try this code in wdDoInit() method.
wdContext.node<YourNode>.getNodeInfo().getAttribute("YourAttribute").getModifiableSimpleType().setFormat("0,000.000000");
Regards
KK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
this value getting from BAPI or any other way.
If getting the value from BAPI U can set in R/3 side.
Other wise we can display in View when we are getting form the BACK END.
Let me know how the value will come.
Thanks
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
U should have data type is same what u displayed on the view must be match then only it is possible.
If that match the previous post is works fine.
Other wise it shows some exception like
com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(ApplicationView.Z_Rfc.Output.O_Table.price): must not modify the datatype of a mapped attribute .
Please find this and solve your problem.
thanks
Lohi.
Hi
This is with reference to Lohitha's preveious post.
My post is applicable only to value nodes and not to model nodes. If you happen to bind UI Elements directly to model nodes you will encounter an exception. This is one reason why it is a bad idea to bind UI Elements directly to model nodes.
If your value node in view is mapped to a value node in a component/custom controller, write the formatting code in the wdDoInit() method of controller ( i.e. at the source). The code works fine.
Regards KK.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.