2005 Aug 17 11:36 AM
Hi,
Someone know which FM can I used to convert a float to a numeric??
Thanks
2005 Aug 17 12:04 PM
Usually there is no explicit conversion required. Just move it to a type N or P field to get the desired result.
Christian
2005 Aug 17 12:04 PM
Usually there is no explicit conversion required. Just move it to a type N or P field to get the desired result.
Christian
2005 Aug 17 12:09 PM
Hi,
No, it doesn't convert.
I have a field in a query like N but the field of the table is float so when it will be display, display it like 8.00000000+E01 and not 180
2005 Aug 17 12:18 PM
Hi,
try that :
data f1 type f value 180.
data f2(10) type n.
move f1 to f2.
write: / f1, f2.
*result*
* 1,8000000000000000E+02 0000000180
2005 Aug 17 12:07 PM
Hi Laura,
i think you need no fm
lokk F1 to move:
from docu:
The source field is converted into a packed number. The packed number is then converted into a numeric text field (see corresponding table).
Andreas
2005 Aug 17 12:53 PM
hi laura
use function module:MURC_ROUND_FLOAT_TO_PACKED
and if it works please reward the poitn and if u need any help in this again just mail back
thanks
2005 Aug 22 10:35 AM
Hi,
I tried to use that function but have an error
Errores tiempo ejecucióCALL_FUNCTION_CONFLICT_TYPE
Excepción CX_SY_DYN_CALL_ILLEGAL_TYPE
I don't know if I used it correctly
DATA: v_conf_tc TYPE ibco2_instance_tab2,
v_atinn_tc LIKE ibvalue0-atinn,
v_values_tc LIKE ibvalue0,
numerico type n.
CALL FUNCTION 'MURC_ROUND_FLOAT_TO_PACKED'
EXPORTING
IF_FLOAT = v_values_tc-atflv
IF_SIGNIFICANT_PLACES = 15
IMPORTING
EF_PACKED = numerico
EXCEPTIONS
OVERFLOW = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE numerico TO v_atwrt_tc.
I hope you can help me
Thanks
2005 Aug 22 10:42 AM
change the declation
numerico type n.
to
numerico(16) type p decimals 2.
Regards
Raja
2005 Aug 22 10:43 AM
actually the dump analysis would tell you which parameter was passed incorrect. i guess its numerico. confirm it with your dump analysis.
Regards
Raja