Sales order creation with reference to quote using BAPI

Hi All,
I am trying to create a sales order with reference to quote using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
I am passing the Quote number and preceding doc.category (B) at the header level and
at item level I am passing the quote number and the line item number in the quote for REF_DOC and REF_DOC_IT.
The order is created but there seems to be some issue with the document flow.
I do not see the Reference Doc number at the header level from the Sales order document flow whereas I can see the Reference Doc for each line item.
In VBFA I can see the Ref.Doc number at the header level along with the Ref.Doc at the line item level.
Why do you think it is not showing at the header level from Sales Document Document Flow?
Is there any bug in the standard BAPI or is there any OSS note?
Any answer would be greatly appreciated.
Thanks
Sandeep

hi,
Are you giving different quotation numbers in the different line items, if that is the case you will not get that in the header document flow, as it cann't point to all the quotations.
Thanks,
Mahesh.

Similar Messages

  • Sales Order Creation with reference to Quotation using FM IDOC_INPUT_ORDERS

    HI Guru's,
    I've a requirement to create the sale order from the quotation.
    For this we are using the FM "IDOC_INPUT_ORDERS".
    Here my problem is i'm able to create the sales order with the custom program, but if i made any changes to the quotation Header
    (Ship-to party address) before creating the sales order, it is not reflecting into the sales order header level (ship-to party address).
    What  i was thinking is we are not using the Quotation as reference to create the sales order while filling the segments.
    Could you please tell me which segment do i need to use fill the reference document number (quotation) at header level.
    one more problem, if i change ship-to party of one line item, it is affecting the other line items also.
    Please guide me what to do???
    Thanks,
    Adi.

    HI Ramesh,
    Question:
    Could you please tell me which segment do i need to use fill the reference document number (quotation) at header level.
    Sol: use segment E1EDK02
    Segment type E1EDK02 IDoc: Document header reference data
    QUALF 011 : Referenced Document Number
    BELNR XXXXX IDOC document number
    DATUM 20100121 IDOC: Date'
    what i've used in my program
    I'm using the E1EDK02 segment as you mentioned above.
    le1edk02-qualf = '011'.
    e1edk02-belnr = Quotes-vbeln.
    Question:
    Here my problem is i'm able to create the sales order with the custom program, but if i made any changes to the quotation Header
    (Ship-to party address) before creating the sales order, it is not reflecting into the sales order header level (ship-to party address).
    Sol: Check you custom code .. whether you are bringing write address to segement or not
    (if you change any address in Quotation then Address master is added with new entry with new address no )
    In my program..
    I'm passing the partner numbers and partner types (WE & AG) to the segment "E1EDKA1". (Ship-to & Sold-to).
    What i was thinking is the above segment is causing the problems, because if we reference the Quotation, we should not pass the Ship-to and sold-to numbers, it should take all those from quotation.
    I've tried to comment the code which we have written for that segment "E1EDKA1", it is giving me the error saying that
    Customer numbers can't be determined for the document number..
    Please guide me how to solve this problem..
    Thanks,
    Adi.

  • Sales Order Creation with reference to Contract

    Hi all ,
    Existing Setup in the System:
    1)  I have a contract created with a validity period of 30 days. When i create sales order with reference to contract, then i get a pop-up box, from the box i can select my contract.
    2) I have a Lead time configured as 5 days for the Sales document type , I,e when I create sales order I can see my Requested delivery date is always system date + 5 days.
    3) I have a Pricing date configured as Today’s date. Therefore when I create sales order I can see pricing date becomes the system date.
    Execution of Sales Order:
    4) When I create Sales Order with reference to contract document. Always Requested Delivery date is compared with Contract Validity Dates.
    Example: Contract Validity 01/03/2008   -    31/03/2008
    Sales Order: Sales Order Creation date -> 19/03/2008, Pricing Date: 19/03/2008 Requested delivery date 24/03/2008.
    REQUIREMENT IS:
    But my requirement is when i create Sales Order it should consider System date or Pricing Date( since pricing date is today date)  for to compare with contract validity dates.
    Can it be done with standard config or do we need to some type of custom?  Appreciate your help
    Thanks

    Hi ,
    As said when I create Sales Order with reference to contract document. Always Requested Delivery date on Sales Order is checked against Contract Validity Dates.
    But i want Pricing date  in Sales Order should be checked against Contract Validity Dates.
    Can someone suggest me on this?

  • Sales order creation with reference to a contract....urgent

    Hi all,
    I am creating a sales order with reference to a contract, but purchase order no. and date are not copying to the sales order due to standard sap settings, is there any solution to copy these two from contract to order ?
    Useful solutions will be rewarded.

    Hi Jithendra,
    You need to edit the copy control settings. Path
    IMG Screen/Sales & Distribution/Sales/Maintain Copy control for Sales Documents.
    In this Goto Copying Control for Sales Documents to Sales Documents. And you need to change the header settings for the given selection.
    I think this might help you.
    Regards,
    Sreekanth

  • BAPI for sales order creation with Reference

    Hello Experts,
    I have a order, with its reference I have to create a new sales order.
    Am looking for BAPi, with which I can create a sales order with a Reference order (which is in my hand), so I checked SE37 with wild cards, but I did not find any!!
    1) Pls. let me know a BAPI
    2) And just like that I do not want to create a new order with the reference(existing) order, I have to change the PO number & order Reason(2 fileds) in newley creationg order, pls. let me know How to do it
    Thank you

    Hi,
    First try to pass these two parameters to BAPI_SALESORDER_CREATEFROMDAT2
    ORDER_HEADER_IN-REFDOCTYPE = Your Sch. Agreement No. (Please Check) and
    ORDER_HEADER_IN-SD_DOC_CAT = 'E'.
    If the above doesnt work ,than try using BAPI "BAPI_SALESDOCUMENT_COPY"
    I hope you are working in SAP R/3 4.6C and above version because i am not sure whether this BAPI is available in lower version.
    Let us know if this helps you..
    Rgds,
    Mayank

  • Is there any BAPI available for sales order creation with reference?

    Hi Experts,
    My requirement is to create sales order with reference for order type.
    Now my billing document number already contains the two items
    one is correct and another is zero quantity.
    I want to create order with reference of billing document but not with zero quantity item.
    Which BAPI I should use and what to pass to ignore zero quantity item?
    Regards,
    RH

    Hi Ronny,
    Try using BAPI_SALESORDER_CREATEFROMDAT2
    Regards,
    Shraddha

  • Sales order creation with reference to check quantity according reference

    Hi,
    I create return sales order with reference. But the problem is that system can not check the quantity of creation sales order according reference quantity now. I want the system check the quantity according reference sales order quantity and do not allow to put sales order quantity more than reference sales order quantity.
    Thanks.

    hi,
    please check the below thread
    Return Quntity is more the sales Quantity?
    this may help you
    regards
    senya

  • Problem in Sales Order Creation with reference to Contract

    Hi All,
    We had enhanced Contracts (VA41) by adding fields thru append structures in VBAP and the same is provided in the "Additional Data B" tab at the item level.
    The Z fields are populated with data and gets saved along with the contracts line items.
    But when a sale order is created with reference to a contract, the data in the Z fields (maintained in Append Structures) of the contract are not getting copied to the line item of Sales orders.
    Should a routine be necessarily written for copying Z fields from contract to Sales orders or Copy control must be set up for Z fields separately?
    Any info on this would help.
    Thanks,
    K.V.Venkatasubramanian

    Hi VJ,
    The copying from Contract to Orders worked. I copied the standard routine (151) in data transfers and added the code to transfer Z fields from work area CVBAP to work area VBAP and attached the same in the copy control. It works!!!
    Thanks for the help VJ.
    Cheers,
    Venkat

  • BAPI SALES ORDER & Copy with reference

    Hello,
    I'm creating sales order copied with reference to an invoice. My problem is that the data item is empty. When I create the sales order manually and use the option 'Create with reference' and choose an invoice, the sales order is created with all data item. I don't know how I can get to copy the data item from the invoice in the new sales order. The code that I'm using is the following:
    DATA: order_header_in      LIKE bapisdhd1,
          order_partners       LIKE bapiparnr OCCURS 0 WITH HEADER LINE,
          order_text           LIKE bapisdtext OCCURS 0 WITH HEADER LINE,
          order_header_inx     LIKE bapisdhd1x,
          order_item_in        LIKE bapisditm OCCURS 0 WITH HEADER LINE,
          order_schedules_in   LIKE bapischdl OCCURS 0 WITH HEADER LINE,
          order_conditions_in  LIKE bapicond OCCURS 0 WITH HEADER LINE,
          extensionin          LIKE bapiparex OCCURS 0 WITH HEADER LINE,
          partneraddresses     LIKE bapiaddr1 OCCURS 0 WITH HEADER LINE,
          order_cfgs_ref       like BAPICUCFG occurs 0 with header line.
    DATA: salesdocument LIKE bapivbeln-vbeln.
    DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    order_header_in-doc_type   = 'ZA09'.
    order_header_in-sales_org  = '1700'.
    order_header_in-distr_chan = '01'.
    order_header_in-division   = '01'.
    order_header_in-BILL_DATE   = '20060701'.
    order_header_in-ref_doc    = '0900000019'.
    order_header_in-refdoc_cat = 'M'.
    *order_header_in-REF_DOC_L_LONG = '0900000019'.
    order_header_in-purch_no_c  ='prueba'.
    *order_header_in-ord_reason = '003'.
    *order_header_in-pmnttrms   = '0002'.
    *order_header_in-sales_off  = '2800'.
    order_header_in-ref_doc_l  = 'FACTURA ES'.
    *order_header_in-fix_val_dy = '20060701'.
    *order_header_in-currency   = 'USD'.
    *order_header_in-exchg_rate = '1.2'.
    order_partners-partn_role = 'AG'.
    order_partners-partn_numb = '0000000001'.
    order_partners-langu      = 'EN'.
    order_partners-name       = 'El corte aleman'.
    order_partners-country = 'ES'.
    APPEND order_partners.
    order_partners-partn_role = 'RE'.
    order_partners-partn_numb = 'ARR000'.
    order_partners-addr_link  = '0000030044'.
    APPEND order_partners.
    CALL FUNCTION 'ADDR_GET_COMPLETE_ALL_TYPES'
      EXPORTING
        addrnumber                 = order_partners-addr_link
      PERSNUMBER                 =
        address_object_type        = '1'
      IV_CURRENT_COMM_DATA       = 'X'
    IMPORTING
      ADDR1_COMPLETE             =
      ADDR2_COMPLETE             =
      ADDR3_COMPLETE             =
       ADDR1_COMPLETE_BAPI        = partneraddresses
      ADDR2_COMPLETE_BAPI        =
      ADDR3_COMPLETE_BAPI        =
    EXCEPTIONS
      PARAMETER_ERROR            = 1
      ADDRESS_NOT_EXIST          = 2
      PERSON_NOT_EXIST           = 3
      INTERNAL_ERROR             = 4
      OTHERS                     = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    data: vl_texto(40) value 'NUEVOOOOO'.
    partneraddresses-name    = vl_texto. clear vl_texto.
    partneraddresses-name_2  = vl_texto.
    partneraddresses-name_3  = vl_texto.
    partneraddresses-name_4  = vl_texto.
    partneraddresses-langu   = 'E'.
    APPEND partneraddresses.
    DATA: vl_cantidad LIKE bapisditm-target_qty.
    vl_cantidad = 1.
    order_item_in-itm_number = 10.
    order_item_in-material = 'HONORARIOS'.
    order_item_in-ref_doc = '0900000019'.
    order_item_in-ref_doc_it = 10.
    order_item_in-ref_doc_ca = 'M'.
    APPEND order_item_in.
    order_schedules_in-itm_number = 10.
    order_schedules_in-req_qty = vl_cantidad.
    APPEND order_schedules_in.
    order_text-text_id = 'Z001'.
    order_text-ITM_NUMBER = ''.
    order_text-langu = 'EN'.
    order_text-text_line = 'Hola, CARACOLAcola'.
    APPEND order_text.
    order_text-text_id = 'Z001'.
    order_text-langu = 'EN'.
    order_text-text_line = 'Adios caracol'.
    APPEND order_text.
    order_text-itm_number = '000010'.
    order_text-text_id = '0001'.
    order_text-langu = 'EN'.
    order_text-text_line = 'Hola, POSICIÓN'.
    APPEND order_text.
    extensionin-structure = 'BAPE_VBAK'.
    extensionin-valuepart1 = '          BCL  7'.
    APPEND extensionin.
    order_cfgs_ref-posex = '10'.
    order_cfgs_ref-config_id = '10'.
    order_cfgs_ref-root_id = '00000001'.
    append order_cfgs_ref.
    CALL FUNCTION 'ZBAPI_SALESORDER_CREATEFROMDT2'
      EXPORTING
       SALESDOCUMENTIN               =  salesdocument
        order_header_in               =  order_header_in
       ORDER_HEADER_INX              =  order_header_inx
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       salesdocument                 = salesdocument
      TABLES
        return                        = return
        order_items_in                = order_item_in
      ORDER_ITEMS_INX               =
        order_partners                = order_partners
        order_schedules_in            = order_schedules_in
      ORDER_SCHEDULES_INX           =
        order_conditions_in           = order_conditions_in
      ORDER_CONDITIONS_INX          =
        ORDER_CFGS_REF                = order_cfgs_ref
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
        order_text                    = order_text
      ORDER_KEYS                    =
       extensionin                   = extensionin
        partneraddresses              = partneraddresses
    PERFORM  report TABLES return.
    *DATA: salesdocument LIKE bapivbeln-vbeln.
    *DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    *refresh return.
    *CALL FUNCTION 'BAPI_SALESDOCUMENT_COPY'
    EXPORTING
       salesdocument          = '0400000191'
       documenttype           = 'ZA04'
      TESTRUN                = ' '
    IMPORTING
       SALESDOCUMENT_EX       = salesdocument
    TABLES
       RETURN                 = return
    *PERFORM  report TABLES return.
    *write: / salesdocument.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
      RETURN        =
    *&      Form  report
          text
         -->P_MENSAJE  text
    FORM report  TABLES   p_mensaje STRUCTURE bapiret2.
      DATA: vl_mensaje TYPE string.
      LOOP AT return.
        CLEAR vl_mensaje.
        MESSAGE ID     return-id
                TYPE   return-type
                NUMBER return-number
                INTO   vl_mensaje
                WITH   return-message_v1
                       return-message_v2
                       return-message_v3
                       return-message_v4.
        WRITE: / vl_mensaje.
      ENDLOOP.
    ENDFORM.                    " report

    Hi Manuel,
    There are some function modules which is there to copy the order details. I am not sure about the function module name. But you can search in SE37. But bapi for creating the sales order does not have the functionality of copying the data from one document to another document.
    You can try using this function module.
    BAPI_SALESDOCUMENT_COPY
    Data will be copied based on the copy control routines that is set between the two document types.
    Thanks,
    Arun

  • Error  : Sales order 'create with Reference' to the contract

    We have made a value contract. Now we are trying to make a Sales order 'create with Reference' to the contract.
    when we do that, we am getting error 'copying material in any value contract item is not permitted'
    Any help or directions would be greatly appreciated . We are on Ecc 6.0
    Rohit

    As of now my value contract has just one material. so i dont need assortment module settings. right?
    in VTAA settings are as follows
    Target type: OR  
    Source type: ZK1
    there is only on item category
    Target item category: TAN   
    Source item category: WKN
    Copying requirement : 301
    update doc flow : 2
    pricing type : C
    cont item copy mode : A
    DataT am using 151,102,002
    There are no schedule line.
    Rohit
    Edited by: rohit kumar on May 15, 2008 7:36 PM

  • I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. So, what are the parameters that I need to set in CRM system so that my quotation gets replicated?

    Dear Experts,
    I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. What are the parameters that I need to set in CRM system so that my quotation gets replicated without any error?
    Please help me in this regard. An early and in detail step by step guidance is highly appreciated.
    Thanks,
    SMTP

    It may be best to recreate the folder and the smart playlists from scratch.
    tt2

  • Change of Sold to Party in Sales order created with Reference to Contract

    Dear Gurus
    I want to change the sold to party in Sales Order created with reference to contract.
    When I create a Sales order with reference to contract the system copies all the partner functions- Sold to, Ship to, Bill to and Payer alongwith other data.
    However Sold to is marked as "Grey" and not changable, rest of the partners can be changed.
    There is no subsiquent document created with reference to this Sales Order.
    Please advice.
    Thanks a lot.
    Regards
    Raghu

    Hi ,
    Please follow the below mentioned step.
    1) Create a partner function letts say Authorized SP .
    2) Assign all the possible authorised  SP (customer) in the contract.
    3) When you create sales order with reff to Contract. Put the customer for whom you wish to create a sales order in release partner tab.
    Hop this will resolve our problem
    Regards,
    Krishna O

  • Sales Order Created with reference to Contract - Exchange rate Issue

    When Sales Order created with reference to contract VBKD fields KURSK and KURSK_DAT gets copied from contract and not redetrmined based on pricing date and Exchange rate type. I expected it to be determined based on pricing date is standard. What I am missing, should it be controlled by data transfers
    If Document currency and condition currency are different it cause problems with incorrect condition values are calculated, as KOMP-KURSK are copied from VBKD-KURSK
    Any help or directions would be greatly appreciated . We are on 4.7 ISOIL
    Sincerely Julietta

    Well,
    and if we have the same issue, but we don't have OIL Version, but simple 4.6C, which solution has to be applied then?
    Thank you
    Standa

  • Create ecatt script for one sales order creation with multiple line items

    Hi ,
    I want to create a ecatt script for one sales order creation with multiple line items. Preferably SAP GUI.
    This selection of data will be from an external file/ variants which will have only one row of data in it.
    Firstly: I have to sort the external file having same PO Numbers in an order.Group them together.
    Second: I have to create sales order for those many line items having same PO Number.
    Best Regard
    Taranum

    Hi Micky
    Firstl you should upload the Line items for a particular sales Order in an Internal table
    and then pass that internal table to your BAPI during your coding corresponding to a particu;lar sales order
    In case of any issues pls revert back
    Reward points if helpful
    Regards
    Hitesh

  • Purchase order creation with reference to Contract

    Dear All
                    Purchase order creation with reference to quantity contract the contract quantity is not copied in to po. any configuration copying rules required. please guide
    Regards
    Anand.

    Hi Buddy
    The correct business process is RV Preq created by a user from any department then buyer converts this Preq to a MK contract with some quantity keeping the duration as some months/year. Then as and when material mentioned in the contract is required during the validity period of the contract MRP creates Preq or buyer manually creates NB preqs , same are then converted to PO but these PO are released against MK contract. So qty in PO are different then mentioned in contract because contract is for  a large qty keeping in mind the duration (for example one year).
    Regrds
    Yogesh

Maybe you are looking for

  • How can I install photoshop elements on a 64 bit windows system?

    How can I install photoshop elements on a 64 bit windows system?

  • Network drives show while connected

    I have a WD NetworkCenter Drive connects to the network via CAT5, here is the poser, this will not connect or be seen while I am wireless, but once I plug in the CAT5 Cable, all SHARED drive connections are there. Would some one please tell me what a

  • Correct OCR text in PDFs

    This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/pro/using/WS58a04a822e3e50102bd615109794195ff-7f6f.w.h tml

  • Third-party WiFi card clarification

    I am looking for clarification on what is needed for a Wifi connection before purchasing the card. I have a Titanium Powerbook, 15-inch, 667mHz, OS X 10.3.2. I do not have an airport card installed, but I do have airport drivers (3.2). If I purchase

  • ACTIVITY PROCESS ORDER

    Hi, Is there any report to get the list of Process orders or Material codes where a specified activity or work centre assigned The requirement is to get the data of One activity is assigned in which different Process orders (Material codes). Regards