‎2007 Jul 02 12:25 PM
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.
‎2007 Jul 02 12:32 PM
data:
amount type wrbtr,
TEMP_AMOUNT LIKE AMOUNT.
amount = '123.45'.
temp_amount = TRUNC( amount ).
write: AMOUNT, temp_amount.
‎2007 Jul 02 12:28 PM
hi,
transfer value to interger variable and then show.
Jogdand M B
‎2007 Jul 02 12:29 PM
‎2007 Jul 02 12:30 PM
Hi Reddy,
Check this link,
https://forums.sdn.sap.com/click.jspa?searchID=3585616&messageID=3536394
Thanks.
‎2007 Jul 02 12:30 PM
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
‎2007 Jul 02 12:32 PM
data:
amount type wrbtr,
TEMP_AMOUNT LIKE AMOUNT.
amount = '123.45'.
temp_amount = TRUNC( amount ).
write: AMOUNT, temp_amount.
‎2007 Jul 02 12:34 PM
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
‎2007 Jul 02 12:36 PM
> 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...
‎2007 Jul 02 1:37 PM
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
‎2007 Jul 03 8:56 AM