‎2005 Dec 08 1:43 PM
Hi to all.
after i changed the INT4 to CHAR i lost the decimals for the field KILOMETER...
for example field KILOMETER shows me the figures 65.000 now after changed into CHAR now it showing me 65000...
how to solve..
raju
‎2005 Dec 08 1:48 PM
Hi Raju, can you elaborate more? Are you trying to display the kilometer?
If you are trying to get the character format, do the following,
If F1 is your kilometre field, F2 is character field and unit is stored in F3,
Write F1 to F2 UNIT F3.
This will ensure that your decimal field is converted to character format without losing the associated decimals..
‎2005 Dec 08 2:01 PM
Raju,
try that sample:
parameters km type bseg-menge default '65.015'.
data ints type i.
data decs type bseg-menge.
start-of-selection.
ints = trunc( km ). "calculate integer
decs = frac( km ). "calculate decimals
write: ints, decs.regards Andreas
‎2005 Dec 08 1:55 PM
Hi Raju,
Please try this, it is working for me.
data : dl_quan(20),
dl_kilomt(2) decimals 3.
CLEAR dl_quan.
MOVE dl_kilomt TO dl_quan.
Thanks & Regards,
Siri.
‎2005 Dec 08 2:04 PM
Hi,
Use the FM
C14W_NUMBER_CHAR_CONVERSION for conversion to char field.
Lokesh
Pls. reward appropriate points.
‎2005 Dec 08 2:25 PM
Hi,
Firstly int4 is a standard data type which can be viewed in SE11 in under the Data type option. If one goes to the domain level and see the characteristics it is an integer type of 4 bytes and 0(zero) decimal places or no decimal places. So even if one tries to assign a packed of a floating point number to it, it is the non-decimal part is taken and the decimal part is ignored.
So even if the int4 data type value is assigned to a character type it cannot show us the decimal values.
Regards,
Sharath
‎2005 Dec 08 3:01 PM
hi raju,
did u change the domain from INT4 to char or
in the program u had assigned the value of int4 to char
if u assign inthe program it should work fine
i had tried this code
REPORT YCHATEST .
data: kilo(20).
parameters: kil type p decimals 4 default '65.0000'.
kilo = kil.
write : kilo.