Application Development and Automation 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: 
Read only

decimal issue

Former Member
0 Likes
1,103

hi all,

for some of the currency there is no decimals.(EX;HUF,VND).

In my program we converted the foreign currency(USD) to local currency(VND).

after converting the function gives the local amount (vnd) in decimals.i dont want these decimals.how to remove these decimal??

please suggest.

PS:prompt replys will be rewarded.

thanks,

cs reddy.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,039

data:

amount type wrbtr,

TEMP_AMOUNT LIKE AMOUNT.

amount = '123.45'.

temp_amount = TRUNC( amount ).

write: AMOUNT, temp_amount.

9 REPLIES 9
Read only

Former Member
0 Likes
1,039

hi,

transfer value to interger variable and then show.

Jogdand M B

Read only

rodrigo_paisante3
Active Contributor
0 Likes
1,039

Hi,

see this

Read only

Former Member
0 Likes
1,039
Read only

Former Member
0 Likes
1,039

hi reddy,

declare a variable as

DATA : VAR1 TYPE P.

Now copy your calculated value to this VAR1.

then VAR1 will hold the required value without decimals.

<b>saying thanks is by rewarding points in SDN.</b>

kiran

Read only

Former Member
0 Likes
1,040

data:

amount type wrbtr,

TEMP_AMOUNT LIKE AMOUNT.

amount = '123.45'.

temp_amount = TRUNC( amount ).

write: AMOUNT, temp_amount.

Read only

Former Member
0 Likes
1,039

hi cs,

run this code i hope it will solve your problem

data x type f.

data temp type p decimals 1.

x = 39 / 18 .

write x.

temp = x.

write temp.

reward the points if helpfull

regards aashi

Read only

Pawan_Kesari
Active Contributor
0 Likes
1,039

> hi all,

> for some of the currency there is no

> decimals.(EX;HUF,VND).

> n my program we converted the foreign currency(USD)

> to local currency(VND).

> after converting the function gives the local amount

> (vnd) in decimals.i dont want these decimals.how to

> remove these decimal??

>

> please suggest.

>

> PS:prompt replys will be rewarded.

>

> thanks,

> cs reddy.

WRITE variable_from_fm into ur_variable CURRENCY 'XYZ'

where XYZ can be any currency...

Read only

Clemenss
Active Contributor
0 Likes
1,039

Hi CS Reddy,

the decimals you see in debugger for currency fields do not represent the decimals given in output.

<b>It is not necessary to move to other fields or divide/multiply by multiples of 10.</b>

For WRITE you need the CURRENCY addition or the field is part of a DDIC structure with valid reference field.

In ALV you can connect the currency value field with a currency key field in the fieldcatalog. This will also ensure the separate addition of currencies for sum fields.

Regards,

Clemens

Read only

Former Member
0 Likes
1,039

Thank you for all your suggestons.