‎2011 Mar 25 2:36 AM
currently, we face a issue, given PO amount 3230.58, after calling function "round", it becomes 3231.00, this is ok, but if PO amount 3230.12, after calling function round, it becomes 3230.12, it should be 3230.00,how to fix this?
if without calling function round, can any piece of code to fix the issue? thanks
‎2011 Mar 25 4:33 AM
Hi,
Have you specified 'SIGN' in the EXPORTING PARAMETERS.
Following are the options.
Flag for rounding up, rounding down, commercial roundoff
SPACE : no rounding (input = output)
'+' : round up
'-' : round down
'X' : commercial rounding
Naveen Vajja
‎2011 Mar 25 5:47 AM
Hi, Please try the following code
DATA: v_two_decimal type i VALUE '100',
v_amount1 TYPE MAXBT VALUE '100.12',
x_amount1 TYPE maxbt.
CALL FUNCTION 'HR_IN_ROUND_AMT'
EXPORTING
amount = v_amount1
rndoff = v_two_decimal " round off precision 2 decimal places
RNDLMT = 'N'
IMPORTING
RETAMT = x_amount1.
x_amount1 will give 100.00
if the value of v_amount1 is 100.58,
it will give 101.00
‎2011 Mar 29 11:25 AM
Hi
Try this
REPORT zteste_raul.
DATA: x TYPE p DECIMALS 3 VALUE '3230.58'.
DATA: y TYPE p DECIMALS 3 VALUE '3230.12'.
WRITE: x DECIMALS 0.
NEW-LINE.
WRITE: y DECIMALS 0.
--
Raul Natu
‎2011 Mar 29 11:50 AM
DATA: x TYPE p DECIMALS 2 VALUE '3230.58'.
DATA: y TYPE p DECIMALS 2 VALUE '3230.12'.
x = FLOOR( x + '0.5' ).
y = FLOOR( y + '0.5' ).
WRITE: x, "3231
y. "3230Regards
Marcin