Ex: Try this
Data : amt type i.
amount = 1234.00000.
amt = amount * 100000. " here 100000 is decimal places
So now amt equals to 123400000
amt = amt / 100000. " So amt = 1234.
I guess it will solve your problem.
Reward points to all useful answers.
Regards,
SaiRam
Hi,
You the following logic to get the value converted to 'N' number of decimal places :-
Field-symbols : <fs_number> TYPE p.
l_number = 1234.00000.
l_number = l_number * ( 10 ** N ).
ASSIGN l_number TO <fs_number> DECIMALS N.
WRITE <fs_number> TO l_final_number.
Award points if usefull.
Best regards,
Harsh
Hi,
Declare the variable with packed type of decimals 2.
Cheers,
Simha.
Reward all the helpful answers..
You may use the option
field(.0) for printing the quantity
field(.2) for printing the amount..
Go through SAP help given below..
<b>Number of Decimal Places
A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.
Syntax
&symbol(.N)&
The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
&EKPO-MENGE& -> 1,234.560
&EKPO-MENGE(.1) -> 1,234.6
&EKPO-MENGE&(.4) -> 1,234.5600
&EKPO-MENGE&(.0) -> 1,235</b>
Add comment