BAPI_SALESORDER_CHANGE – Updating Conditions

Home / Blog / BAPI_SALESORDER_CHANGE – Updating Conditions

It’s rather amazing, after all the time I’ve been using the BAPI: BAPI_SALESORDER_CHANGE, I just learned something new.  I was recently trying to do an update to a repair sales order to add lines automatically from a service quotation.  The problem I kept running into was that no matter what I tried, the update of a condition didn’t work. It just kept adding a second line (and to make things worse, it was ignored in lieu of the automatically determined condition).

this took some digging to figure out, but I finally found OSS Note: 593246

The note explains that the LOGIC_SWITCH-COND_HANDLE = ‘X’ parameter allows you to simplify the whole condition process.  By using this you no longer need to explicitly define something as insert or update (I or U).  Instead, you skip entering the entire CONDITIONS_INX table.  Instead, just enter in the basic fields of the condition that you need:

ORDER_CONDITIONS_IN-ITM_MUMBER = ‘000010’
ORDER_CONDITIONS_IN-COND_TYPE = ‘PR00′
ORDER_CONDITIONS_IN-COND_VALUE = ’10’
ORDER_CONDITIONS_IN-CURRENCY = ‘EUR’

the BAPI takes care of the rest.  I can’t believe I’ve never run into this before, but this one was worth capturing.

thanks for reading,

As always, thanks for reading and don't forget to check out our SAP Service Management Products at my other company JaveLLin Solutions,
Mike

4 thoughts on “BAPI_SALESORDER_CHANGE – Updating Conditions

  1. thanks for sharing.
    //The note explains that the LOGIC_SWITCH-COND_HANDLE = ‘X’ parameter allows you to simplify the whole condition process.

    a typo/”auto correction” there, it’s LOGIC_SWITCH-COND_HANDL = ‘X’, without an “E”

  2. Thank you so much!!!
    I was running into the same problem. When creating a sales order, the price for the material in a position has to be added explicitly (condition PR00). This condition was already displayed in the condition table. Only the value had to be added. But the BAPI kept adding a second PR00-line.
    With this explanation and this flag the amount is just added in the already included PR00 line.
    It works like a charm!

Leave a Reply

Your email address will not be published. Required fields are marked *