Quotation using BAPI

Hi,
I am working on program to create quotation using bapi function module
BAPI_QUOTATION_CREATEFROMDATA.
I am getting following error:
Requirements are not fulfilled for condition EDI1
I have filled up this three structure with following flelds
header data
  t_order_header-doc_type =
  t_order_header-sales_org =
  t_order_header-distr_chan =
  t_order_header-division =
  t_order_header-sales_off =
  t_order_header-sales_grp =
  t_order_header-qt_valid_f =
  t_order_header-qt_valid_t =
  t_order_header-ord_reason =
  t_order_header-zz_sdcat_id =
  t_order_header-zz_sdflyer_id =
  append t_order_header.
Fill up Order partner structure
  t_order_partner-partn_role =
  t_order_partner-partn_numb =
  if not p_i_rep is initial.
    t_order_partner-partn_role =
    t_order_partner-partn_numb =
  endif.
  if not p_e_rep is initial.
    t_order_partner-partn_role =
    t_order_partner-partn_numb =
endif.
item data
    t_order_item-zzmatwa = t_record-matwa.
t_order_item-req_qty = t_record-kwmeng.
  t_order_item-cd_type3 = 'EDI1'.
  t_order_item-cd_value3 = t_record-price.
  t_order_item-cd_p_unt3 = 1.
  t_order_item-cd_curr3 = 'USD'.
    CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA'
      EXPORTING
        ORDER_HEADER_IN           = t_order_header
     WITHOUT_COMMIT            = ' '
       CONVERT_PARVW_AUART       = 'X'
     IMPORTING
      SALESDOCUMENT             = g_salesdocument
      SOLD_TO_PARTY             = g_sold_to_party
      SHIP_TO_PARTY             = g_ship_to_party
       BILLING_PARTY             = g_billing_party
      RETURN                    = g_return
      TABLES
        ORDER_ITEMS_IN            = t_order_item
        ORDER_PARTNERS            = t_order_partner
        ORDER_ITEMS_OUT           = t_order_items_out
        ORDER_CFGS_REF            = t_order_cfgs_ref
        ORDER_CFGS_INST           = t_order_cfginst
        ORDER_CFGS_PART_OF        = t_order_cfgspart
        ORDER_CFGS_VALUE          = t_order_cfgsvalue.
I have just defind  t_order_items_out,t_order_cfgs_ref,t_order_cfginst,t_order_cfgspart
t_order_cfgsvalue .
but i don't have any data to fill up this following table  t_order_items_out,t_order_cfgs_ref,t_order_cfginst,t_order_cfgspart
t_order_cfgsvalue .

You incorrectly filling item information with condition value. All quotation related pricing need to pass QUOTATION_CONDITIONS_IN table paramete of BAPI.
Try it and the problem get solved.
Cheers
Nilesh Shete

Similar Messages

  • Quotation Using BAPI .. Status is open in Document flow

    Hi..
    I created Inquiry .. quotation using BAPI (inquiry/quotation)Create_from_Data2 .... ie
    BAPI_QUOTATION_CREATEFROMDATA2 & BAPI_INQUIRY_CREATEFROMDATA2
    ..  But in Document flow created  inquiry and quotation status is open... Why this is happening?
    Thanks..
    ..Ashish

    yes... Actually if we go to change inquiry/quotation ... if i check whether document is complete .... then it shows document is complete ....
    ..Ashish

  • Creation of sales order with reference to Quotation using BAPI

    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.

    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.

  • Creating contract reference with Quotation - using bapi or fm

    Hi Friends
    Currently I am creating contract using function module sd_saleorder_create function module.But as per new requirement we have to create contract referenced with quotation number.
    Please suggest the suitable bapi or function module.if you suggest some thing ..kindly let me know?
    how to create contract referenced with particular line item in the quotation.
    where I need to pass the referenced line items...if you need any inputs..will reply by tomorrow...
    thanks
    Gowrishankar

    gowrishankar p wrote:
    Hi Friends
    >
    > Currently I am creating contract using function module sd_saleorder_create function module.But as per new requirement we have to create contract referenced with quotation number.
    >
    > Please suggest the suitable bapi or function module.if you suggest some thing ..kindly let me know?
    >
    > how to create contract referenced with particular line item in the quotation.
    >
    > where I need to pass the referenced line items...if you need any inputs..will reply by tomorrow...
    >
    > thanks
    > Gowrishankar
    is it really SD_SALEORDER_CREATE? if yes, which version are you in?
    Have you thought about 'BAPI_CONTRACT_CREATEFROMDATA'. Documentation available for this bapi.
    If not, just an FYI, REF_DOC field in (BAPISDHD1) -Contract_header_in structure can be used to pass the ref document and check for the type. You will also need to pass the type for this ref_doc.
    Assuming you have the configuration in place already.
    Search forum for this BAPI to get the sample code.

  • Problem in Sales order create using BAPI with reference to quotation

    Hi,
    I am creating a sales order from Quotation using BAPI /AFS/BAPI_SALESORD_CREATEFDATA.
    The Sale order is getting created and the document flow is updated. When i check the status of quotation it is "OPEN".
    Ideally when a sale order is created in VA01 with reference to a quotation and if all items are added in the order from quotation, then the status of the quotation must be "Complete".
    When i use the BAPI, the status of the quotation is sill "Open". Has anyone faced this issue?
    Even if anyone has faced this issue with BAPI_SALESORDER_CREATEFROMDAT2, please let me know...
    Regards

    Hi RV,
    I am using BAPI  to create order reference to contracts. I am facing same issue. Its not updating document flow (vbfa-plmin field). After creating orders I am forcing to update plmin field in vbfa. This worked fine. But now status in reference document not updating properly. I saw your thread. It looks like similar issue. I saw your comments "Customization was not maintained properly for the Order types ". Please can you explain little bit more about your solution. It will helps us lot.
    Thanks,
    srini

  • Help in Quotation creation using BAPI

    I want to create Quotation with reference to Inquiry. I am using std BAPI 'BAPI_QUOTATION_CREATEFROMDATA2' but I am not able to crate with reference to Inquiry. If you see the std tcode VA21 there is option to create with reference; there you can put the inquiry number. This functionality, I want to implement using BAPI.
    Can anybody tell me how to achieve this.
    Thanks in stack

    Nilesh,
    There is a problem if you use the BAPI 'BAPI_QUOTATION_CREATEFROMDATA2', the table flow will not be maintained (i.e) it will not maintain the document flow which you can view using
    VA13(Inquiry)->Document flow(F5). It will allow you to create any number of quotations for the same inquiry. This will be the case even if you use the BAPI 'BAPI_QUOTATION_CREATEFROMDATA'.
    The alternative you can use is use a BDC program for just creating the Quotation(VA21). Then use the BAPI 'BAPI_CUSTOMERQUOTATION_CHANGE' to change the quotation. I have done this before and it is working perfectly fine. Hope this solves your issue.
    Note: Reward points if found helpful.

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

  • Error in using bapi

    Hi,
    I am using bapi 'BAPI_QUOTATION_CREATEFROMDATA' for creating quotation.
    it is giving error 'External number assignment is not defined for document type ZSQ'
    Can you please suggest me the reason of this error.
    Thanks,
    Sushant.

    hi,
    It seems that You have m,ianatined DOCUMENT NO I.E. QUOTATION NO. in you flat fle means you are trying to give nos externally (VBELN).
    Goto your flat file and remove the QUOTATION NO and try again
    Regards

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

  • Sales document creation using bapi

    Hi Experts ,
    When i try create sales order using bapi " BAPI_SALESDOCU_CREATEFROMDATA'" , it says error like this , Please enter sold to party and ship to party, even though we are sending partner number it shows same error , if we pass values directly in se37 we get the correct result , but when we are calling it in program it says error.
    Error on this field : partner Number
    Thanks & Regards
    Siva Krishna

    Hi shiva,
               Please go through the documentation,
    Sales document type is checked with sales and distribtion document type.
    You must at least enter order header data (using the structure ORDER_HEADER_IN) and partner data (using the table ORDER_PARTNERS).
    Furthermore, you must enter the business object for which the sales document is to be created:
                   - BUS2030 for inquiries
                   - BUS2031 for quotations
                   - BUS2032 for sales orders
    I think ur program,
    does not pass business object , kindly check

  • Creation with Reference using BAPIs

    We're looking into creating an order with reference to a quotation or a return order with reference to an order or invoice.
    According to OSS note 370988 you can only achieve this using a workaround. We're in the process of testing it, so we were wondering whether anybody else out there already has experience with it.
    Specifically:
    - are there any issues in the document flow (based on our testing so far no) ?
    - are there issues with regards to pricing ?
    - do the final documents look as if created using VA01 ?
    Are there other approaches ? E.g. how does the SAP web shop do it ?
    Thanks
    Adrian

    HI Adrian Zehnder,
    1) If you want create order with reference to quotation like ex quotation document type is ymea then create quotation using standard bapi 2) By using bapi get the details of the quotation and pass that data to BAPI_SALESORDER_CREATEFROMDAT2 fill the fields ref_doc, ref_doc_it, and ref_doc_ca  3) There i s no issue with pricing everything will copy.4) It will like created in va01.Post if you need more help in this.
    Regards,
    Madhu.

  • Customer Quotation using BAPI_QUOTATION_CREATEFROMDATA

    Hi,
    I need to create customer quotation by using bapi BAPI_QUOTATION_CREATEFROMDATA.
    i am passing below data with minimum required fields but i am getting error message like "Please enter Sold-to-party or Sip-to-party'.. why i am not getting. Can anyone tell me where i did mistate or need to pass additional data.
    DATA: ORDER_HEADER_IN TYPE BAPISDHEAD,
          SALESDOCUMENT   TYPE BAPIVBELN-VBELN,
          SOLD_TO_PARTY   TYPE BAPISOLDTO,
          SHIP_TO_PARTY   TYPE BAPISHIPTO,
          BILLING_PARTY   TYPE BAPIPAYER,
          RETURN          TYPE BAPIRETURN1,
          ORDER_ITEMS_IN  TYPE STANDARD TABLE OF BAPIITEMIN WITH HEADER LINE,
          ORDER_PARTNERS  TYPE STANDARD TABLE OF BAPIPARTNR WITH HEADER LINE,
          ORDER_ITEMS_OUT TYPE STANDARD TABLE OF BAPIITEMEX WITH HEADER LINE,
          ORDER_CFGS_REF  TYPE STANDARD TABLE OF BAPICUCFG WITH HEADER LINE,
          ORDER_CFGS_INST TYPE STANDARD TABLE OF BAPICUINS WITH HEADER LINE,
          ORDER_CFGS_PART_OF TYPE STANDARD TABLE OF BAPICUPRT WITH HEADER LINE,
          ORDER_CFGS_VALUE TYPE STANDARD TABLE OF BAPICUVAL WITH HEADER LINE.
    START-OF-SELECTION.
    ORDER_HEADER_IN-DOC_TYPE = 'AG'.  " AG for Quotation
    ORDER_HEADER_IN-SALES_ORG = '0001'.
    ORDER_HEADER_IN-DISTR_CHAN = '01'.
    ORDER_HEADER_IN-DIVISION =  '01'.
    ORDER_HEADER_IN-REF_1 = 'Your ref1'.
    ORDER_HEADER_IN-QT_VALID_F = '20090204'.  "Quotation start date
    ORDER_HEADER_IN-QT_VALID_T = '20090303'.   "Quotation end date
    *ORDER_PARTNERS-PARTN_ROLE = 'SP'.
    *ORDER_PARTNERS-PARTN_NUMB = 'JJ1'.
    *APPEND    ORDER_PARTNERS.
    *ORDER_PARTNERS-PARTN_ROLE = 'SH'.
    *ORDER_PARTNERS-PARTN_NUMB = 'JJ1'.
    *APPEND    ORDER_PARTNERS.
    SOLD_TO_PARTY-SOLD_TO = 'JJ1'.             " sold to party
    SHIP_TO_PARTY-SHIP_TO = 'JJ1'.             " ship to party
    ORDER_ITEMS_IN-ITM_NUMBER = '000010'.
    ORDER_ITEMS_IN-MATERIAL = '000000000000000244'.
    ORDER_ITEMS_IN-TARGET_QTY = '33'.
    ORDER_ITEMS_IN-TARGET_QU = 'EA'.
    APPEND ORDER_ITEMS_IN.
    CALL FUNCTION 'BAPI_QUOTATION_CREATEFROMDATA'
      EXPORTING
        ORDER_HEADER_IN           = ORDER_HEADER_IN
      WITHOUT_COMMIT            = ' '
      CONVERT_PARVW_AUART       = ' '
    IMPORTING
        SALESDOCUMENT             = SALESDOCUMENT
        SOLD_TO_PARTY             = SOLD_TO_PARTY
        SHIP_TO_PARTY             = SHIP_TO_PARTY
       BILLING_PARTY             =
        RETURN                    =  RETURN
      TABLES
        ORDER_ITEMS_IN            = ORDER_ITEMS_IN
        ORDER_PARTNERS            = ORDER_PARTNERS
        ORDER_ITEMS_OUT           = ORDER_ITEMS_OUT
        ORDER_CFGS_REF            = ORDER_CFGS_REF
        ORDER_CFGS_INST           = ORDER_CFGS_INST
        ORDER_CFGS_PART_OF        = ORDER_CFGS_PART_OF
        ORDER_CFGS_VALUE          = ORDER_CFGS_VALUE
    IF RETURN NE SPACE.
    ENDIF.
    Thanks in advance,
    Regards,
    Meera.

    You need to use ORDER_PARTNERS table for passing sold-to and ship-to parties
    Un-comment the following code in your ABAP. Also if partner functions SP and SH don't work, try replacing them with AG and WE respectively.
    *ORDER_PARTNERS-PARTN_ROLE = 'SP'.
    *ORDER_PARTNERS-PARTN_NUMB = 'JJ1'.
    *APPEND ORDER_PARTNERS.
    *ORDER_PARTNERS-PARTN_ROLE = 'SH'.
    *ORDER_PARTNERS-PARTN_NUMB = 'JJ1'.
    *APPEND ORDER_PARTNERS.
    The below parameters don't (and can't) pass the value of the partners, as they are IMPORT only, that is the function returns them to you back
    SOLD_TO_PARTY-SOLD_TO = 'JJ1'. " sold to party
    SHIP_TO_PARTY-SHIP_TO = 'JJ1'. " ship to party

  • SD Quotation Creation BAPI

    Hi Everyone,
    I'm creating Quotation thru a "Z" program by calling the BAPI "BAPI_QUOTATION_CREATEBOS".
    All paramteras are passed thru the flat file table and successfully got created.
    When I look into the Costing Model values, they are still empty.
    Kindly Help.
    Gokul.N

    Hi,
    Check what costing values you mentioning manually that should be in FLAT FILE.
    If your costing values are in flat file and not populated after creation of quotation through BAPI then it means problem in either file reading or in file uploading through BAPI.
    Check BAPI u are using.
    kapil

  • Generating Quotation using  BAPI_BUSPROCESSND_CREATEMULTI

    Hi,
      I wnat generate quotation using the bapi BAPI_BUSPROCESSND_CREATEMULTI.  Please lete me know what are
    the mandatory data to create Quotation id.
    Thanks

    solved

  • Creating quotation through bapi

    hi all,
    I have created a Quotation using a bapi using 'BAPI_QUOTATION_CREATEFROMDATA2'.
    It is giving me the quotation number but when i put that number in VA22 a message is displayed stating that there exits no that quotation number.
    I am also getting a warning in the return that the quotation is not complete.
    Please help me in this context.
    Regards,
    nandam

    Hi Kiran,
    There are certain BAPIs where the numbers are alloted even in without_commit mode.
    Chk if the without_commit mode is set to false.
    If yu get a warning that quotation is incomplete it is obvious that your quotation has not been created. a number  allotment isnt a guarantee that the quotation has been created.
    Regards
    MK

Maybe you are looking for

  • Have anyone been having messaging problems since updating to iOS 6?

    Since updating my iPhone 4 to iOS 6 i could no longer send pictures to those who did not have an iPhone. Also I can only send pictures to other iPhone users thru iMessage. Another thing, when my iMessage is turned on it send iMessage text from my ema

  • Dynamic Structure in Interface and Forms

    Hallo experts, I am creating XML from the printreport. In print Report I am creating with RTTI a Structure and a Tabletype at runtime. Is it possible to give this type in Adobe Interface as type at runtime. The problem is that the XML looks like this

  • Problem in message mapping due to file sender content conversion

    Hi all basically i m using file sender content conversion and couldn't make file in a proper nested structure where weight was the nested field of detail as there is a limitation of content conversion in file adapter: My file came out like this: <hea

  • Printing Special char as " u017C " in smartforms.

    Hello I want to print special charecter in smartforms as a text could you please tell me that how to do it as " ż " when i am putting this in the text element it is converting in to #. could you please help in printing this. BBye Rajesh Kumar

  • ACS SE 4.2, 802.1x and certificates for machine authentication

    I'm trying to figure out how to put this lot together, but dont know enough about ACS when used with an external CA. What I want to get working is: A PC with a machine cert gets connected to a switch running 802.1x. The switch uses EAP with .1x to qu