Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

rounding off cuurency value

Former Member
0 Kudos

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,,,

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Round off to the nearest? Whole Number?

data: p type p decimals 2 value '12345.67'.

p = ceil( p ).

write:/ p.

Regards,

Rich Heilman

Former Member
0 Kudos

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.

ferry_lianto
Active Contributor
0 Kudos

Please check this FM.

FI_ROUND_AMOUNT

ROUND

ROUND_AMOUNT

HR_NZ_ROUNDING_DECIMALS

Former Member
0 Kudos

Hi Rajkumar,

Use the function module J_1I6_ROUND_TO_NEAREST_AMT and pass your variable to the FM

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.