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

round

Former Member
0 Likes
1,094

I want to round the number.

Eg: 222.467 I declard the variable type C.

I want like this 222.47

Is there any FM for this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,054

Hi,

You can declare the variable type P decimals 2.

Pls reward if useful.

Regards,

Aswin

10 REPLIES 10
Read only

Former Member
0 Likes
1,054

HI,

You can use FM 'ROUND'.

Cheers,

Bujji

Read only

suresh_datti
Active Contributor
0 Likes
1,054

You can use the function module ROUND.

Regards,

Suresh Datti

Read only

0 Likes
1,054

i tried that FM ( round ).

but no use.

is there any other FM.

Read only

Former Member
0 Likes
1,055

Hi,

You can declare the variable type P decimals 2.

Pls reward if useful.

Regards,

Aswin

Read only

Former Member
0 Likes
1,054

MOve this value to a variable of type p decimals 2.

data: v_dec type p decimals 2.

v_dec = v_char.

Read only

Former Member
0 Likes
1,054

Hi,

Try to use FM 'HR_IN_ROUND_AMT'.

If it works fine then no problem if not then you need to declare one field TYPE P DECIMALS 2 and move your amount field to this field.

Cheers,

Bujji

Read only

Former Member
0 Likes
1,054

Thank u

I got it

How I can assign the points.

Read only

Former Member
0 Likes
1,054

Hi Priya,

The FM 'HR_IN_ROUND_AMT' will work perfectly..

There you can specify in ROUND_OFF parameter( if I remember correctly) the amount of rounding off.

Just specify your requirement and it will give u the desired result.

<b>YOu can assign points by clicking on the suitable radiobutton on the left </b>...

Regards,

SP.

Read only

abdul_hakim
Active Contributor
0 Likes
1,054

HI PRIYA,

YOU CANNOT USE ROUND FOR CHARACTER TYPE FIELD.

DATA: VAR1 TYPE P DECIMALS 2,

RES TYPE P DECIMALS 2.

VAR1 = '12.33'.

RES = ROUND( VAR1 ).

WRITE RES.

Cheers,

Abdul

Read only

0 Likes
1,054

HR_NZ_ROUNDING_DECIMALS

HR_IN_ROUND_AMT

REWARD POINT IF IT HELPS

GUNJAN