Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

XKOMV-KWERT isn't calculated while creating an order

Hi,

I created the following calculation rule:

FORM FRM_KONDI_WERT_907.

XKOMV-KBETR = KOMP-KZWI2.

XKOMV-KBETR = XKOMV-KBETR * 1000 / KOMP-MGAME.

XKOMV-KWERT = XKOMV-KBETR / 1000 * KOMP-MGAME.

ENDFORM.

If I now create an order, XKOMV-KWERT isn't calculated, means value = 0,00. After changing eg. the price, it's correctly calculated. The same after saving the order, the XKOMV-KWERT is filled with the right value.

Please help me to get this working right.

Thank you and regards,

Florian

Former Member replied

You may have to save the value in XKWERT instead of (or in addition to) XKOMV-KWERT.

This may be due to scoping issues.

One suggestion I would make is to put a breakpoint in your routine and look at the call stack when you create an order vs. when you change or save an order.

You may find that you have a different context in each situation (as I found with regard to XKOMV with some VOFM pricing requirements), so that you cannot rely on the integrity of XKOMV without some extra work, since the scoping might be different in each case.

If that is the case, we may have to go into further detail. There is a workaround for that.

But first try using XKWERT.

Basically, at the end of your routine:

XKWERT = XKOMV-KWERT.

(I still think you should simplify your other logic to eliminate the possibility of rounding errors.)

Good luck

Brian

Message was edited by:

Brian Sammond

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question