‎2010 May 31 12:10 PM
Hi All,
i have made a WIHTHOLDING TAX REPORT in which there's a filed of tax rate in percent.The issue is that *tax rate * field given me point values which i want to be round off,for example:
TAX RATE is giving value of 5.9979 and i want it to be round off.It should be 6.Another example is if
TAX RATE is giving value of 3.3982 and i want it to be round off.It should be 3.3.
Another thing is that *TAX RATE * filed is giving 4 digit after point but i want it
‎2010 Jun 01 5:41 AM
Hi ..
I found one statement in order to work with this round function.It is really simple..
Have a try and let me know.......
Example is given below.........
DATA pack TYPE p VALUE '123.456'
DECIMALS 3.
WRITE pack DECIMALS 2.
WRITE: / pack ROUND -2,
/ pack ROUND -1,
/ pack ROUND 1,
/ pack ROUND 2.
‎2010 May 31 12:38 PM
‎2010 May 31 10:52 PM
Hi
You can use function module ROUND
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = ANDEC
INPUT = VI_F
SIGN = RT
IMPORTING
OUTPUT = VO_F
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.Edited by: Carlos Machado on May 31, 2010 11:52 PM
‎2010 Jun 01 3:11 AM
@modos,
i request you to allow or direct people to search these questions.. hope you will agree with me..
‎2010 Jun 01 5:41 AM
Hi ..
I found one statement in order to work with this round function.It is really simple..
Have a try and let me know.......
Example is given below.........
DATA pack TYPE p VALUE '123.456'
DECIMALS 3.
WRITE pack DECIMALS 2.
WRITE: / pack ROUND -2,
/ pack ROUND -1,
/ pack ROUND 1,
/ pack ROUND 2.
‎2010 Jun 01 5:49 AM
Rounding a value using 'FM'
data: num(10) type p decimals 4.
data: num1(5) type p decimals 2.
num = '4.017'.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = 2
INPUT = num
SIGN = ' '
IMPORTING
OUTPUT = num1
EXCEPTIONS
NPUT_INVALID = 1
OVERFLOW = 2
*TYPE_INVALID = 3
OTHERS = 4
.
U could have try this to resove this query.
Please let me know.
Good Luck..
‎2010 Jun 01 5:49 AM
Hi,
You can use the CEIL function..
Ex..
v_ouput = CEIL( tax_rate ).
write: / v_output.
that is the most easy.