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

how to create a sales order using bapi

Former Member
0 Likes
549

hi

i need to create a sales order using bapi.

can any one help me

hi

i need to create a sales order using bapi.

can any one help me

3 REPLIES 3
Read only

Former Member
0 Likes
499

Do NOT USE BAPI_SALESORDER_CREATEFROMDATA, that FM is obsolete!

Use BAPI_SALESORDER_CREATEFROMDAT1 .

To build a reference to your contract you have to supply ORDER_HEADER_IN.

Here´s a sample:

MOVE:

gs_vbak-vbeln TO ls_bapisdhd1-refobjkey,

gs_vbak-vbeln TO ls_bapisdhd1-ref_doc,

gs_vbak-vbtyp TO ls_bapisdhd1-refdoc_cat,

gs_vbak-auart TO ls_bapisdhd1-refdoctype.

also gothrouh the links

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2b-%2bsimple%2bprogram%2bto%2bcreat...

Read only

Former Member
0 Likes
499

Hi Hari,

Please use the below mentioned BAPI.

BAPI_SALESORDER_CREATEFROMDAT2

Reward me with points if i am correct.

Regards!

Abby.