‎2008 May 15 12:44 PM
Hi All,
Is there any function module or any way to round up a variable.
For ex: 0.8 should become 1
and 0.3 should become 0.
Thanks.
‎2008 May 15 12:49 PM
Hi,
parameters: v1(10) type c,
v2(10) type c.
data: v3 type p,
v4 type p.
v3 = v1.
v4 = v2.
WRITE:/ v3, v4.
or
you can use ceil and floor functions.
I think it is useful for you.
‎2008 May 15 12:52 PM
‎2008 May 15 12:52 PM
HI,
Check ROUND FM ....
DATA : V_VAL TYPE P DECIMALS 2 VALUE '5.6',
V_VAL2 TYPE P DECIMALS 0.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 0
INPUT = V_VAL
* SIGN = ' '
IMPORTING
OUTPUT = V_VAL2
* EXCEPTIONS
* INPUT_INVALID = 1
* OVERFLOW = 2
* TYPE_INVALID = 3
* OTHERS = 4
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE : V_VAL2.
‎2008 May 15 1:24 PM
Hi Rohan,
Check the theard
https://forums.sdn.sap.com/click.jspa?searchID=11827536&messageID=4092214
Regards
Kiran Sure
‎2008 May 15 1:41 PM