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 - Sales Order

0 Kudos

Hello all,

This is a simple question in regards to the sales order bapi. If I have an external program call the bapi and it has 10 line items will the sales order be created if one of the line items is in valid. For example, 10 line items are passed and line item 8 has an invalid material. Will the order be created with 9 items or will the bapi call fail due to the error.

Thanks,

Chris

2 REPLIES 2

Former Member
0 Kudos

Hi,

I think it will not create sales order. BAPI FM fails in this case.

Thanks,

Phani Diwakar.

former_member589029
Active Contributor
0 Kudos

I just made a quick test with an existing upload report where I am using 'BAPI_SALESDOCU_CREATEFROMDATA'. In case you pass in a material which doesn't exist, the BAPI errors out completely and no order is created at all. In your example you would not get the 9 valid items created but the whole order will fail.

In my case we might get invalid ISBN numbers which we translate into materials before we call the BAPI. At this point I do a check to MARA to make sure that the material is valid. If not I am not even passing it to the BAPI.

Your example again, my check would find out that one of the materials is invalid and only pass the 9 valid items to the BAPI which will then successfully create the order.

Hope that helps,

Michael