2007 Mar 28 5:46 AM
Hi,
I have a numeric value eg: 123456789123456.1234567
I am getting it into my program using BAPI so it is converted into float and i am getting it as 1.234567891E+14
I want to convert it to char and i want to display it as
123456789123456.1234567
Is there any FM available for this.
Regards,
Ravi
2007 Mar 28 5:53 AM
Hi,
Write the statemetn as below.
v_float = 1.234567891E+14.
WRITE: V_FLOAT EXPONENT 0 DECIMALS 0 TO V_FLOAT
Regards,
Ram
Reward points if helpful
Message was edited by:
Ram Mohan Naidu Thammineni
2007 Mar 28 5:54 AM
Try moving it to a TYPE P field.
For eg
data: p type p decimals 3. (Choose decimal places based upon data)
data: f type f.
p = f.
Write:/ p.
2007 Mar 28 6:31 AM
hi ,
The value range of type F numbers is 1x10*-307 to 1x10*308 for positive and negative numbers, including 0 (zero). The accuracy range is approximately 15 decimals, depending on the floating point arithmetic of the hardware platform. Since type F data is internally converted to a binary system, rounding errors can occur. Although the ABAP processor tries to minimize these effects, you should not use type F data if high accuracy is required. Instead, use type P data.
You use type F fields when you need to cope with very large value ranges and rounding errors are not critical.
hence u cannot avoid the rounding errors when you convert it to pack type.
Regards,
Aparna
2007 Mar 28 6:41 AM
use the fm
KKEK_CONVERT_FLOAT_TO_CURR
MURC_ROUND_FLOAT_TO_PACKED
or take it in type p variable.
data : v_p type p decimals 6.
v_p = <your float value>
regards
shiba dutta