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: 

Floating to char conversion

Former Member
0 Kudos

Hi,

I am fetching the floating value (AUSP-ATFLV) and I am storing that value into local variable in my Program. For example if AUSP-ATFLV contains value like 8.0000000000000000E+02 but I need to store this to 800 in my variable. So how to declare the variable I mean what type and what length I have to use for changing the above float value to 800. Please help me.

Thanks.

5 REPLIES 5

Former Member
0 Kudos

data : v_p type p. " decimals 2 if you want decimal point.

v_p = <assign your float variable i.e. AUSP-ATFLV >

write : / v_p.

regards

shiba dutta

Former Member
0 Kudos

Hi,

Check this code,

Just copy and paste.

data:
SOLLWERT type QPMK-SOLLWERT,
temp(16) type p decimals 2.

SOLLWERT = '8.0000000000000000E+02.

move SOLLWERT to temp.

write: SOLLWERT,temp.

Thanks.

Former Member
0 Kudos

You can define it as type I field.

Regards,

Atish

varma_narayana
Active Contributor
0 Kudos

Hi Babji..

You can declare a Variable of type P.

DATA : V_PACK(10) TYPE P DECIMALS 2.

DATA : V_FLOAT TYPE F VALUE '800'.

MOVE V_FLOAT TO V_PACK.

WRITE:/ V_FLOAT, V_PACK.

<b>

Reward if Helpful.</b>

Former Member
0 Kudos

<b>data: f type f value ' 8.0000000000000000E+02 '.

data: i type i.

write:/ f.

i = f.

write:/ i.</b>