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

rounding

Former Member
0 Likes
542

Hi

i have a field WS_TOTAL_KWMENG type KWMENG which is QUAN field

the value of this is 20.000 , i want to round it

round FM is not working

Please suggest

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
523

Hi,

Declare a integer variable, Move Quantity variable value to Integer Variable.

Regards,

Satish

3 REPLIES 3
Read only

Former Member
0 Likes
524

Hi,

Declare a integer variable, Move Quantity variable value to Integer Variable.

Regards,

Satish

Read only

Former Member
0 Likes
523

Hi Chari,

You can use the Function Module MURC_ROUND_FLOAT_TO_PACKED.

Or you can check the following code.Here,two variables num1 and num2 are defined with float and packed data types.When num1 is moved to num2,it is automatically rounded off as the decimals given as 2 in num2.

DATA: num1 TYPE f value '19.468323',

num2 TYPE p decimals 2.

num1 = '19.468323 '.

num2 = num1.

WRITE num2.

Reward if helpfull,

Thanks,

Kashyap

Read only

Former Member
0 Likes
523

Hi Chari,

try this code...

DATA : a type float, b type num.

a = '12.221111'.

b = a.

write b.

Reward if useful...

Regards,

Goutham.