2011 Nov 15 6:22 AM
My program needs to read values from excel file given by the bank into internal table. One of the column contains exponential values. Without changing the format on excel, how could i handle it on SAP? I tried FM QSS0_FLTP_TO_CHAR_CONVERSION. Im trying to convert the value of 5.53E+15 to 5530000000000000, but it returned me 5,53E 15 instead. This FM seems to work on certain values only. Please advise.
2011 Nov 15 7:15 AM
Hi
Check the below code this will help you....
data:
ti_saldos_wrbtr_pack(16) type p decimals 2,
ti_saldos_wrbtr_floa type f value '5.53E+15'.
move ti_saldos_wrbtr_floa TO ti_saldos_wrbtr_pack.
write:
ti_saldos_wrbtr_floa,
ti_saldos_wrbtr_pack.Regards,
Surya
My program needs to read values from excel file given by the bank into internal table. One of the column contains exponential values. Without changing the format on excel, how could i handle it on SAP? I tried FM QSS0_FLTP_TO_CHAR_CONVERSION. Im trying to convert the value of 5.53E+15 to 5530000000000000, but it returned me 5,53E 15 instead. This FM seems to work on certain values only. Please advise.
2011 Nov 15 7:15 AM
Hi
Check the below code this will help you....
data:
ti_saldos_wrbtr_pack(16) type p decimals 2,
ti_saldos_wrbtr_floa type f value '5.53E+15'.
move ti_saldos_wrbtr_floa TO ti_saldos_wrbtr_pack.
write:
ti_saldos_wrbtr_floa,
ti_saldos_wrbtr_pack.Regards,
Surya
2011 Nov 15 8:16 AM
But it doesn't work for exponential value
5.53382E+15, which converted value should be
5533815000176000
2011 Nov 15 10:08 AM
Hi,
There shouldnt be a problem with the code above . 5.53382E+15 will obviously not be interpreted by the program as
5533815000176000. For that you will have to pass 5.533815000176E+15 .
And when a write statement is encountered for this value , the format in which the value will be output will depend on the user settings that is maintained for the user through SU01.
But in your case i guess you want only conversion so moving the value as given in code above should work fine .
Regards,
Arun
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |