Application Development and Automation 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: 
Read only

About Round off Value

former_member532868
Participant
0 Likes
510

Hi

I want to pick up decimals only in packed value.

Example

data: I_TOTAL LIKE J_1ITAXVAR-J_1ITAXAM1.

round off bellow value to my conditions.

if value is 1994.50 and bellow .50. i want to change 1994.

if value is 1994.51 and above .51 then only change to 1995

which function module works like as above my conditions.

or send to the detail code

Please send me as early as possible.

Regards,

Hari

Hi

I want to pick up decimals only in packed value.

Example

data: I_TOTAL LIKE J_1ITAXVAR-J_1ITAXAM1.

round off bellow value to my conditions.

if value is 1994.50 and bellow .50. i want to change 1994.

if value is 1994.51 and above .51 then only change to 1995

which function module works like as above my conditions.

or send to the detail code

Please send me as early as possible.

Regards,

Hari

2 REPLIES 2
Read only

Former Member
0 Likes
492

use floor ,ceil and trunc statements.You will get the required result.

Read only

Former Member
0 Likes
492

hi Hari,

Use ROUND FM to achieve this ...


data : orig_amt type p decimals 10 value '0.29846',
round_amt type p decimals 4.

call function 'ROUND'
exporting
decimals = 4
input = orig_amt
sign = '-'
importing
output = round_amt
exceptions
input_invalid = 1
overflow = 2
type_invalid = 3
others = 4.

write : round_am. 

Regards,

Santosh