cancel
Showing results for 
Search instead for 
Did you mean: 

currency code "JPY"

Former Member
0 Kudos

Hi,

It explains my problem again.

There is an amount of money of Japan "12,345".

This amount of money is stored in DB of the R/3 system in the form of "123.45(JPY)".

When this amount of money is acquired by using the rfc module of WEBDYNPRO, "123.45(JPY)" can be acquired.

When the amount of money is output according to given information, it is displayed, "123".

(The currency code "JPY" doesn't treat the decimal. )

However, this is not a correct amount of money display. It is a method that I requests that is converted and displayed, "123.45" -> "12,345".

R/3 system DB : 123.45

RFC module acquisition : 123.45

displays : 123(This is not correct. )

Display for which I hope : 12,345

regards.

koo

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member192434
Active Contributor
0 Kudos

try this

double amount = 12.345;

NumberFormat formatter = new DecimalFormat("#00,000");

wdComponentAPI.getMessageManager().reportSuccess("The Decimal Value is:"+formatter.format(amount));

for more details check this

http://java.sun.com/j2se/1.4.2/docs/api/java/text/NumberFormat.html

Former Member
0 Kudos

Thank you for the reply.

Certainly, the problem can be solved even by this method.

However, when it is this method, it is necessary to describe all the display forms of each currency.

JPY -> DecimalFormat("#00,000")

USD -> DecimalFormat("#000.00")

KUD -> DecimalFormat("#00.000") etc.

If it is ABAP instruction, it is possible ..appropriate display form.. to mend by referring to the currency.

Write 'Amount of money' To xxx currency 'Currency code'.

It is an instruction and a method that I requests by WebDynpro for Java to convert into an appropriate display form only by referring to the currency just like ABAP instruction.

To begin with, is such a thing possible in WebDynpro for java instruction?

pravesh_verma
Active Contributor
0 Kudos

Hello Koo,

You can try one thing. If you are using some datatype for getting this amoutn value then there should be some property of that datatype which should define the format of the currency.

Can you try and get the currency format from the datatype of the attribute which is bind to the amount field.

Try this:

wdContext.node<NODE_NAME>().getNodeInfo().getAttribute("ATTRIBUTE_NAME").getSimpleType().getFormat();

This will give you the format of the attribute. Using this format can you try and get the value. i think this should solve the problem.

Thanks and Regards,

Pravesh

Former Member
0 Kudos

Mr. Pravesh Verma

Thank you for the reply.

I test the method of teaching to you.

Moreover, please lend your knowledge when some problems occur.