‎2007 Jun 11 4:43 AM
Hi All
I am reading a text filr using GUI_UPLOAD into my internal table. In That I have values like 25.00 and 234.0 . So i need it as 25 and 230. Give me a simple way to do this.
Thanks...
‎2007 Jun 11 6:20 AM
hi scorpio,
define one variable with data type p,
ex: data: l_no type p.
move ur field into this variable (l_no),
then it gives as 25 or 234.
regards,
seshu.
‎2007 Jun 11 4:44 AM
‎2007 Jun 11 4:48 AM
Hi,
When you import all the data, you might used 'char' format in the internal table field, but later you move to integer format variable...so it can take only till decimals.
Regards,
donepudi
reward, if its useful
‎2007 Jun 11 5:21 AM
Hi
If i am moving to Integer format i will loose all decimals right. I need to avoid valuse if it contais only '0' after decimal part.
for eg 23.00 i dont want.
but 23.56 i want this value like this only..
Can anyone give a better idea..........
‎2007 Jun 11 4:45 AM
Hi,
Move the value to an interger data type field..To remove the decimals.
Thanks,
Naren
‎2007 Jun 11 4:47 AM
‎2007 Jun 11 5:21 AM
Declare the data type as integer for the fields of internal table for which you want such type of conversion.
Reward points if helpful.
‎2007 Jun 11 6:04 AM
Hi All
Waiting For ur reply..Is there any option to delete zero;s that is coming after decimal numbers..
Eg: 25.30.. I need it as 25.3.
and 23.00 i need it as 23.
Is there any option.........
‎2007 Jun 11 6:50 AM
Hi Scorpio,
try this
data: varpp TYPE p LENGTH 6 DECIMALS 4 VALUE '32.0000'.
data: varp2 TYPE p LENGTH 6 DECIMALS 4 VALUE '32.6500'.
data: varp3(7) TYPE c .
data: vari1 TYPE i,
vari2 TYPE i,
vari3 TYPE i.
varp3 = varpp <b>(or varp2).</b>
vari1 = STRLEN( varp3 ).
vari2 = vari1.
do vari1 times.
vari3 = vari2 - 1.
if varp3+vari3(1) ca '.0'.
varp3 = varp3+0(vari3).
else.
exit.
endif.
vari2 = vari2 - 1.
enddo.
WRITE 😕 'varp3 ' , varp3.
Regards,
Sooness.
‎2007 Jun 11 6:20 AM
hi scorpio,
define one variable with data type p,
ex: data: l_no type p.
move ur field into this variable (l_no),
then it gives as 25 or 234.
regards,
seshu.