01-10-2008 8:02 AM
hi,
how to convert a decimal number
suppose i want to convert 500.00- to 500.
plz help me in resolving this.
01-10-2008 8:08 AM
Ramya,
DATA : v_num type i.
Move : decimal variable to v_num.
Don't forget to reward if useful.
01-10-2008 8:13 AM
Hi,
Check the below logic:
data: dec type bkpf-KZKRS,
num type numc10,
ch type char10.
dec = '500.00'.
write : / dec.
num = dec.
ch = num.
shift ch left DELETING leading '0'.
write : / ch.
01-10-2008 8:22 AM
Hi Ramya,
Try this.
data : var type i,
var1(3) type n.
i = -500.
var1 = var.
Regards,
Mohaiyuddin
01-10-2008 8:33 AM
Hi Ramya,
You can use Field symbol with CASTING operator to convert decimal to Numeric Type (Intergers). You can try with other Numeric type also.
data:wf_int type i,
wf_dec(10) type x.
field-symbols: <fs> type any.
wf_dec = '28'.
assign wf_dec to <fs> casting type i.
wf_int = <fs>.
write wf_int.
kindly reward if helpful.
cheers,
Hema.