Skip to Content
avatar image
Former Member

VOFM routine to update PO condition value not modifying net price

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 09, 2017 at 11:45 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2017 at 12:17 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded