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: 

creating a salesorder from another order with different order types

Former Member
0 Kudos
103

hi gurus,

i have a salesorder already created.The order type is ZTR.

now I have to create another sales order with reference to the above order and the order type of the newly created order is 'KB'.For this I am using BAPI_SALESDOCUMENT_COPY which is returning me a sales order no but this sales order no is not getting created in database though I have called bapi_transaction_commit after bapi_salesdocument_copy.

Can anyone tell me that why the sales order is not getting created in database and also which bapi should I use in the above scenario?

Any help is appreciated.

2 REPLIES 2

0 Kudos
61

In your case, I think there is being a problem during the update of order’s data in database. Because, before the complete update, the number is generated as a number range by the function module. After generating it, the various tables are updated.

Could you please try the function module 'BAPI_SALESDOCU_CREATEFROMDATA1' let me know the result? I have used it and its working fine.

Please reward, If helpful.

Regards,

Chiranjit

Former Member
0 Kudos
61

hi,

Don't use : BAPI_SALESORDER_CREATEFROMDAT1 this bapi this is absolote....

Try to use this bapi : BAPI_SALESORDER_CREATEFROMDAT2

Bofore this try to get details from VBAK , VBAP, KNOV and kna1 tables.

Regards,

Sagun Desai....