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

Create sales order with reference via BAPI

Former Member
0 Likes
14,537

Hi all,

I would like to know if is it possible to create a sales order with reference using BAPI, that is, I want to create an order from a contract, for example, referencing one or more contract itens. If so, what variable or table should I use?

I think that the most suitable function is

'BAPI_SALESORDER_CREATEFROMDAT2' or should I use another to do this?

I am using release SAP ECC 6.0.

Thanks for any help.

Paulo

1 ACCEPTED SOLUTION
Read only

Former Member
6,016

The BAPI is ok; use the following item fields to create a reference to a contract:

ref_doc (contract)

ref_doc_it (contract position)

ref_doc_ca (document type contract).

Regards,

John.

5 REPLIES 5
Read only

Former Member
0 Likes
6,016

Paulo,

you can either use these one also:

BAPI_SALESORDER_CHANGE         Sales order: Change Sales Order   
BAPI_SALESORDER_CONFIRMDELVRY                                    
BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order   
BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order

Amit.

Read only

Former Member
6,017

The BAPI is ok; use the following item fields to create a reference to a contract:

ref_doc (contract)

ref_doc_it (contract position)

ref_doc_ca (document type contract).

Regards,

John.

Read only

Former Member
0 Likes
6,016

Hi,

You are using the correct BAPI to create the Sales Order, but you need to give the reference contract number and type in the Header structure ORDER_HEADER_IN of the BAPI, to create a sales order with reference to a contract.

You cann't create a Sales order with reference to multiple contracts, but you can multiple sales orders with reference to 1 contract.

Thanks,

Mahesh.

Read only

0 Likes
6,016

Hi Mahesh,

Can ou please tell me how ca I create multipesales orders ith reference to one contract?

Thanks!

Rakesh

Read only

Former Member
0 Likes
6,016

yes, you are using right BAPI i.e. BAPI_SALESORDER_CREATEFROMDAT2

You will have to provide ORDER_HEADER_IN in that, Others are optional, even then if you have data for them, Provide it for better performance.

For any confusion related to chosing BAPI : You may go to BAPI transaction and find out the correct BAPI according to ur need. for example sales order relatd BAPI's are

BAPI_SALESORDER_CHANGE :Change Sales Order

BAPI_SALESORDER_CREATEFROMDAT2: Create Sales Order

BAPI_SALESDOCU_CREATEWITHDIA: Create Data Container with Dialog

BAPI_SALESORDER_GETLIST:List of all Orders for Customer

and so on.

Reward if helpful..