Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Doubt in Data Format

Former Member
0 Likes
1,029

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...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
999

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.

9 REPLIES 9
Read only

Former Member
0 Likes
999

Not 230.Its 234.

Read only

0 Likes
999

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

Read only

0 Likes
999

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..........

Read only

Former Member
0 Likes
999

Hi,

Move the value to an interger data type field..To remove the decimals.

Thanks,

Naren

Read only

0 Likes
999

Thnks Naren

Any other way to delete Only This Zeros....

Read only

Former Member
0 Likes
999

Declare the data type as integer for the fields of internal table for which you want such type of conversion.

Reward points if helpful.

Read only

0 Likes
999

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.........

Read only

0 Likes
999

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.

Read only

Former Member
0 Likes
1,000

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.