cancel
Showing results for 
Search instead for 
Did you mean: 

interger value

Former Member
0 Kudos
106

Hi Experts,

I need to convert the 11.00 into integer value can any one shoe me how

to store the decimal value and change it to integer value

thanks

karthik

Accepted Solutions (0)

Answers (9)

Answers (9)

Former Member
0 Kudos

Hi,

Find the below code.

data: field1 type p length 5 DECIMALS 2 value '11.12'.

data: field2 type p length 5 DECIMALS 0.

field2 = field1.

write:/ field1.

write:/ field2.

Former Member
0 Kudos

Hi karthik,

have a look at this example

data f type f value '1.6'.

data i type i.

write f.

compute

i = TRUNC( f ).

write i.

i = f.

write i.

Ciao Bernhard

Former Member
0 Kudos

hi,

try this code

data : val type i.

data : val2 type p decimals 0 value '11.00'.

val = val2.

write 😕 val.

Reward with points if helpful.

varma_narayana
Active Contributor
0 Kudos

Hi..

Data : val1(10) type p decimals 2 value '11.00'.

Data : val2 type i.

val2 = val1.

write:/ Val2.

<b>reward if helpful.</b>

Former Member
0 Kudos

data lv_integer type i.

data lv_packed type p length 10 decimals 2 value '327.34'.

lv_integer = lv_packed.

write lv_integer.

Result:

327

former_member188827
Active Contributor
0 Kudos

u can move this value as

data zfloat type p decimals 2.

zfloat = '11.00'.

data zint type p decimals 0.

move zfloat to zint.

write zint.

plz reward points if it helps..

Message was edited by:

abapuser

gopi_narendra
Active Contributor
0 Kudos

Check this FM: CONVERT_STRING_TO_INTEGER

Regards

Gopi

Former Member
0 Kudos

Hi Karthik,

Use statement

SPLIT Variable at '.' into variable1 variable2

Regards

Arun

Former Member
0 Kudos

Hi

data: v_int type I,

v_p type p deciamls 2.

v_p = '11.00'.

move v_p to v_int.

write : / v_int.

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Kudos

Hi Anji,

Thanks for reply if I declare variable as Integer for the value 1.8 it is taking as 2

but i need 1 only

pls give the solution for this.

thanks in advance

karthik