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
763

hi,

is there any function like round?

thanks in advance....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
693

There is a ABAP statement ROUND.

Check this link for details and examples.

http://help.sap.com/erp2005_ehp_03/helpdata/EN/9f/db9e3d35c111d1829f0000e829fbfe/frameset.htm

3 REPLIES 3
Read only

Former Member
0 Likes
694

There is a ABAP statement ROUND.

Check this link for details and examples.

http://help.sap.com/erp2005_ehp_03/helpdata/EN/9f/db9e3d35c111d1829f0000e829fbfe/frameset.htm

Read only

Former Member
0 Likes
693

Hi,

I think ceil and floor statement are used for rounding.

Thanks,

Sriram POnna,

Read only

Former Member
0 Likes
693

Hi,,

yes u can use the FM ROUND

Rounding to spec. no. of dec. place (round up, round down, comm. round

Functionality

This function module rounds the value INPUT to ANDEC decimal places. The parameter SIGN determines whether rounding is down ('-'), up ('+') or commercial ('X').

If SIGN = SPACE, there is no rounding (OUTPUT = INPUT).

Example

The value VALUE is to be rounded up to the nearest hundred.

DATA: VALUE TYPE F,

ROUND_VALUE TYPE F.

...

CALL FUNCTION 'ROUND'

EXPORTING

DECIMALS = 2-

INPUT = VALUE

SIGN = '+'

IMPORTING

OUTPUT = ROUND_VALUE

EXCEPTIONS

INPUT_INVALD = 01

OVERFLOW = 02

TYPE_INVALID = 03.

Note

The result of floating point rounding calculations can be incorrect in certain cases because of rounding errors.

If INPUT is a field of type P, internal calculatons similarly use packed numbers. This is expensive, but more accurate. If the calculation accuracy is very important, INPUT should thus be a field of type P.

plzz reward if it is usefull....

plzz dont forget to reward...