2014 Jun 06 9:46 AM
Hello,
I find something strange with the XML transformation. In fact, I have a field typed FLOAT with the value : '0.0053526555490249' and when I call the transformation I get the value : 0.0053526555490248998.
Try this code and tell me if you have the same issue :
TYPES: BEGIN OF l_typ_test,
float TYPE float,
END OF l_typ_test.
DATA: l_str_test TYPE l_typ_test,
root TYPE l_typ_test,
l_var_output TYPE string.
l_str_test-float = '0.0053526555490249'.
CALL TRANSFORMATION id
SOURCE root = l_str_test
RESULT XML l_var_output.
WRITE l_var_output.
Result :
<?xml version="1.0" encoding="iso-8859-1" ?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ROOT>
<FLOAT>5.3526555490248998E-3</FLOAT>
</ROOT>
</asx:values>
</asx:abap>
If you have any suggestion to solve the issue, I'll be glad to know it
Kind Regards,
2014 Jun 06 9:55 AM
You can use decfloat34 type instead of float as it is more precise.
The output would show correctly.
2014 Jun 06 10:14 AM
Hi Joseph,
I think you will use character type and move your floating value to cahr before moving in call transformation.
because after XML conversion, field will bne consverted to XSTRING.
you can pass the char to XSTRING.
Regards,
Prasenjit