10-10-2007 9:01 AM
Hi all,
i ahve a filed temp of type dec lenght 3 decimal 1.
now i have to assign 100.000000 (this comes from user, i ahve no control over it )to temp;
finally i want 100.0 in temp.
this is urgent for me.
Thanks in advacne
Amarender Reddy B
10-10-2007 9:05 AM
Hi,
DATA : TEMP1(3) TYPE P DECIMALS 3 VALUE '100.000000',
TEMP2(3) TYPE P DECIMALS1.
TEMP2 = TEMP1.
WRITE :TEMP2.
Thanks.
10-10-2007 9:06 AM
try:
data temp type p LENGTH 3 DECIMALS 1.
data zval2 TYPE p DECIMALS 7 value '100.000000'.
temp = zval2.
WRITE / temp.
10-10-2007 9:12 AM
the value which comes from user of length 16 decimal 6, this can any value
i ahve to assign this to length 3 deimal 1.
if i use = operator i am getting a short dump (runtime error) .
plz help
10-10-2007 9:32 AM
data : a(16) type p decimals 3,
b(3) type p decimals 1.
a = '100.000000'.
b = a.
write 😕 b.
This code is not giving short dump...just check it....!!!!
10-10-2007 9:40 AM
Hi,
if your input is allways a 16 lenght field with this structuter:
nnnnnnnnn.nnnnnn
you can use this:
data : c0(16),
c1(3) type p decimals 1.
c0 = '123456789.123456'.
c1 = c0+6(5).
write 😕 c0.
write 😕 c1.
Regards, Dieter
10-10-2007 9:09 AM
Hi,
try this:
data: DEC0 type p decimals 6.
data: dec1 type p decimals 1.
*
dec0 = '100.000000'.
dec1 = dec0.
*
write:/ dec0.
write:/ dec1.
or this:
data: dec1 type p decimals 1.
*
dec1 = '100.000000'.
*
write:/ dec1.
Regards, Dieter