‎2006 Nov 06 9:26 AM
hi to all,
help me in this issue
how to round off the amount of different currencies without using round_amount and fi_round_amount
thanks in advacne
kiran kumar
‎2006 Nov 06 9:30 AM
Hi,
You can handle it.
FM HR_IN_ROUND_AMT and HR_NZ_ROUNDING_DECIMALS
rgda
Anver
if hlped pls mark points
‎2006 Nov 06 9:32 AM
hi anersha,
in our system all the curencies r not maintained so there is a problem with funcitonal modules both fi_round_amount and round_amount.
thanks in advance
kiran kumar
‎2006 Nov 06 9:30 AM
‎2006 Nov 06 9:36 AM
Have a look at below code.
Report ztest.
DATA pack LIKE vbap-netwr VALUE '123.456'.
WRITE pack DECIMALS 2.
WRITE: / pack ROUND -2,
/ pack ROUND -1,
/ pack ROUND 1,
/ pack ROUND 2.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
‎2006 Nov 06 9:37 AM
Hi kiran,
then try this.
goto>attributes> check Fixed point arithmetic,
Fixed point arithmetic
If you mark this checkbox, all caluculations in the program will use fixed point arithmetic.
If you do not, packed numbers (ABAP/4 type P, Dictionary types CURR, DEC or QUAN) will be treated as integers when they are used in assignments, comparisons and calculations, irrespective of the number of decimal places defined. Intermediate results in arithmetic calculations will also be rounded to the next whole number. The number of decimal places defined is only taken into account when you output the answer using the WRITE statement.
this will work
REPORT ZSPELL.
data : v_amt type p decimals 2 value '40.58',
v_int type i.
v_int = floor( v_amt ).
write : v_int.
regards,
Anver.
if hlped pls mark points
‎2006 Nov 06 9:47 AM
use as ur requerment for rounding..
check this example...
DATA: I TYPE I,
P TYPE P DECIMALS 2,
M TYPE F VALUE '-3.5',
D TYPE P DECIMALS 1.
P = ABS( M ). " 3,5
I = P. " 4 - business rounding
I = M. " -4
I = CEIL( P ). " 4 - next largest whole number
I = CEIL( M ). " -3
I = FLOOR( P ). " 3 - next smallest whole number
I = FLOOR( M ). " -4
I = TRUNC( P ). " 3 - integer part
I = TRUNC( M ). " -3
D = FRAC( P ). " 0.5 - decimal part
D = FRAC( M ). " -0.5