Skip to Content
0

VOFM routine to update PO condition value not modifying net price

May 09, 2017 at 11:10 AM

285

avatar image
Former Member

Hi all,

I have the requirement to change the value of a certain discount condition in purchase orders according to the historical purchase data of the material/vendor. That part is solved, as we have implemented a base formula routine for the condition and it correctly modifies its value. The problem is that, even when this value is modified, the condition value overwrites the net price of the position at the moment in which we try to save the purchase order.

I'd like to state that it changes it back to the original inforecord price only when we try to save: along the PO creation process it shows the modified value both in the conditions table as in the net price of the position.

Is there some way to avoid this behaviour? What are we getting wrong here?

Thanks in advance!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jürgen L May 09, 2017 at 11:45 AM
0

I am not sure if I understand your requirement.

all conditions together are kept in a pricing schema, which is basically used to determine the order price.

if A + B = C

Then I do not understand why C should stay unchanged while B is in- or decreasing in value.

This sounds for me inconsistent, can you clarify?

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 09, 2017 at 12:17 PM
0

Sure Jürgen, thank you a lot for your time.

This starts by creating a line for the material in the PO. SAP retrieves correctly the relevant inforecord and sets its net price to 10$. As our Z* condition is applied, the logic enters our VOFM routine and, according to our logic, it modifies the default value of the condition (which is zero) to the value I want (in this particular case it is a 20% discount).

In the condition details for the position I have this:

And it updates the net price in the position as I expect it to do it:

The problem appears when I try to save it. While the PO is being saved, at some point the net price in the position turns back again to 10$, so I presume that it is being overwritten with the inforecord price value. The condition value itself is not affected, but the net price in the position of the PO is not showing the proper value (as far I see it, I'm mainly an ABAPer so I may be missing something).

Oddly enough, if I mark for deletion that position its net price remains being 8$, which is the behaviour I consider right but can't get when I save the PO.

Thank you!


me21n-price.png (21.8 kB)
me21n-saved.png (12.3 kB)
Share
10 |10000 characters needed characters left characters exceeded