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

Decimal FM

Former Member
0 Likes
1,221

Hi Friends,

can you tell me how to remove the decimals using FM (Ex: 20.000) It should display 20.

Thanx in advance,

Venu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,117

Hi,

I think this meet ur needs.

data: data1 type WERTV8 value '16.98'.

write: data1 decimals 0.

Message was edited by: JITHENDRA CHADICHAL

8 REPLIES 8
Read only

venkata_ramisetti
Active Contributor
0 Likes
1,117

Hi,

You can do that by just using write statement.

WRITE AMOUNT decimals 0.

But if you want to store the the value in ternally ten define a variable with a packed decimals type with decimals 0

Thanks,

Ramakrishna

Read only

Former Member
0 Likes
1,118

Hi,

I think this meet ur needs.

data: data1 type WERTV8 value '16.98'.

write: data1 decimals 0.

Message was edited by: JITHENDRA CHADICHAL

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,117

Hi, you can also just move it to an int.

data: i type i.
data: p type p decimals 3 value '20.000'.

i = p.

write:/ i.

Regards,

Rich Heilman

Read only

0 Likes
1,117

Hi Rich,

I am getting the value through subroutine in the form &OFKIMG&, Now I want to display the value without decimals.

Pls tell me how to code it.

Thanx in advance,

Venu.

Read only

Former Member
0 Likes
1,117

Hi, u can use this logic.

data: p1 type p decimals 3 value '20.000'.

data: p2 type p decimals 3.

data: p3 type i.

p2 = frac( p1 ).

write:/ p2.

p3 = trunc( p1 ).

write:/ p3.

regards,

VIjay

Read only

Former Member
0 Likes
1,117

hi Venu,

Pass those values to an integer variable ..

i.,e


 data : v_int type i,
        v_flo type f value '20.00'.

     v_int = v_flo.

   write : v_int, v_flo.

Regards,

Santosh

Read only

Former Member
0 Likes
1,117

Hi , in ur form

lets say &itab-OFKIMG& is giving u 20.00

&itab-OFKIMG(4.0)&,

will give u 20.

&itab-OFKIMG(4.0)&,

do this and check the value ..save +activate.

regards,

Vijay

Read only

Former Member
0 Likes
1,117

hi

good

use this function module

CONVERSION_EXIT_ALPHA_OUTPUT converts any number with zeroes right into a simple integer

store your value into a string and conver it

200000 than pass that variable through this function module you ll get your result.

thanks

mrutyun^