Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Exponential Value

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member186055
Active Participant
0 Kudos

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

3 REPLIES 3

former_member186055
Active Participant
0 Kudos

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

Former Member
0 Kudos

But it doesn't work for exponential value

5.53382E+15, which converted value should be

5533815000176000

0 Kudos

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