Referencing Sales Order to a Quotation via BAPI

Dear all,
I encouter problems to reference a Sales Order to a Quotation when I try to use the SAP BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'. Even though later when I managed to create the referencing on both the Sales Order Header and Sales Order Line to the Quotation, the system still doesn't closed the Quotation status as Completed. This has caused the Quotation remains active and open for other Sales Order for referencing. Any ideas?
Thank you and regards;
-ah tiang-

Hi!
According to OSS note 370988 it seems you can't create sales order properly with reference to quotation using BAPI_SALESORDER_CREATEFROMDAT2 in straight-forward way:
Symptom
This note describes the problems of the 'Create with reference' function when using BAPIs to create sales documents.
If you are working online, you can use this function module to create a sales document with reference to an existing sales document or a billing document (for example, a debit or credit memo request) according to fixed rules. The rules for transferring information from the source document to the target document are defined in the copying control on header and item level. The creation with reference permits an item selection.
When you use BAPIs in SD, a function of this type is not fully available. A reference is only possible for a quantity contract, so that the target quantity of the contract can be reduced by the order quantity of the sales document. Furthermore, the document flow is also updated.
As an alternative to 'Create with reference' in Transaction VA01, two variants are provided for solving the 'Create with reference' problem in the BAPI.
1. Create a '1:1 ' - that is, a document copy of a sales document (customer quotation, order) with 'BAPI_SALESDOCUMENT_COPY'. At this point, you cannot create the 1:1 copy of either a billing document or a delivery.
2. Create a sales document that refers to an existing document with 'BAPISDORDER_GETDETAILEDLIST' and 'BAPI_SALESORDER_CREATEFROMDAT2'.
Reason and Prerequisites
As of yet, no method exists for creating a sales document that refers to an existing document.
Solution
For solution No. 1
1. Create the documents using the BAPI_SALESDOCUMENT_COPY function module. However, this only permits a 1:1 copy without factoring out individual items.
2. After you have created the document copy, you can use a change BAPI to edit this copy.
For solution No. 2
1. Collect the data for the reference document (for example a customer quotation) with the 'BAPISDORDER_GETDETAILEDLIST' function module. In the example code, focus exclusively on the partners, items, schedule lines and conditions.
2. Prepare the Data. Execute the 'copying control' manually. This way, you decide which values are to be transferred.
3. Create the sales document using the 'BAPI_SALESORDER_CREATEFROMDAT2' function module by transferring the prepared data.
4. Finally, you must remove a COMMIT WORK so that the sales document can be written into the database.
An example of solution 2 is attached as a text file. You are allowed to select items and quantities for example, if you use input parameters. If there are no entries, then transfer 1:1 from the reference document. When you enter the 'condition type' parameter, you can determine whether conditions are copied or recalculated ('G' for transferring from the preceding document; 'B' or ' ' for re-determining, and 'C' for re-determining with transfer of the manual elements).
Hope it helps.
And welcome here on SDN!
Regards,
Maxim.

Similar Messages

  • Error V2 005 when creating a sales order from a quotation

    I hope someone can come up with some ideas to help me with this error. My client is creating a sales order from a quotation and immediately on the first screen the error V2 005 pops up. The quotation was not created with reference to any previous document, and at this point not sold-to party has even been copied through to the sales order.
    To make this error more interesting, this is only happening with 1 particular customer.
    I have checked: credit management, customer hierarchies, material determination, customer info records and none of these are in use.
    Can someone please come up with some ideas?
    Thanks and regards
    Kikas

    Dear Sai,
    Thanks for this note I am going to try it, however I have some concerns because the issue is only happening in production, with 1 custoemr only, and QA is an updated copy of production and I could not replicate the error in QA using the same customer....
    If anyone has any other ideas please I would appreciate it
    thanks
    Kikas

  • How to create a Sales order from multiple quotations?

    Hi All,
    Please tell me how to create one sales order from multiple quotations?
    Regards,
    Maddy

    Hello Maddy,
    To create the sales order from multiple quotation, you should put the value "F - Only at item level: Always with selection option" under Quotation determination in your sales transaction type.
    It will give you a pop-up to choose your quotations item while creating the sales order.
    Some per-requisites are there:
    1. Copy control should be maintained between your quotation and sales order.
    2. Quotation should be error free and should have the status "Released"
    3. Sold to party and Organization should be same in both transaction.
    For more information you can check the below link:
    Processing Quotations - Sales Transactions - SAP Library
    Best Regards,
    Dinesh

  • Cannot change Tax Code from the referenced sales order line

    hi,
    Has anyone ever got this error when creating Sales Order(SO): "*cannot change Tax Code from the referenced sales order line*"?
    The error occur with order type Return.
    This SO is created by copying from another SO.
    Please help.
    Regards & thanks,
    eRie

    hi,
    Has anyone ever got this error when creating Sales Order(SO): "*cannot change Tax Code from the referenced sales order line*"?
    The error occur with order type Return.
    This SO is created by copying from another SO.
    Please help.
    Regards & thanks,
    eRie

  • Create sales order from multiple quotation

    Hi All,
    How we can create sales order from multiple quotation what is transaction code for this.
    Ahmed

    Hi Ahmed,
    There are two options.
    1. For creating Sales Order with ref to too many Quotations:
    Go to T. Code VA26 and enter the Doc Date or Quotation Valid to Date and Sold to party, Quotation Type to get all the outstanding Quotations for that particular Sold to Party. Then Select the required quotations and then select Follow-up actions button to create Single Sales Order.
    2. For less number of Quotations:
    You can simply go by referring each quotation by placing the cursor in alternate line item in sales order by selecting "Create with ref" button.
    Hope this will solve your problem.
    Ravi.

  • No new item in sales order refernced from quotation

    Dear All,
    I am creating sales order which is referenced from Quotation.
    I should not able to add item directly in sales order other than item which i got from quotation. i have checked copy control of QT to OR but could not find
    how can i do this?
    please help

    Hi friend ,
    In order that you should not be able to enter any item in the sales order apart from reference to  the quotation .
    1. Goto VOV8 .
    2. Select your sales order type , enter into it , in General Control , Select Reference Mandatory press F4 select  " With Reference to Quotation".
    This will solve ur problem .
    Reward if it helps .
    Regards,
    Aditya.

  • LSMW to create Sales Order refer to Quotation with multiple line items.

    Hi Gurus,
    I am new to LSMW, and my requirement is that, I have a file downloaded from another system, it is like this:
    Quotation No.  Sold to party  data        item no.       material no.     quatity
    556                         10000012                 10              19077                1
    556                         10000012                 20              19078                1
    557                         10000011                 10              19076                1
    And it is required I need to create orders in VA01 refering to quotations, and then delete all the items from quotation, and add the items in the file. I am now doing it through transaction recording in VA01, but I came to a difficult part, that is how I can process line items. Because the items number will only be decided at runtime, so I can not record a BDC for that. And I have read some guides on LSMW, one of it said that transaction recording in LSMW can not deal with deep structures. So could any1 help on this?
    Best regards,
    Vincent

    Dear SD Gurus n Experts,
    I have solved the above problem. But there is another problem appearing regarding the date format. Now system generating a message: Date . . is not valid.
    While I am using Date: YYYYMMDD format in flat file, which is SAP's Standard Format.
    In SDN Link: LSMW upload Sales Order using VA01/VA02     I have found that there are some date fields which are mandatory to filled. Here I have mapped
    VDATU - Requested delivery date,  BSTDK - Customer purchase order date,  PRSDT - Date for pricing and exchange rate,  BSTDK_E - Ship-to party's PO date, FKDAT - Billing Date, KORDT - Delivery Date,
    and PRGRS - Date type is Constant = D
    Can any one tell me, where is the priblem.
    With thanks,
    DSC

  • Multiple Sales Orders from One Quotation.

    Hey SD Gurus,
    I want to create multiple sales orders referring to one quotation. When I create the first sales order the status from quotation change to Completed and this doesn't enable me to create a new sales order. Please let me know how to satisfy this requirement. Thanks in advance.
    Please search the forums before posting - see [rules of engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    Edited by: Ian Kehoe on Mar 2, 2012 2:17 PM

    Hi,
    go to vtaa- copy controls for sales document to sales document.
    select your combination of order and quotation go to item level. There select value 0(zero) in field positive/negative negative.
    No need to change update document flow.
    After setting zero in copy control that be told on above. create order with respective to the quotation.
    After saving the order.
    go to document flow to see the status in between quotation and order.
    If you placed setting right, then u certainly observe for quotation status will be open. so you can create no. of sales order with respect to that quotation..
    Have a good day..

  • Creation of an ERP Sales Order or ERP Quotation from CRM Opportunity

    Hello Experts,
    The scenario is as follows:
    I have done the cross-system copy control of transaction types and item categories to enable ERP Quotation and ERP Sales Order creation from CRM Opportunity.  However, after saving the CRM Opportunity, when I click on the follow-up transaction and select ERP Quotation or ERP Sales Order from the list, the screen doesnt change and instead I got the following error:
    "Diagnosis
    An exception occurred during request processing. This was handled centrally. It changed the program flow and the result of the request probably contains errors.
    Procedure
    Contact your system administrator.
    Procedure for System Administration
    Activate checkpoint group BSP_WD_EXCEPTION_DISPLAY. To do this, use transaction SAAB. If the error recurs, further details are displayed.
    Exception Details
    CX_BSP_WD_INCORRECT_IMPLEMENT - Define component usage 'CUERPFollowUp'
    Method: CL_BSP_WD_REPOSITORY=>GET_CMP_USAGE_DEF
    Source Text Row: 20"
    Experts, kindly help me understand what the error is about and pointers to resolve it.
    Points would be awarded.
    Thanks,
    VSK.
    Edited by: venkatskumar on Feb 21, 2011 8:37 PM

    Hello Robert,
    Thanks for the quick reply.
    I have followed your instructions and I wanted to confirm one more thing with you.
    When I enter the component usage it gave a pop-up which said:
    "Enter either a reference or an interface view"
    Any information on what should be entered in the reference or the interface view? What should be the used component name and interface view name in this scenario?
    Kindly confirm.
    Points awarded
    VSK.
    Edited by: venkatskumar on Feb 22, 2011 12:37 PM

  • Sales Order Creation against Quotation reference using FM IDOC_INPUT_ORDERS

    Hi Experts,
      I have to create sales order against reference of Quotation using Function module IDOC_INPUT_ORDERS. Can any one help me out regarding this.
    In which segment of IDOC do we need to populate QUOTATION NO.? I am using WE19 with a IDOC and executing FM IDOC_INPUT_ORDERS.
    Regards,
    Rajiv Singh.

    e1edp02-qualf = '004'.
    e1edp02-belnr = vbap-vbeln.
    e1edp02-zeile = vbap-posnr.
    vbap-vbeln is the quotation document and vbap-posnr the item number of the quotation.
    Regards Jack

  • How to create a Sales Order with external number using BAPI

    Hi People,
    I am wonderning how to create Sales order using external number range by BAPI (SALESORDER_CREATEFROMDAT202).
    I tried search but could not succeed in finding the solution.
    Please share if anyone has some info.
    Thanks in advance.
    Regards,
    Praveen

    As per my understanding, the BAPI
    SALESORDER_CREATEFROMDAT202
    mentioned by you, is not BAPI. In fact, that is basic IDoc Type.  For processing an Inbound IDoc, we use FM IDOC_INPUT_ORDERS.
    If you want to create sales order other than IDoc, refer FM BAPI_SALESORDER_CREATEFROMDAT2. There you can provide external sales order no in SALESDOCUMENTIN. In addition to that check whether your sales doc type is relevant for external number range or not. If yes. then make sure you are providing external number according to the number range maintained.
    If you still have any concerns, please revert back.
    Thanks, JP

  • Getting error in while changing sales order which is created using BAPI

    Hi All,
       I have created the sales order using BAPI ( BAPI_SALESORDER_CREATEFROMDAT1 ) and i am successfully creating sales order using this BAPI. But while i want to change sales order iam changing Shipping Conditions in Header Data of sales order .its giving an error .can any know any thing about this.
    Error mesage :    No status object is available for SDI 300082407/10    (Order Number/Item Number)
    In Header i  am passing these values ...
         wa_order_header_in-doc_type = vbak-auart.
        wa_order_header_in-sales_org = vbak-vkorg.
        wa_order_header_in-distr_chan = vbak-vtweg.
        wa_order_header_in-division = vbak-spart.
    Do i required to pass the below values ? in Header structure ( BAPISDHEAD1 ).
    REFOBJECTTYPE
    REFOBJECTKEY
    REFDOCTYPE
    Regards,
    Sudhakar Reddy A

    rectified

  • Sales Order - Error while changing using BAPI

    Hi,
    I would want to compare the system price and the expected price for a sales order and in case of any discrepancy, set a 'reason for rejection' code. I'm using the bapi 'BAPI_SALESORDER_CHANGE' to make changes to the sales order (setting the rejection code). This is working fine in cases where there is some value for both the prices but is throwing an error while the system price is null.
    Is there any way to overcome this error and still set the rejection code or should we make any changes in the config to let the system allow to save changes when the system price is null.
    Thanks in advance.

    The message you mention - ZZ054 - seems to be a non-standard one - it may be generated by some of your user-exits. Check this in SE91-> "Where-used list" (standard system should allow saving the document in case of incimplete pricing - that's why you may have an exit which prevents this).
    If so, you might modify your user-exits accordingly - to allow saving the document in cases defined by you.
    Another approach (not sure if this will be a solution in this case but you may check): see parameter BEHAVE_WHEN_ERROR of fm BAPI_SALESORDER_CHANGE.
    regards

  • How to create the sales order using excell sheet thru BAPI's?

    Hi Guru's,
    In my excell sheet i had 11 sales order details ..now i wanted to create the sales order's sing BAPI's...?
    could please guide me step by step.....that would be greatly helpfull to me...
    Thanks in advance
    Srinivas....

    Hi,
    follow below steps.
    1. Get the excel data into internal table,  Build a internal table whcih fields are in bapi same order
    2. call the Bapi and pass the table data to the bapi
    3. after calling the  bapi,  call the commit bapi.
        then only it will careates.
    Regards
    Ganesh

  • Sales order for variant material using BAPI "BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    I am using BAPI "BAPI_SALESORDER_CREATEFROMDAT2" for creating salesorder for variant configuration material. I am able to create a salesorder when have only one variant material, However when i have more than one variant material getting errors. Can some one tell me how to fill the material data in the config tables provided in the BAPI.
    Thanks.

    Hai Vinit
    Check the following Code & also Check the following Standard Programs
    L2032U12
    LCRMAU01
    LCRMAU11
    LZOC1U01
    MWWMJF32
    RBUS2032
    Structures for order header
    DATA: l_order_header_in    LIKE bapisdhd1,
          l_order_header_inx   LIKE bapisdhd1x,
    Tables for order items
          li_order_items_in    TYPE STANDARD TABLE OF bapisditm,
          li_order_items_inx   TYPE STANDARD TABLE OF bapisditmx,
    Order partners
          li_order_partners    TYPE STANDARD TABLE OF bapiparnr,
    *Schedule lines
          li_ORDER_SCHEDULES_IN  TYPE STANDARD TABLE OF BAPISCHDL,
          li_ORDER_SCHEDULES_INX  TYPE STANDARD TABLE OF BAPISCHDLX,
    *-condition type
          li_ORDER_CONDITIONS_IN   TYPE  STANDARD TABLE OF BAPICOND,
          li_ORDER_CONDITIONS_INX   TYPE  STANDARD TABLE OF BAPICONDX,
    Return table from bapi call
          li_return TYPE STANDARD TABLE OF bapiret2,
    Sales document number
          l_vbeln LIKE bapivbeln-vbeln,
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    order_header_in  = l_order_header_in
    order_header_inx = l_order_header_inx
               testrun          = 'X'
    IMPORTING
    salesdocument    = l_vbeln
    TABLES
    return           = li_return
    order_items_in   = li_order_items_in
    order_items_inx  = li_order_items_inx
    order_partners   = li_order_partners
    ORDER_SCHEDULES_IN = li_ORDER_SCHEDULES_IN
    ORDER_SCHEDULES_INX = li_ORDER_SCHEDULES_INX
    ORDER_CONDITIONS_IN = li_ORDER_CONDITIONS_IN
    ORDER_CONDITIONS_INX = li_ORDER_CONDITIONS_INX.
    Thanks & Regards
    Sreenivasulu P

Maybe you are looking for