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 for Analytical Data

Former Member
0 Likes
828

Is there a function module that does Rounding for Analytical Data?

If I use function module ROUND, 1.25 becomes 1.3 and 1.35 becomes 1.4

But in analytical rounding rules, if the last digit is even round down and last digit is odd round up. So 1.25 becomes 1.2 and 1.35 becomes 1.4.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
4 REPLIES 4
Read only

former_member194669
Active Contributor
Read only

Former Member
0 Likes
775

Hi

Try to use FIMA_NUMERICAL_VALUE_ROUND

Max

Read only

0 Likes
775

FIMA_NUMERICAL_VALUE_ROUND does not seem to handle analytical rounding rules

Read only

Former Member
0 Likes
775

megan,

do one thing.

check the last digit of the number(dec_digit in the code snipet). (1st digit after decimal as per your rule). u can pass it to string and then use split or some other thing to get the 1st digit after decimal.

then use a if block either to floor or ceil.

gv_val = dec_digit mod 2.

if gv_val = 0.
   gv_result = floor (amount).

else.
   gv_result = ceil (amount)

endif.

i am not givign a executed code here as i dont have sap currently with me. but use this logic. hope this will do your job.

thanks

Somu