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: 

create a sales order with a ref doc not existing in sap

Former Member
0 Kudos

Hi all,

Here is a urgent requirement for me.The requirement is like....

A sales order is created without any reference doc.Now i need to change it by updating VGBEL and VGPOS.But the prob is that the ref doc does not exist in sap.It exist in the system of franchises.Is it possible to modify the sales order?

Presently,i am using BAPI_SALESORDER_CHANGE and filling the ref_doc and ref_doc_it but the sales order is not updated.But the BAPI is not giving any error message.

Any one having solution?

Thanks in advance............

3 REPLIES 3

Former Member
0 Kudos

hope you are populating ORDER_ITEM_INX

and explicitly commiting the document.

1. Minimum entry:

You must enter the order number in the SALESDOCUMENT structure.

You must always enter key fields for changes.

You must always specify the update indicator in the ORDER_HEADER_INX.

2. Commit control:

The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.

Former Member
0 Kudos

Hi Subhojit,

Some BAPIs need to be commited through the BAPI_TRANSACTION_COMMIT, also check ORDER_ITEM_INX if 'X' is passed to the right field; but there seems to be some design issue here.

Document flows does not depend only on VGPOS field but also through the document flow table - VBFA. Your update of VGPOS would not be sufficient for document flow. Moreover, when the preceeding document flow is not available within R/3 it would not be the right move to update ref. doc fields. You may think about the standard scenario of having your franchisee systems send a PO which would then create a sales order; check "your reference field" in the order header or line item purchase order data screen, or add custom fields if it deems.

Hope it is helpful.

Regards,

Prabhu

0 Kudos

Thanks for the reply.

But in this case data is coming through IDoc with the ref doc no and ref item no.Then the sales order is created through BDC(done by SAP).I need to modify it.