06-28-2007 7:32 AM
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
06-28-2007 7:45 AM
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
06-28-2007 7:45 AM
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
06-28-2007 7:55 AM
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
06-29-2007 8:06 AM
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
06-28-2007 7:50 AM
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
06-28-2007 7:55 AM
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.