2008 Oct 19 8:45 AM
Hi all,
I have a requirement where i have to sum up all the local curreincies for a given fiscal years.
so while summing up i am moving the amount to a string varaiable. But if the amount consists of zeros in the decimal places then the decimals are not being replicated in the string variable.
For ex.
loop at itab.
x = x + itab-dmbtr.
endloop.
in the above ex if the total value of x(where x is of type string) is eq 50.00 then i am not able to display the decimals zero in the output. I declared the varaible x as string because the summation value is exceeding the length of the amount feild.
But if my total value of X is say 50.05 or 50.25 i am able to get these decimal places in the output. But if my total summation value contains zeros in the decimal places in the last i am not able to get those,like 50.00 or 50.20 , these are being displayed as 50 and 50.2.
Can anyone suggest..
2008 Oct 19 9:35 AM
Hi Rajesh,
Is there any special reason behind taking currency field as string it looks interesting. check this .00 is displaying completely.
DATA: A(7) TYPE P DECIMALS 2 VALUE 1234567.
A = A + '.00'.
WRITE: 'ANSWER', A.
Any issues using the above example revert back.
Cheers!!
Balu
2008 Oct 19 9:45 AM
Hi Balu,
I agree with you in the above example if you declare the variable as packed we will get decimals. But for me after doing the calculations the total sum is exceeding the packed varaible length 16 . Which is why i opted for string to hold the summation value in order to show in the output
2010 Apr 08 1:41 PM