Google Search - Blog...........

Rounding Off A Value To A Particular Decimal Length

data: nu(10) type p decimals 4.
data: nu1(5) type p decimals 2.

nu = '4.017'.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 2
INPUT = nu

* SIGN = ' '

IMPORTING
OUTPUT = nu1

* EXCEPTIONS
* NPUT_INVALID = 1
* OVERFLOW = 2

*TYPE_INVALID = 3

* OTHERS = 4

2 comments:

  1. Seems like rounding should require more than 10 lines of code. sheesh

    ReplyDelete
  2. can use field round in slis_fieldcat_alv.While definining the fieldcat.

    ReplyDelete