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
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
Seems like rounding should require more than 10 lines of code. sheesh
ReplyDeletecan use field round in slis_fieldcat_alv.While definining the fieldcat.
ReplyDelete