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: 

Creation of sales order with reference to Quotation using BAPI

Former Member
0 Kudos

Hi All,

I am using BAPI "BAPI_SALESORDER_CREATEFROMDAT2" for creating sales order. Can you please tell how can I create a sales order with reference to a Quotation.

6 REPLIES 6

Former Member
0 Kudos

Hey,

Populate the Sales document header (import parameter BAPISDHD1) as below

1.) &Quotation number& in the field REF_DOC_L

2.) 'B' in the field REFDOC_CAT

Try it and let me know if it works...

Kiran

Former Member
0 Kudos

Vinit,

In your header structure, set like this:

hdr-REF_DOC = i_order-vbeln. "assign quotation # to sales order

hdr-REFDOC_CAT = 'B'. "assign Quotation to VBTYP_N.

For each line item, set as follows:

  • Assigning ref doc to create line item entries in VBFA.

itm-REF_DOC = i_order-vbeln. "quote number

itm-REF_DOC_IT = i_vbap-posnr. "quote line item #

itm-REF_DOC_CA = 'B'.

data: ret_text type BAPIRET2.

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

ORDER_HEADER_IN = hdr

convert = 'X'

IMPORTING

SALESDOCUMENT = salesdoc

TABLES

return = ret_tbl

ORDER_ITEMS_IN = itm

ORDER_PARTNERS = prtnr

ORDER_ITEMS_inx = itmx

ORDER_CONDITIONS_IN = conds

ORDER_CONDITIONS_INX = condsx

order_schedules_in = schd_lin.

Don't forget those points.

0 Kudos

Vinit,

Have you solved your issue? If so, please reward points accordingly.

If not, plz provide more details of the issue.

Thanks in advance.

0 Kudos

Hi John,

Thanks a lot for your help. Now able to create sales order with reference to quotation.

0 Kudos

Vinit,

Glad to hear that it worked. Don't forget to award points for the helpful answers.

0 Kudos

Hi John and Vinit,

I am doing the same thing as you explained above,but it is not creating Sales Order with reference

from quotation.

Although, i am also passing Sales area and partner function.

Please reply it is urgent.

Thanks,

Rohit