BAPI_SALESORDER_CREATEFROMDAT2 for creating sales orders with configurable

Hi All,
I want to create sales order with a material which in turn triggers a configurable network order.
I am using the following BAPI : BAPI_SALESORDER_CREATEFROMDAT2.
After reading the "[Variant Configuration (LO-VC)|http://help.sap.com/printdocu/core/print46c/en/data/pdf/lovc/lovc.pdf]" documentation, I thought I had to populate the
following tables ORDER_CFGS_REF, ORDER_CFGS_INST and ORDER_CFGS_VALUE.
The call function return no errors and the sale order is well created. However, I have no values in the network.
If I created a sale order in VA01, a network is created with value. So the customizing is good.
Do you have any idea how to populate this tables ? Sample code will be very helpful.
We found in this forum a lot of sample code about configurable material, with obj_type populate with MARAu2019. But no example with configurable network.
Actually I complete these tables like this :
" E1CUCFG
  ls_order_cfgs_ref-posex = '000010'.
*  ls_order_cfgs_ref-config_id = '000010'.
  ls_order_cfgs_ref-config_id = '000001'.
  ls_order_cfgs_ref-root_id = '00000001'.
  ls_order_cfgs_ref-complete = 'T'.
  ls_order_cfgs_ref-consistent = 'T'.
*  ls_order_cfgs_ref-cbase_id = '4ECADFC4BE9F03A6E10080000AC4AB76'.
*  ls_order_cfgs_ref-cbase_id_type = 'G'.
  APPEND ls_order_cfgs_ref TO lt_order_cfgs_ref.
" E1CUINS
  ls_order_cfgs_inst-config_id = '000001'.
  ls_order_cfgs_inst-inst_id = '00000001'.
  ls_order_cfgs_inst-obj_type = 'PLKONET'. u201C(in replacement of MARA)
  ls_order_cfgs_inst-class_type = '300'. u201C(or 020).
  ls_order_cfgs_inst-obj_key = '01000000801'.
  APPEND ls_order_cfgs_inst TO lt_order_cfgs_inst.
" E1CUVAL
  ls_order_cfgs_value-config_id = '000001'.
  ls_order_cfgs_value-inst_id = '00000001'.
  ls_order_cfgs_value-charc = 'XXXX'. u201C(corresponding to Flag DTA)
  ls_order_cfgs_value-charc_txt = 'Flag DTA'.
  ls_order_cfgs_value-value = '0'.
  APPEND ls_order_cfgs_value TO lt_order_cfgs_value.
Thanks,

Have a look to OSS-Message 567348. There is sample coding for using BAPI_SALESORDER_CHANGE, but the parameters should be the same to yout BAPI
Best regards
Torsten Manhardt

Similar Messages

  • BAPI For CREATE SALES ORDER WITH REFERENCE TO ORDER

    Hi ,
    I want to develop a new RFC for 'Creating Sales Order' with reference to another sales order -
    Is there any BAPI available for the same ? (Version 4.7) - I know its available for new create and change
    but couldn't find for create with reference to Order ...
    Thanks in advance ...
    Regards
    Rajesh.

    Hi,
    You can use this FM "/SAPNEA/SMAPI_ORDER_CREATE". I haven;t tried this but you can still give it a try. Mention the Reference Order Type and other data in the header work area and pass it to the FM.
    Reward if it's useful.
    Thanks,
    Anil

  • How to create sales order with configuration?

    Hi, all!
    I'm trying to create sales order with multi-level BOM's explosion using BAPI_SALESORDER_CREATEFROMDAT2, but with no success.
    Scanning and following ton's of OSS notes and already posted answers in this forum regarding configuration in sales order doesn't lead to success to.
    So can anybody throw light on rules for populating data structures for items and items configuration in case of multi-level BOM's explosion in sales order? Providing working code snippet would be great.
    Regards,
    Maxim.

    Hi, all!
    Just want to properly close the thread and share experience gained.
    The main reason of error was in incorrect TABLES parameters populating for sales order items and their configuration.
    Not the secret that there is a lack of documentation for even BAPIs FM, especially for comprehensive things to do. And it seems that the right way to resolve proper structure of import/tables parameters for "creation/change" function modules is to call "corresponding read-FM" for object created on-line  and see how return parameters are populated.
    For example, for BAPI_SALESORDER_CREATEFROMDAT2 such corresponding FM is BAPISDORDER_GETDETAILEDLIST, which returns near the same structures.
    Actually in my case such algorithm was used in the first place. But BAPISDORDER_GETDETAILEDLIST returned wrong parameters as was discovered later This error was fixed by implementing OSS note 821191 and sales order was succesfully created.
    And I want to thank SAP Support experts in effective assistance. 10 points are yours!
    Regards,
    Maxim.

  • BAPI FOR CREATING SALES ORDER WITH REFFERENCE TO QUOTATION

    Hi All,
    I am creating sales order with refference to quotation by using bapi "BAPI_SALESORDER_CREATEFROMDATA".Able to create sales order but its not refferencing qutation.Is there any other bapi for this scenario.Please guide me.
    Regards,
    Suresh

    Hi ,
    Thank you for giving reply I tried by using bapi BAPI_SALESORDER_CREATEFROMDAT2 after execution it giving sales order number but when I am trying to see that sales order system is giving error message as document is not exist.
    Please guide me.
    Suresh

  • Pricing determination for creating sales order using BAPI

    Hi,
      I am using BAPI_SALESORDER_CREATEFROMDAT2 for creating sales order. I am filling conditions structures
    'BAPICOND' and 'BAPICONDX' .
          fs_order_conditions_in-itm_number = '00010'.
          fs_order_conditions_in-cond_type  = 'ZNTP'.
          fs_order_conditions_in-cond_value = zsalesinput-price.
          fs_order_conditions_in-currency   = 'INR'.
          append fs_order_conditions_in to order_conditions_in.
          fs_order_conditions_inx-itm_number = '00010'.
          fs_order_conditions_inx-cond_type  = 'ZNTP'.
          fs_order_conditions_inx-cond_value = 'X'.
          fs_order_conditions_inx-currency   = 'X'.
         fs_order_conditions_inx-updateflag   = 'U'.
          append fs_order_conditions_inx to order_conditions_inx.
    I am filling the conditions table with above mentioned fields.
    Sales order is getting created successfully but I am getting two condition records in the conditions tab of sales order, one which is filled using the BAPI and the other one which is automatically picked by the system. Please tell me how to restrict the one which is created automatically by the system.
    Because I want the one which is created by BAPI only.
    Helpful posts will be rewarded

    Hello Manchu.
    Basically, it is an SD customizing issue. During the creation of the Sales Order you cannot "restrict" any other condition type. The SD guys must customize the condition type to allow for zero value so that the sales order is successfully created without this conition type.
    Regards,
    George

  • Creating sales order with BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    I´m creating sale orders with the function BAPI_SALESORDER_CREATEFROMDAT2. If you create sales order manually over the transaction, the system will find the right delivery date for you, if you are typing a date too early, for example.
    The same I need to do the BAPI. But if I´m running the BAPI without a date, it is creating a sales order without a BAPI.
    How can I get the date, SAP finds out automatically, when creating sales orders over the transaction?
    Thank you!

    Really no advices to that?

  • Create Sales Order With Reference to Billing Document Using BAPI_SALESORDER

    Hi,
    How can i create a sales order With Reference to Billing Document Using BAPI_SALESORDER_CREATEFROMDAT2?
    Thanks in advance,
    Alejandro.

    I have to create sales order with reference to existing billing document. I have tried to following bapis.
    1. BAPI_SALESORDER_CREATEed
    I have successfully created document with following details.
    -->ORDER_HEADER_IN:
    DOC_TYPE =                  ZRK
    SALES_ORG =              3000
    DISTR_CHAN   =            00
    DIVISION =                    00
    ORD_REASON =            100
    SD_DOC_CAT   =          L
    CURRENCY       =         EUR
    REF_DOC          =         100000028
    REF_DOC_CA    =         M
    -->ORDER_ITEMS_IN:
    ITM_NUMBER    =           000010
    MATERIAL          =          701791
    TARGET_QTY     =          0000000001000
    CURRENCY        =          EUR
    REF_DOC           =          100000028
    REF_DOC_CA     =          M
    -->ORDER_PARTNERS:
    PARTN_ROLE      =          SP
    PARTN_NUMB      =         W12001
    COUNTRY             =         NL
    by providing this input i am able to create the document but it is not picking up the net value. so i have passed some extra paramters in  ORDER_ITEMS_IN
    COND_TYPE          =        PNET
    COND_VALUE        =        14,56
    COND_D_UNT        =         PC.
    folowing error is occured: Condition PNET is missing in pricing procedure A V Z0000.
    is it something related to configuration problem?
    2.BAPI_SALESORDER_CREATEFROMDAT1 or BAPI_SALESORDER_CREATEFROMDAT2
    I have used same test data that is used for BAPI_SALESORDER_CREATEFROMDATA (where in i coudl succefully create doc). but here i encounterd following error.
    Unpermitted combination of business object BUS2032 and sales doc. category L.

  • Error while creating sales order with ref to contract

    while creating sales order, with refernce to contract system is giving a message
    Configuration not possible for material : Reason 3 --> Help
    Message no. V1360
    and the message is as follwed can any one explain
    Diagnosis
    This may have been caused by one of the following:
    1. The configuration profile for the material allows or requires the bill of materials to be exploded during order processing. However, a plant has not been specified in the item.
    2. The configuration profile of the material allows or requires the bill of materials to be exploded during order processing, but the order quantity in the item must be greater than 0.
    3. A configuration profile has not been maintained
    or
    A configuration is not permitted for the material
    or
    4. The configuration profile of the material allows or requires the bill ofmaterials to be exploded during order processing. However, the system could not determine a date because important data is missing from the item (see incompletion log).

    Hi
    I think you have both Variant configuration and BOM.
    Pls ensure the following.
    1. BOM masterdata is maintained for the variants
    2. Variant configuration is configured correctly
    Configuration profile is created for the material
    Knowledge base object and run time version are available
    3. Maintain materials as not relevant for delivery or dont give delivery quantity as 0
    Once you are sure that these are in proper shape, you can start creating order. The problem wont come.
    Reward points if it helps you.

  • How to use Bapi for creating sales order

    Dear All,
    I am facing problem in creating Sales orders using BAPI.
    Actually I am getting one file as an input and after validating the contents in the file i am preparing an internal table which has 6 fields - Customer number,PO Number,Material Number,Quantity,Price,Unit of measure.
    Now  my doubt is that while using BAPI_SALESORDER_CREATEFROMDAT2 , I am not getting how to pass PO Number and Customer number.
    Please Help.
    Regards,
    Shweta

    Hi shweta upadhyay
    I have gone through you are post i have done some coding for creating sales order using bapi , I think it is helpful for you.
    *& Report  YOBJ_BAPI_SALESORDER
    *& REPORT : CREATING SALES ORDER USING STANDARD BAPI
    *& AUTHOR : S.PAVAN KUMAR INUMARTHY
    REPORT  YOBJ_BAPI_SALESORDER.
    DATA : ORDER_HEADER_IN LIKE STANDARD TABLE OF BAPISDHD1 WITH HEADER LINE.
    DATA : ORDER_ITEMS_IN LIKE STANDARD TABLE OF BAPISDITM WITH HEADER LINE.
    DATA : ORDER_PARTNERS LIKE STANDARD TABLE OF BAPIPARNR WITH HEADER LINE.
    DATA : RETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE.
    DATA : SALESDOCUMENT LIKE BAPIVBELN-VBELN.
    *APPENDING VALUES FOR HEADER.
    ORDER_HEADER_IN-DOC_TYPE = 'TA'.
    ORDER_HEADER_IN-SALES_ORG = '1000'.
    ORDER_HEADER_IN-DISTR_CHAN = '10'.
    ORDER_HEADER_IN-DIVISION = '00'.
    ORDER_HEADER_IN-SALES_GRP = '130'.
    ORDER_HEADER_IN-SALES_OFF = '1030'.
    APPEND ORDER_HEADER_IN.
    *APPENDING VALUES FOR ITEM
    ORDER_ITEMS_IN-MATERIAL = 'M-13'.
    ORDER_ITEMS_IN-PLANT = '1000'.
    ORDER_ITEMS_IN-SALES_UNIT = 'ST'.
    ORDER_ITEMS_IN-DIVISION = '07'.
    ORDER_ITEMS_IN-GROSS_WGHT = '28000'.
    ORDER_ITEMS_IN-NET_WEIGHT = '28000'.
    ORDER_ITEMS_IN-UNTOF_WGHT = 'KG'.
    ORDER_ITEMS_IN-VOLUME = '0.780'.
    ORDER_ITEMS_IN-VOLUNIT = 'M3'.
    APPEND ORDER_ITEMS_IN.
    *APPENDING VALUES FOR PARTNER
    ORDER_PARTNERS-PARTN_ROLE = 'AG'.
    ORDER_PARTNERS-PARTN_NUMB = '0000001000'.
    ORDER_PARTNERS-COUNTRY = 'DE'.
    ORDER_PARTNERS-TRANSPZONE = 'D000080000'.
    APPEND ORDER_PARTNERS.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
    *   SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = ORDER_HEADER_IN
    *   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_ITEMS_IN
    *   ORDER_ITEMS_INX               =
        ORDER_PARTNERS                = ORDER_PARTNERS
    *   ORDER_SCHEDULES_IN            =
    *   ORDER_SCHEDULES_INX           =
    *   ORDER_CONDITIONS_IN           =
    *   ORDER_CONDITIONS_INX          =
    *   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_KEYS                    =
    *   EXTENSIONIN                   =
    *   PARTNERADDRESSES              =
              IF SY-SUBRC = 0.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *           EXPORTING
    *             WAIT          =
    *           IMPORTING
    *             RETURN        =
               ENDIF.
    WRITE : 'SALES ORDER IS :', SALESDOCUMENT.
    This will be very helpful for you .
    this one is the correct answer I have tried it and I am posting it for you.
    Message was edited by: pavan inumarthy

  • Problem with BOM Quant while creating Sales order with reference using BAPI

    Dear All,
    I am facing problem with creating a slaes order with reference to other sales order by using BAPI_SALESORDER_CREATEFROMDAT2 .
    Sales order is getting created but
    1. It exploding the BOM means the line items which are not there in the reference SO also coming in the new SO ( all BOM items are coming )
    2. Schedule line for BOM header item is getting copied to all sub items of BOM.
    Can any one help me out to prevent the above deviations in creating Sales order with reference by using BAPI_SALESORDER_CREATEFROMDAT2.
    Note: while passing the parameters to BAPI_SALESORDER_CREATEFROMDAT2
    all the data related to items is exactly the same as in the original Sales Order.
    Thanks in advnace.
    Regards,
    John

    Hi All,
    Can any one help me !!!!!!!!!!
    please

  • Error while creating sales order with ref using SD_SALESDOCUMENT_CREATE

    Hi
    I am creating sales order with reference using function module SD_SALESDOCUMENT_CREATE , while creating i am getting error
    Document doesn't have document category even thougth i am passing document category in header as well as item lavel.
    In VBUK table there is no value for VGTYP.
    Can you please help me how to resolve it.
    Thanks & regards
    kiran

    Problem resolved by passing   REFDOC_CAT in the FM along with  SD_DOC_CAT.
    Thanks

  • Create sales order with reference to 10 quotation

    Create sales order with reference to 10 quotation I want to put all quotation means take reference in one sales order how I can do it because when tried va01 and taken reference of question it allow to put only one question number how can I do it for multiple question
    Ahmed

    Hi Raj,
    If you come back to initial screen after coping the first quotation ,then system will ask you whetehr to save or cancel the data,if we select save then it will be saved immediately,else it will cancel.So ,it is not possible to copy more than one quaotation in standard SAP.The only option is to deveop a BDC with the help of abaper.
    We can only create this when header data is same in all the quotations.
    Regards,
    Pasapula.
    Edited by: Pasapula on Jul 24, 2009 9:48 AM

  • BAPI: Create Sales order with reference to Quotation

    Hi ...
    I am using bapi BAPI_SALESOREDER_CREATEFROMDATA2  and
    i want to create sales order with reference Quotation... All quotation data like Materials prices and conditions must be copied from reference quotaion which is allready created .....
    ..Thanks..
    ..Ashish

    Hello,
    nice to see that this has already been solved.
    But it actually doesnt work in my scenario. Do you have an example coding which will explain your solution.
    Mine looks like this:
    * Update Flag
      ls_header_inx-updateflag = 'I'.
    * Angebotskopf einlesen
      SELECT SINGLE * FROM vbak INTO ls_vbak
        WHERE vbeln = iv_vbeln
          AND vbtyp = lc_vbtyp.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    * Auftragskopf setzen
      ls_header_in-doc_type      =  ls_vbak-auart.
      ls_header_in-sales_org     = ls_vbak-vkorg.
      ls_header_in-distr_chan    = ls_vbak-vtweg.
      ls_header_in-division         = ls_vbak-spart.
      ls_header_in-req_date_h   = ls_vbak-VDATU.
      ls_header_in-ref_doc        = ls_vbak-vbeln.
      ls_header_in-refdoc_cat   = 'B'.
    * Angebots-Partner einlesen (Nur AG und WE)
    * Auftrag anlegen
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
    *   SALESDOCUMENTIN               =
          order_header_in               =  ls_header_in
    *      order_header_inx              = ls_header_inx
    *   SENDER                        =
    *   BINARY_RELATIONSHIPTYPE       =
    *   INT_NUMBER_ASSIGNMENT         =
    *   BEHAVE_WHEN_ERROR             =
    *   LOGIC_SWITCH                  =
    *   testrun                       = 'X'
    *   CONVERT                       = ' '
       IMPORTING
          salesdocument                 = ev_vbeln
        TABLES
          return                        = et_return
    *      order_items_in                = lt_items_in
    *      order_items_inx               = lt_items_inx
          order_partners                = lt_partners
    *   ORDER_SCHEDULES_IN            =
    *   ORDER_SCHEDULES_INX           =
    *   ORDER_CONDITIONS_IN           =
    *   ORDER_CONDITIONS_INX          =
    *   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_KEYS                    =
    *   EXTENSIONIN                   =
    *   PARTNERADDRESSES              =  .
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    Unfortunatly this just makes the reference to the quotation but does not takeover ALL data from header and pos level.
    Thanks and regards
    Markus Armbruster

  • Bapi To create sales order with reference of sales order.

    Hi all,
          Having requerment To create sales order with reference of onother  open sales order.
    Example: there open sales order which having qty of 20 for that 10 qty as already billed , for remain  10 qty as to create the new sales order with reference to the excsiting one.
    Please guide me how do it.
    Regards,
    Santosh
    Edited by: santosh jajur on May 15, 2010 11:47 AM

    Hi Santhosh,
    check this thread.
    Re: Open Sales Order Migration
    The last part of the thread says done.
    hope you get a hint from that.
    Also this one
    Re: how to create open sales order using BAPI....?
    http://abaplovers.blogspot.com/2008/02/bapi-sales-order-create-code.html
    Regs,
    SuryaD.
    Edited by: SuryaD on May 15, 2010 9:09 PM
    Edited by: SuryaD on May 15, 2010 9:10 PM
    Edited by: SuryaD on May 15, 2010 9:11 PM

  • Issue when creating sales order with Sold-to/Ship-to Party's state

    Hi All,
    we have issue while creating Sales Order with picking up of State tax
    for Ship-to-party & Sold-to-party.
    <b>When we create a sales order, for the sold to party 140052732 and
    ship to party 140052733 it is picking state tax. Which should not
    suppose to pick? Because the partner is marked as tax exemption</b>.
    Can any body tell me how can we solve this issue!
    Why this is happening!
    How to make not to pick tax when it is marked for tax exemtion.
    As i am not Functional guy i am not aware what is happening here!
    Can anybody solve this issue!
    Thanks in advance.
    Thanks,
    Deep.

    Hi Deep
    What do you mean by "It is picking up state tax"? Does it mean that in the pricing procedure it is picking up a condition type which is meant for state tax?
    If so go and check the condition record meant for it. Follow the following steps
    1) Go to Sales order
    2) Select the line item for which the state tax is being picked.
    3) In the condition tab select analysis.
    4) In Analysis you shall find the condition type meant for state tax.
    5) See which condition record has been found.
    6) Go to VK12, enter the state tax condition type and check the condition record for that state tax.
    7) If wrong correct it.
    8) If anything else come back to the post and inform the details
    Thanks
    Regards
    Sunil

Maybe you are looking for

  • Displaying pdf in browser when using Windows 7 Beta & AR 9

    Early indications are that "Adobe Air" and/or "Acrobat.com" are breaking the display in browser function in Windows 7 Beta when using Adobe Reader 9. On a fresh install of Windows 7 Beta, I installed Adobe Reader 9, and as everyone is finding out, yo

  • Libraries in project tree

    I noted recently that some of my projects have libraries added in a separate "Library" branch of the project tree while in other they are simply listed at the base tree level; see these two examples: Is there any practical difference between these tw

  • Unable to search by responsibility in cProjects 3.0 after BP re-set

    Dear Forum, We are using cProjects 3.0 and had trouble with a user showing up properly as a resource in a cproject template.  I deleted the user, business partner  and re-set him up again from scratch. He is now unable to see any of his previously su

  • Please tell me what's the usage of inner class?

    I am a newbie on java and i have used c++ for 3 years,is java's inner class the same with c++? Thanks in advance!

  • BADI / USER-EXITS available for Txn. QE01

    Hi Experts, Could anyone please suggest appropriate BADIu2019s and user-exists available for Txn. QE01 to send the status change. Our requirement is to send a mail notification to the user when all the result recording status of the inspection charac