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: 

convert from exponential to normal integer

Former Member
0 Kudos

Hi Friends,

Can you please help me suggesting the solutions for

conversion from format say

<b>1E+02 to 100</b>

Please suggest any conversion function modules or standard solutions for the same

Thank you

1 ACCEPTED SOLUTION

amit_khare
Active Contributor
0 Kudos

Check this routine -

data: a type string value '10E+02'.

data: b type f.

data: c type p.

b = a.

c = b.

write:/ b, c.

Hope this will help you.

Regards,

Amit

5 REPLIES 5

amit_khare
Active Contributor
0 Kudos

Welcome to SDN.

Check these FMs -KKEK_CONVERT_FLOAT_TO_CURR &

CHAR_FLTP_CONVERSION .

As an alternative just assign the value to type P variable and check.

Regards,

Amit

Reward all helpful replies.

0 Kudos

Hi Amith,

actually i have the a character string as

a = 1E+02

it cant be changed to packed number.

i tried using the fm sent by you CHAR_FLTP_CONVERSION.

but it did not help

now the thing the character string 'a' to an integer say 100.

Could you help me now regarding this

Former Member
0 Kudos

Hello,

if you want to calculate the value use the following

    • : Exponentiation of the left with the right operand.

Example:

value = 2 ** 3.

value will have 8.

Hope this is what you need

Gabriel

ferry_lianto
Active Contributor
0 Kudos

Hi,

No need FM, you can just move field with type F to type P.


DATA: NUM1 TYPE F VALUE '1E+02',
      NUM2 TYPE P DECIMALS 2.
                                                                        
NUM2 = NUM1.
                                                                        
WRITE: / NUM2.

Regards,

Ferry Lianto

amit_khare
Active Contributor
0 Kudos

Check this routine -

data: a type string value '10E+02'.

data: b type f.

data: c type p.

b = a.

c = b.

write:/ b, c.

Hope this will help you.

Regards,

Amit