Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_CHANGE Insert Issue

Former Member
0 Kudos

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?

3 REPLIES 3

Jelena
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Yes bonus item is free goods.

The bonus item has been determined automatically. But during change of quantity of the commercial item, the free goods has been automatically deleted as well (does not meet minimum order requirement). Now, we want to insert another item as bonus, this time manually. This is OK if we do it in VA02. It is also OK if we insert it under a different commercial item where there is no re-determination of free goods because of quantity changes.

The insert doesn't happen for those commercial items (10, 20, 30) where free goods re-determination is happening.

Jelena
Active Contributor
0 Kudos

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.