Skip to Content
author's profile photo Former Member
Former Member

BAPI_SALESORDER_CHANGE Insert Issue

We have a program using BAPI_SALESORDER_CHANGE that is working for update and inserting new items. However, the insert for a new line item does not work for the below scenario.

SO has two commercial items with bonus items:

10 - Commercial 1

11 - Bonus 1

20 - Commercial 2

21 - Bonus 2

We are changing line item 10 where the quantity does not meet the minimum order for a bonus item. As a result line item 11 is being deleted automatically. At the same time, we're inserting another item 12 for line item 10 which is not working. The return table does not return any warning or error messages and line item 10 is being updated correctly.

But this is working fine if I changed the POSNR from 12 to 22 and UEPOS to 10 to 20.

Are we missing something?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 06, 2011 at 07:38 PM

    What exactly is "commercial" and "bonus" item? Is "bonus" item free goods?

    Normally if there are any dependent items (such as free goods, for example), they should not be added directly. Information entered for the "main" item will determine whether any dependent items need to be added.

    But it is not clear from the question what those "bonus" items are and how are they supposed to work. I suspect that's where the answer realy is.

    Add a comment
    10|10000 characters needed characters exceeded

    • This is actually more of an SD question that an ABAP question. Check with your SD consultant. What you're describing is exactly how the free goods determination works, so I'm not sure why there is an expectation it'll work in any different way.

      Either free goods need to be determined automatically by the system (in which case if the amount does not qualify for the free goods then, naturally, no free goods are added and existing ones are removed) or they need to be applied manually. It's not feasible to have it "both ways", I believe.

      If this is a case of some kind of a free goods override (e.g. amount doesn't qualify for the free goods, but, as an exception, you still want to give a free item to the customer), then such item needs to be added using some special item type or pricing condition (which would set price to 0). SD consultant needs to provide this information.

      Even in VA02 it needs to be done the same way, I believe, It's not just a matter of setting the line item numbers.

      If memory serves, we used "free goods override" in one of the past projects and it was a special pricing condition.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.