2008 Dec 17 3:09 PM
Hi;
i have a smartform where i have fields with 3 decimal places. Now the SD consultor whants that i take off one decimal place and some fields display 2 decimal places and other fields with no decimal places.
thanks on advance.
2008 Dec 17 3:31 PM
Hi,
Declare like this
data: w_decimal TYPE p DECIMALS 2. "for storing dec value up to 2
Pass the value to w_decimal to store with 2 decimal
Thanks,
Krishna...
Hi;
i have a smartform where i have fields with 3 decimal places. Now the SD consultor whants that i take off one decimal place and some fields display 2 decimal places and other fields with no decimal places.
thanks on advance.
2008 Dec 17 3:31 PM
Hi,
Declare like this
data: w_decimal TYPE p DECIMALS 2. "for storing dec value up to 2
Pass the value to w_decimal to store with 2 decimal
Thanks,
Krishna...
2008 Dec 17 3:34 PM
data: dec_0 type p,
dec_2 type p decimals 2,
dec_3 type p decimals 3.
dec_0 = dec_2 = dec_3.
write: dec_0, dec_2, dec_3.
2008 Dec 17 5:18 PM
Hi,
You need to use the following statement:
WRITE v_wrbtr TO v_char CURRENCY v_waers.
Here: V_WRBTR stores the amount value (define it as DATA: v_wrbtr TYPE wrbtr),
V_CHAR will store the amount depending on the Currency (define it as DATA: v_char(16) TYPE c),
For ex.: If the currency is USD and Amount is 100, v_char = 100.00
If the currency is JPY and Amount is 100, v_char = 10,000 (JPY has no decimal places)
If the currency is USD and Amount is 100, v_char = 10.000 (TND has 3 decimal places)
So you just need to display the variable 'v_char'.
V_WAERS will store the currency i.e. USD, JPY or TND etc (DATA: v_waers TYPE waers).
Hope it helps.
Thanx & Regards,
Nadim