Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

currency type

Former Member
0 Kudos

Hi all......

Can some one tell me how to display a field of currency type which is stored in sap transparent table as amount(type:DEC). for eg., in sap table it is stored as 12345.000 but i need to display it as 123.45, because this 123.45 is compared with another field coming from a third party system, which gives the value 123.45

7 REPLIES 7

former_member188685
Active Contributor
0 Kudos

what is the Decimal notation you are following..?

since you mentioned 12345.000 , but you are asking to show it as 123.45 what happened to the rest of the zeroes.

what is the currency type..?

0 Kudos

hi vijay,

The value i need to display comes from sap table.

I need to show it as 123.45 for the value 12345.000 which comes from sap table. The currency type for this data field(12345.000) varies like usd, xaf, jpy, euro. This data field has a key in which the type is defined.

as for the zeroes, i need two decimal places in the currency.

0 Kudos

Can you divide the field with 100000?

12345.000 / 100000 = 123.45

0 Kudos

No, i cant divide or use shift for the field. I am asked to copy the amount from the sap table into a currency variable and this currency variable has to be encoded with currency code.

Former Member
0 Kudos

I used the split statement to get the value out.

0 Kudos

Hi Ghousia,

You cannot use split statement for a Packed decimal value.

You just have to define a temporary variable of type p decimals 2 and assign the value to it and display the same.

Thats it.

If you carry on working with the split statement, it might give errors in the future.

Regards,

-Syed.

0 Kudos

yes, absolutely. I tried that too but it didnt work out. so i used it since that value needs to be displayed only.

Thanks syed!