06-27-2006 1:46 PM
hai to all
could please tell me hoe to round off the NETWR or NETPR value according to our needs,,, if any function module available
please,,,
06-27-2006 1:47 PM
06-27-2006 1:49 PM
Hi,
REPORT ZEXAMPLE.
TABLES T001R.
DATA V_AMTOUT LIKE BSEG-WSKTO.
PARAMETERS P_AMTIN LIKE BSEG-WSKTO.
WRITE:/ 'Original amount:', P_AMTIN,
/ 'Company', 15 'Currency', 35 'Amount'.
ULINE.
LOOP AT T001R.
CALL FUNCTION 'ROUND_AMOUNT'
EXPORTING
AMOUNT_IN = P_AMTIN
COMPANY = T001R-BUKRS
CURRENCY = T001R-WAERS
IMPORTING
AMOUNT_OUT = V_AMTOUT.
WRITE:/ T001R-BUKRS, 15 T001R-WAERS, 25 V_AMTOUT.
ENDLOOP.
Regards,
Sudhakar.
06-27-2006 1:50 PM
Please check this FM.
FI_ROUND_AMOUNT
ROUND
ROUND_AMOUNT
HR_NZ_ROUNDING_DECIMALS
06-27-2006 1:52 PM
Hi Rajkumar,
Use the function module J_1I6_ROUND_TO_NEAREST_AMT and pass your variable to the FM
06-27-2006 1:52 PM
HI rajkumar,
1. we can use ROUND statement.
2. 123456.68 = 123456.7 (after rounding)
3.
report abc.
*----
data : netwr type netwr.
data : str(15) type c.
netwr = '123456.68'.
write netwr to str round 0 decimals 1.
write str.
regards,
amit m.
06-27-2006 1:56 PM
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
Regards,
Ramesh.