cancel
Showing results for 
Search instead for 
Did you mean: 

Condition type specific rounding off

Former Member
0 Kudos

Dear all,

I am facing a problem in rounding up the value of my ocndition type.

I have read quiet a few threads on the same topic but the solutions given were either not working or not clear.

My requirement is as follows:

We are using a condition type for which always the decimal value should be rounded up.

For ex: if the condition value is Rs1.01, then it has to be rounded up to Rs.2,

A value of 1.25 should be rounded to 2,

A value of 1.75 should be rounded to 2,

A value of 1.07 should be rounded to 2.

Any value in the decimal should be rounded up.

This is required only for one particular condition type and not all condition types. The settings have been maintained in T.Code OB90 and in V/06 I have selected Condition Round up. Also I tried using Alt Calculation type 16 and 17 in my pricing procedure.

Despite using all these, the condition value is still not rounding up. Can you please suggest me where I could be going wrong?

Regards,

Rohan Gudavalli.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

OB90 only allows rounding per Company and Currency and these changes effect all condition types that are assigned formulas 016 and 017, which may be undesirable.

In your case you want the condition type value to be rounded always irrespective of company or currency or any other condition. So you can't use OB90 rounding along with rounding formula 017. Moreover it will only allow you to round to the nearest decimal either above or below according to the rule. You want only round to the upper integer value.

So you need to create your own custom alternative calculation formula and assign it to the condition type in the pricing procedure. We already have a custom formula 943 in our production system. Just copy this code and it should work.

* Round the amount to upper integer value
form frm_kondi_wert_943.
  check: rekursiv ne 'A'.
  xkwert = CEIL( xkwert ).
endform.

The CEIL function always rounds to the integer value not smaller than the original condition value, which should satisfy your requirement.

CEIL is short for ceiling, so it gets you the integer number that is on the ceiling of the number you gave

Former Member
0 Kudos

Thank you very much Vishnu.

What you have said is exactly right and the repply you have given is exactly what I was looking for. Thank you very much.

I would check with my ABAPer and post the updates.

Thanks and Regards,

Rohan Gudavalli

Answers (0)