Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Create Sales Order with reference to Quotation.

$
0
0

Hi Experts,

 

I am trying to create Sales order with reference to Quotation, it is creating SO, but it is not getting the details of Quotation.For example:

item details are coming empty.

 

Please suggest!!

 

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

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

  hdr-SALES_ORG =  'xxxx'     

   hdr-DIVISION = '10'.       

   hdr-DISTR_CHAN = '10'.

 

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'.

 

    prtnr-PARTN_ROLE = 'XX'.

     prtnr-PARTN_NUMB = 'XXXXX.

 

 

  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.

 

Thanks

Rohit


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>