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: 

Material substitution with BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Kudos

Hi, I'm creating sales orders with BAPI_SALESORDER_CREATEFROMDAT2 in background, I have some materials that have substitutes, but when I use the bapi, the material is does not change. When I create the sales order manually in the VA01, the material is replaced.

thanks.

2 REPLIES 2

Former Member
0 Kudos

It should behave exactly the same. Usually when you run something online, there are certain fields that get defaulted and you will not notice. But when you call the BAPI, you have to pass those default values as well so that you will see the same result. You will have try it out in a couple of different ways and also debug the code where it decides whether or not substitution allowed and you can trace it back to the value that is missing.

Former Member
0 Kudos

It was solved changing the sales order, after it's created, a review is performed to check any substitutions, if they exist, the conditions are added via bapi_sales_order_change