Application Development and Automation 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: 
Read only

BAPI_SALESORDER_CHANGE

Former Member
0 Likes
512

Hi,

Can I do an update and insert at same time using BAPI_SALESORDER_CHANGE. Becoz when I update a qty on a line item it is getting updated properly, when I try to insert a new line item it is updated properly.

But When do both insert and update at a time it goes to upadate termination saying SQL_ARRAY_DUPEC_REC_INSERTED.

Please help!

2 REPLIES 2
Read only

Former Member
0 Likes
479

Are you inserting a new line that is not there currently on the sales order? I think you are not setting the line number of this new line correctly. You have to get the next available line number and use that for your new insert line. System is using existing line number and when it is trying to insert a line that already exists, you are getting this dump.

Read only

Former Member
0 Likes
479

Hi priya,

As far as I know you should be using another BAPI: BAPI_SALESORDER_CREATEFROMDAT2

Generally these rules apply:

1. BAPI_SALESORDER_CREATEFROMDAT2 is used to create new orders or add line items to existing orders.

2. BAPI_SALESORDER_CHANGE is used to make amendments to existing orders.

hope it helps.

regards,

Gaurav