‎2007 Jan 18 5:40 AM
Hi Experts,
I have field in a table with float data type holding value '1.800000000000+E'.
I have to use this value in SAP SCRIPT and display in INT type '1.80'.
How can i do that? Please Suggest!!!
Rajiv Ranjan
‎2007 Jan 18 5:44 AM
Hello,
Declare a varible as Packed with 2 decimal places.
Move this into that varible and display it in the script.
Hope this helps.
Regards
‎2007 Jan 18 5:50 AM
DATA : FLOAT TYPE F VALUE ''1.800000000000+E'',
PACKED TYPE P DECIMALS 2.
PACKED = FLOAT.
Bilz.
- reward if helpful.
‎2007 Jan 18 6:09 AM
Hi rajeev,
<b>'1.80' is not a integer value
so if u want u r result to contain any decimal values u cannot pass that value to a integer variable.
Better u pass it to a packed variable with 2 decimal place </b>
in u r driver program u do this
data : v_p type p decimals 2.
v_p = v_f.
if u r using a standard driver program then change in u r form text elements where u r printing that value,
for example,
&EKPO-MENGE& -> 1,234.560
&EKPO-MENGE&(.2)& -> 1,235.56
‎2007 Jan 18 6:40 AM
Hi Rajiv,
You can use &var(.2)&. Then it will display only 2 decimal places.
Thanks,
Punit