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: 

BAPI_SALESORDER_CREATEFROMDAT2 ???

Former Member
0 Kudos

Hi Experts,

Can we use BAPI_SALESORDER_CREATEFROMDAT2 wrt Create with reference,

If so how to go about it? Reward points awaiting....

Thanks in advance

Rajs

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Here for your reference:

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

salesdocumentin = w_line-vbeln

order_header_in = order_header_in

IMPORTING

salesdocument = salesdocument

TABLES

return = return

order_items_in = order_items_in

order_partners = order_partners

order_schedules_in = schedules_in

order_conditions_in = conditions_in

order_text = order_text.

Regards

Raj

5 REPLIES 5

Former Member
0 Kudos

Hi

Here for your reference:

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

salesdocumentin = w_line-vbeln

order_header_in = order_header_in

IMPORTING

salesdocument = salesdocument

TABLES

return = return

order_items_in = order_items_in

order_partners = order_partners

order_schedules_in = schedules_in

order_conditions_in = conditions_in

order_text = order_text.

Regards

Raj

0 Kudos

Hi Rajasekhar,

My question is how can I create a BAPI for VA01 wrt to billing document?? via create with reference method.

Thanks in advance,

Rajs

0 Kudos

Hi,

Whether its abilling document or any data you have to pass same set of data to create the order in VA01.

There are copy control routines that can be used when ever you are creating a document from other document,This is more of a functional.Can you consult your functional owner regarding this.

Regards,

Sasi

Former Member
0 Kudos

Hi,

Yes,this is latest version from SAP and this should be used,as the maintenance of the older versions may become absolate.

https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-Simpleprogramtocreatesalesorderusing+BAPI

regards

sasi

Former Member
0 Kudos

Hi,

Use the following.

data:

l_i_ret TYPE STANDARD TABLE OF bapiret2, "Return

l_i_schdl TYPE STANDARD TABLE OF bapischdl, "Schedule line

l_i_partners TYPE STANDARD TABLE OF bapiparnr, "Partner

l_i_orderitems TYPE STANDARD TABLE OF bapisditm, "Item

l_rec_orderhd TYPE bapisdhd1,

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

order_header_in = l_rec_orderhd

IMPORTING

salesdocument = l_vbeln

TABLES

return = l_i_ret

order_items_in = l_i_orderitems

order_partners = l_i_partners

order_schedules_in = l_i_schdl.

You can use this to create the sales documents.