on 2007 Jul 20 1:21 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi..
Data : val1(10) type p decimals 2 value '11.00'.
Data : val2 type i.
val2 = val1.
write:/ Val2.
<b>reward if helpful.</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this FM: CONVERT_STRING_TO_INTEGER
Regards
Gopi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
Use statement
SPLIT Variable at '.' into variable1 variable2
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.