Unable to create Sales order from "BAPI_SALESORDER_CREATEFROMDAT2" for Free Goods

Hi Experts,
I am facing the issue while creating the Sales order through "BAPI_SALESORDER_CREATEFROMDAT2" , all is going well in normal cases but when I process the contract with FREE GOODS line items for which free goods condition record is maintained it fails to create the Sales order. Is there any special treatment for this Free goods case. Is there any Flag to be passed from BAPI?
Regards,

Hi Paaavan
You can set a break-point include "FV45PFAP_VBAP_BEARBEITEN_VORBE" that is called by both the SAP Standard and BAPI where the data is prepared and checked in the internal table XVBAP. Compare both SAP standard VA01 and your 'Z' program for what may be different in XVBAP.
I think the problem my be with regards to the business_object number that is hardcoded in the standard function module. It has given me issues before and hence I tend to use the function module  SD_SALESDOCUMENT_CREATE to create sales documents with.
Regards,
Marius

Similar Messages

  • BAPI:Create sales order from an existing open sales order for open items

    Dear All,
    Could any one suggest me any BAPI that can create sales order from an existing OPEN sales order for OPEN items. since we are closing all open orders and creating new orders with reference to existing open orders.   please suggest, its would be great help.
    Regards,
    Reddy

    hi suresh,
    we are changing tax procedure from formula to condition based, so this is the reason we have close all the open orders and recreate in TAXINN procedure, it is going to be large number of records( open orders), so....
    Regards,
    Reddy

  • Error in Creating Sales Order Using BAPI_SALESORDER_CREATEFROMDAT2

    Hi Everyone,
    We have a requirement to create sales order from flat file using BAPI. Everything was working well until we encounter a customer with credit control limit setup.
    Using the partners table for BAPi, the sold to customer is enter at header level, and we have this requirement to add the payer at item level. This is where the error is occuring. Upon debugging, I found out that the customer has a credit limit setup at FD33, and has a record found in KNKK, which is giving the error "Credit limit customer differs from credit limit customer in header".
    However, duting manual creation of sales order via VA01, this error is not encountered.
    Any ideas or suggesstions on how we can move forward with SO creation using BAPI with customers where credit management is setup?
    Thanks,
    Louisse

    If thats not working..
    try BAPI_SALESORDER_CREATEFROMDAT2
    If BAPI is not working. try creating a bdc for the same if there's not error on trying from VA01

  • Error determining posting period(infostructure S008,Variant Z2,RC3) while creating Sales orders from Inbound IDOCS

    Hello,
    I am getting this Error message"error determining posting period(infostructure S008,Variant Z2,RC3)" while creating Sales order from Inbound Idocs in the IDOC,which is affecting sales order creation.
    While viewing this Info structure S008, I could see no records have been maintained. Wanted to know the reasons behind this Hard error?
    Is it something related to Date Field used in the Update Rules for this Infostructure which is causing this posting period error?
    Appreciate your inputs on this.
    Thanks and Regards
    Mohammed Roshan

    Thank you Jelena,I checked the Ship. Delivery dates in the IDOC which are for Current Fiscal Year- 20140703 and 20140711,Could there be any other reason for this error?
    Could it be an issue with e Update rule in this Infostructire S008
    Secondly when we try change the update rule thru MC25 for this Infostructure S008,It gives a message"
    "Maintenance of SAP standard updates not allowed"
    Kindly advice
    Thanks and Regards
    Mohammed Roshan

  • Create Sales order from Internal Purchase Order using IDOC

    Hello Friends,
    I have requirement to create Sales Order from Internal Purchase Order Using IDOC.
    Backgorund, we have already configured IDOC orders05 to create Sales Order from external Purchase order from Inbound IDOC, and it is working fine.
    Now we have new requirement to create Sales Order from our own Purchase order, i.e. When PO is created in one plant corresponidng sales order automatically must needs to create in another Plant with respect PO.
    I m trying to design a solution for above problem as follows,
    1.create an Inbound Idoc from PO, by creatiing one new message type on PO save.
    2.Process that Inbound  IDOC same as it is from external PO.
    3.Once processed Sales order will create.
    Please help me in step 1. to create Inbound IDOC from PO.
    If you want any further clarification please write me.
    Thanks,
    Mahesh

    I had done a similar scenario before and we achieved it through SAP XI. The problem is with the control record. When we create a ORDERS IDOC from a PO the control record will be for outbound transmission. We sent the file to XI and XI resent it back with some data parsing and a new inbound control record. This way it went neat outbound and inbound.
    I'm not sure what kind of architecture you have. If you have to do it within your ECC/R/3, then you could create the outbound IDOC to a new port and write a fresh RFC to pick it up from the same folder and create a new control record for inbound processing.
    I haven't tried this; but there is a "processing w. trigger (inbound)" option on the outbound process code. May be you can explore into that a bit more.
    I'm sure there could be better approaches to handle this within ECC so if you stumble on any, do write back. I would like to know to update my knowledge .

  • Creating sales order from contract ISA R/3 Edition

    Hi Forum,
    Our scenario are
    1 - customer select product from catalog and place order from internet
    2 - sometimes, customer already have a contract with us (created earlier manually on SAP) and want to create sales order from internet referencing a SAP-contract.
    For scenario No.1 - we can use standard SAP
    For scenario No.2 - is there any standard way to do so? or we have to do customization?
    Any suggestion are welcome.
    Thanks a million.!!

    Hello
    "Contract Processing" is not supported out-of-the-box in ISA R/3 edition.
    However, you have a good news. The OSS Note [788245 |https://service.sap.com/sap/support/notes/788245]- "ISA R/3 4.0: contract processing", explains how to implement this feature on a project basis.
    We have implemented this feature successfully at few customers.
    Hope this helps.
    Easwar
    http://www.parxlns.com

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

  • While we create Sales order in CRM for Madhya Pradesh State JIVP (VAT Payable) showing twice in order

    Dear SAP,
    While we create Sales order in CRM for Madhya Pradesh State JIVP (VAT Payable) showing twice in order, but calculation has taken one time i.e. 14%, only JIVP displaying twice (Attached Screen shot S3.JPG) in CRM order, when comes to ECC side it is showing correct entry (Attached Screen shot S4.JPG) .
    Due to duplicate condition records exist in CRM table CNCCRMPRCUS956 (Attached Screen shot S1 & S2.JPG).
    This happens for MP state, as duplicate entry exist with MP state only,
    Please guide us to resolve the same.
    Regards,
    JK

    Hi JK,
    There is two thing. first is that when you create a sales order very same time pricing conditions added in the transaction as per the pricing procedure add for transaction type. these pricing procedures are transaction type specific not state or country specific so it will work. check here you are getting duplicate condition ?
    When ever you add material in the transaction that very time one the basis of the pricing condition added in the transaction IPC method do pricing. check after adding material in transaction duplicate condition is coming ?
    Secondly whenever the document replicates in ERP re-pricing again happening on conditions so theses conditions get corrected in ERP. Here if document is re-priced then system will consider it as change so again there suppose to be Bdocs get created from ERP to CRM again overwrite document so condition will be synchronized in CRM . I would request check the same too and revert.
    Thanks,
    Prem,

  • Create sales order with BAPI_SALESORDER_CREATEFROMDAT2 example

    Hi, does anyone have a working example of how to create a sales order using BAPI_SALESORDER_CREATEFROMDAT2?
    Thanks

    hi Robert,
    Check this code...try to map.
    one order with total sum of effort
    clear: l_order_header,
    l_salesdocument,
    l_order_partners,
    l_order_items,
    l_order_schdl.
    refresh: it_order_items,
    it_order_partners,
    it_order_schdl,
    it_return.
    ???????? get from material ...
    Order header
    l_order_header-doc_type = 'ZQBV'.
    l_order_header-distr_chan = '10'.
    l_order_header-division = '00'.
    if g_qals-werk eq '1100'.
    l_order_header-sales_org = '1000'.
    else.
    if g_qals-werk eq '3100'.
    l_order_header-sales_org = '3000'.
    else.
    message i001(00) with text-005.
    endif.
    endif.
    l_order_header-purch_no_c = g_qals-prueflos. " <= lot
    Partner data
    l_order_partners-partn_role = 'AG'.
    l_order_partners-partn_numb = g_qals-kunnr.
    append l_order_partners to it_order_partners.
    Order items => only one
    l_order_items-itm_number = 10.
    l_order_items-material = g_qals-matnr.
    l_order_items-target_qty = 1.
    append l_order_items to it_order_items.
    Schedules for quantity
    l_order_schdl-itm_number = 10.
    l_order_schdl-req_qty = 1. " <= only 1 !
    append l_order_schdl to it_order_schdl.
    Conditions for value
    l_order_conditions-itm_number = 10.
    l_order_conditions-cond_type = 'PR00'.
    l_order_conditions-cond_value = g_effort_sum.
    l_order_conditions-currency = g_effort_unit.
    append l_order_conditions to it_order_conditions.
    BAPI to create sales order
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    SALESDOCUMENTIN =
    ORDER_HEADER_IN = l_order_header
    ORDER_HEADER_INX =
    SENDER =
    BINARY_RELATIONSHIPTYPE =
    INT_NUMBER_ASSIGNMENT =
    BEHAVE_WHEN_ERROR =
    LOGIC_SWITCH =
    TESTRUN =
    CONVERT = ' '
    IMPORTING
    SALESDOCUMENT = l_salesdocument
    TABLES
    RETURN = it_return
    ORDER_ITEMS_IN = it_order_items
    ORDER_ITEMS_INX =
    ORDER_PARTNERS = it_order_partners
    ORDER_SCHEDULES_IN = it_order_schdl
    ORDER_SCHEDULES_INX =
    ORDER_CONDITIONS_IN = it_order_conditions
    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 not l_salesdocument is initial.
    order successfully created
    message i001(00) with text-001 l_salesdocument.
    endif.
    endif.
    for more info check the below link also
    Problem with BAPI_SALESORDER_CREATEFROMDAT2
    Regards,
    Naveen

  • Need to create sale order from the flat file & mail has to be sent

    Hi Experts,
              I have a requirement to create a sale order from a flat file and once the oder is created, mail has to be sent to customer as well as to internal user with the order details. I want to know how this process can be implemented and what adapters are needed to execute this.
    it would be very helpful, if i get an step-by-step procedure.
    Points assured for any helpful answers.
    Thanks in Advance
    Jai

    HI Jai,
    You need to create two interfaces as file will be sending the Sales oreder details that you need to capture in IDOC or RFC and then have to trigger to create the sales order. For this Standard BAPIs are also available.
    These RFC or BAPIs will response with Sales order details that you need to divert to Mail adapter with the use of BPM and also have to go for Async to Sync bridge.
    File -
    >XI (BPM) ---> BAPI/RFC  (Request)
    MailAdapter <- XI (BPM) <--- BAPI/RFC (Response)
    For this refer below links for step by step
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] - File to Mail
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm - Walk through BPM
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm - Schedule BPM
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - Use of Synch - Asynch bridge in ccBPM
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] - Use of Synch - Asynch bridge in ccBPM
    If you will use IDOC then In IDOC inbound processing you need to trigger for Sales order creation and then have to send the Sales Order generated IDOC as an Outbound to Mail Adapter
    Flat file -
    > XI ---> IDOC
    IDOC -
    > XI ---> Mail
    This will be bit easy scenario to develope as compare to using BAPI with BPM
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping - Any flat file to any Idoc
    configuring IDOC-XI-Mail scenario using following web-log:
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u - Triggering Email from folder
    Thanks
    Swarup

  • FM to create Sales Order from reference billing document

    Hi,
    I need to create a sales order from a reference billing document. Please tell me if there is any function module/BAPI to do that.
    Thanks in advance for the help
    Regards,
    Varun

    Hi
    <b>SD_SALES_DOCUMENT_COPY</b> copy Sales Doc into new one with the required Sales Doc Type (VBAK-AUART) for further creating.
    <b>SD_SALES_DOCUMENT_SAVE</b> create Sales Doc from the copied document
    create subsequent document
    REPORT Z.
      data: w_auart like vbak-auart,  "current SalesDoc type
            w_auara like tvak-auara,  "Subsequent SalesDoc type
            w_vbak  like vbak.
      parameter p_vbeln like vbak-vbeln.
    at selection-screen on p_vbeln.
      SELECT SINGLE auart FROM vbak into w_auart
        WHERE vbeln = p_vbeln.
      if sy-subrc <> 0.
        message e398(00) with 'Sales Doc' p_vbeln 'not found'.
      endif.
    start-of-selection.
      SELECT SINGLE auara FROM tvak into w_auara
        WHERE auart = w_auart.
      if sy-subrc <> 0 or w_auara is initial.
        message e398(00) with 'Subsequent type not defined for' w_auart.
      else.
      1. copy
        CALL FUNCTION 'SD_SALES_DOCUMENT_COPY'
             EXPORTING
                  i_auarn       = w_auara
                  i_vbeln       = p_vbeln.
      2. paste
        CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
             IMPORTING
                  evbak         = w_vbak.
      3. commit
        COMMIT WORK.
      4. report
        write: / 'Sales Doc', w_vbak-vbeln, 'created.'.
      endif.
    regards
    vinod

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

  • Problem in Creating Sales Order From One DB to another DB

    Hello All,
    I am trying to create a Sales Order in another database from the current database based on the Purchase Order but while creating the sales order system is throwing an error " In "To Whse" enter valid values [ZAPp 0] "
    My Code for Creating Sales Order in another DB are as follows :-
                 '==== Connect To another SAP Company ====='
                '=====================================
                Dim oCompany_DB As New SAPbobsCOM.Company
                oCompany_DB.Server = "OSL_SERVER"
                oCompany_DB.LicenseServer = "OSL_SERVER"
                oCompany_DB.UseTrusted = False
                oCompany_DB.CompanyDB = Database_Name
                oCompany_DB.UserName = SAPUserName
                oCompany_DB.Password = SAPPassword
                oCompany_DB.DbUserName = DBUserName
                oCompany_DB.DbPassword = DBPassword
                oCompany_DB.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005
                lRetCode = oCompany_DB.Connect()
                If lRetCode <> 0 Then
                    oCompany_DB.GetLastError(lErrCode, sErrMsg)
                    If (lErrCode <> -4006) Then
                        Class_InterCmp_Main.SBO_Application.MessageBox(sErrMsg)
                    End If
                End If
    '===== Creating the Sales Order ====='
    '================================
      Dim oOrder As SAPbobsCOM.Documents = oCompany_DB.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
                Dim DocDueDate As String = oRecord.Fields.Item("DocDueDate").Value
                oOrder.DocDueDate = DocDueDate
                oOrder.CardCode = Customer
      While Not oRecord.EoF
                    Dim ItemCode As String = oRecord.Fields.Item("ItemCode").Value
                    Dim WhsCode As String = oRecord.Fields.Item("WhsCode").Value
                    Dim Quantity As Double = oRecord.Fields.Item("Quantity").Value
                    Dim Price As Double = oRecord.Fields.Item("Price").Value
                    Dim Discnt As Double = oRecord.Fields.Item("DiscPrcnt").Value
                    Dim TaxCode As String = oRecord.Fields.Item("TaxCode").Value
                    oOrder.Lines.ItemCode = ItemCode
                    oOrder.Lines.WarehouseCode = WhsCode
                    oOrder.Lines.Quantity = Quantity
                    oOrder.Lines.Price = Price
                    oOrder.Lines.DiscountPercent = Discnt
                    oOrder.Lines.TaxCode = TaxCode
                    oOrder.Lines.Add()
                    oRecord.MoveNext()
                End While
                lRetCode = oOrder.Add
                '=== Check For Error if any ===='
                If lRetCode <> 0 Then
                    oCompany_DB.GetLastError(lErrCode, sErrMsg)
                    If (lErrCode <> -4006) Then
                        Class_InterCmp_Main.SBO_Application.MessageBox(sErrMsg)
                    End If
                End If
                oCompany_DB.Disconnect()
    When i execute the above code company gets connected but sales order not getting added in another company.
    Thanks,
    Amit

    You can not do it the alternate way Kevin suggests, direct DB inserts are prohibited by SAP and can corrupt your DB, particularly because unlike what most people think, all SAP documents affect more than just their own tables (e.g. the numbering table, the history tables).
    Are you getting any error message, or is it returning 0?
    If it is returning 0, then check is the document actually going to the newly created database or maybe somehow going to old one.
    If it isn't returning 0, what is the error code and message.
    Edit:
    Also I do see an error in your code. As it stands, you are adding an empty line to the end of every order. This can cause problems for SAP.
    Dim counter As Integer = 0
    If counter <> 0 Then 'Not equals 0, forum hides lt & gt symbols.
    oOrder.Lines.Add()
    End If
    counter = counter + 1
    oOrder.Lines.ItemCode = ItemCode
    oOrder.Lines.WarehouseCode = WhsCode
    oOrder.Lines.Quantity = Quantity
    oOrder.Lines.Price = Price
    oOrder.Lines.DiscountPercent = Discnt
    oOrder.Lines.TaxCode = TaxCode
    Edited by: njmog1 on May 9, 2011 10:14 AM

  • Error when creating sales order using BAPI_SALESORDER_CREATEFROMDAT2

    Hello!
    I am using BAPI_SALESORDER_CREATEFROMDAT2 for creating the Sales order. But I have a problem when Iu2019m trying to create configuration. I think that parameter order_items_in-material should be generated before calling BAPI described above. I try to use order_items_in-mat_entrd, but BAPI return error message id = V1, number = 320 (No item category available (Table T184 ZAPC  TEXT )).
    Help me please, How I can solve this problem?

    <P><STRONG>FUNCTION Z_SD_GET_TEH_COST.<BR>"----<BR>"  IMPORTING<BR>"     REFERENCE(IS_COST_ORDER) TYPE  ZWCLIF_COST_ORDER<BR>"  EXPORTING<BR>"     REFERENCE(EV_KBETR) TYPE  KBETR<BR>"----
    </STRONG></P>
    <P><STRONG>  DEFINE fill_prizn.<BR>    IF is_cost_order-&amp;1 IS NOT INITIAL.<BR>      CLEAR: ls_cfgs_value-charc,<BR>             ls_cfgs_value-value.<BR>      ls_cfgs_value-charc = &amp;2.<BR>      ls_cfgs_value-value = is_cost_order-&amp;1.<BR>*      ls_cfgs_value-valcode = '1'.<BR>      APPEND ls_cfgs_value TO lt_cfgs_value.<BR>    ENDIF.<BR>  END-OF-DEFINITION.</STRONG></P>
    <P><STRONG>DATA: ls_header_in TYPE bapisdhd1,<BR>      ls_header_inx TYPE bapisdhd1x,</STRONG></P>
    <P><STRONG>      lt_partners TYPE TABLE OF bapiparnr,<BR>      ls_partners TYPE bapiparnr,</STRONG></P>
    <P><STRONG>      lt_items_in TYPE TABLE OF bapisditm,<BR>      lt_items_inx TYPE TABLE OF bapisditmx,</STRONG></P>
    <P><STRONG>      ls_items_in TYPE bapisditm,<BR>      ls_items_inx TYPE bapisditmx,</STRONG></P>
    <P><STRONG>      ls_cfgs_ref TYPE bapicucfg,<BR>      lt_cfgs_ref TYPE TABLE OF bapicucfg,</STRONG></P>
    <P><STRONG>      lt_cfgs_value TYPE TABLE OF bapicuval,<BR>      ls_cfgs_value TYPE bapicuval,</STRONG></P>
    <P><STRONG>      lt_schedules_in TYPE TABLE OF bapischdl,<BR>      ls_schedules_in TYPE bapischdl,</STRONG></P>
    <P><STRONG>      lt_schedules_inx TYPE TABLE OF bapischdlx,<BR>      ls_schedules_inx TYPE bapischdlx,</STRONG></P>
    <P><STRONG>      lt_cfgs_inst TYPE TABLE OF bapicuins,<BR>      ls_cfgs_inst TYPE bapicuins,<BR>      lt_cfgs_partof TYPE TABLE OF bapicuprt,<BR>      ls_cfgs_partof TYPE bapicuprt,</STRONG></P>
    <P><STRONG>      lv_vbeln TYPE bapivbeln-vbeln,<BR>      lt_return TYPE TABLE OF bapiret2.</STRONG></P>
    <P><STRONG>* fill header<BR>  ls_header_in-doc_type = 'ZAPC'.<BR>  ls_header_in-sales_org = is_cost_order-vkorg.<BR>  ls_header_in-distr_chan = is_cost_order-vtweg.<BR>  ls_header_in-division = '01'.<BR>  ls_header_in-sales_off = '1011'.</STRONG></P>
    <P><STRONG>  ls_header_inx-updateflag = 'I'.<BR>  ls_header_inx-doc_type = 'X'.<BR>  ls_header_inx-sales_org = 'X'.<BR>  ls_header_inx-distr_chan = 'X'.<BR>  ls_header_inx-division = 'X'.<BR>  ls_header_inx-sales_off = 'X'.</STRONG></P>
    <P><STRONG>* fill partners<BR>  ls_partners-partn_role = 'AG'.<BR>  ls_partners-partn_numb = '1000000031'.   " фиктивный заказчик<BR>  APPEND ls_partners TO lt_partners.</STRONG></P>
    <P><STRONG>*  ls_items_in-material = is_cost_order-matnr.<BR>  ls_items_in-mat_entrd = is_cost_order-matnr.<BR>  ls_items_in-target_qty = '1'.<BR>  ls_items_in-itm_number = '000001'.<BR>  ls_items_in-po_itm_no = '000001'.<BR>  ls_items_in-item_categ = 'ZCRM'.<BR>  SELECT SINGLE meins INTO ls_items_in-target_qu<BR>    FROM mara<BR>    WHERE matnr = is_cost_order-matnr.<BR>  APPEND ls_items_in TO lt_items_in.</STRONG></P>
    <P><STRONG>  ls_items_inx-itm_number = '000001'.<BR>  ls_items_inx-item_categ = 'X'.<BR>  ls_items_inx-po_itm_no = 'X'.<BR>*  ls_items_inx-material = 'X'.<BR>  ls_items_inx-mat_entrd = 'X'.<BR>  ls_items_inx-target_qty = 'X'.<BR>  ls_items_inx-target_qu = 'X'.<BR>  ls_items_inx-updateflag = 'I'.<BR>  APPEND ls_items_inx TO lt_items_inx.</STRONG></P>
    <P><STRONG>* fill configuration<BR>  ls_cfgs_ref-posex = '000001'.<BR>  ls_cfgs_ref-config_id = '000001'.<BR>  ls_cfgs_ref-root_id = '00000001'.<BR>  APPEND ls_cfgs_ref TO lt_cfgs_ref.</STRONG></P>
    <P><STRONG> ls_cfgs_value-config_id = '000001'.<BR>  ls_cfgs_value-inst_id = '00000001'.</STRONG></P>
    <P><STRONG>  fill_prizn kod_prod 'KOD_PROD'.<BR>  fill_prizn tlot_min 'TLOT_MIN'.<BR>  fill_prizn tlot_max 'TLOT_MAX'.<BR>  fill_prizn shot_min 'SHOT_MIN'.<BR>  fill_prizn shot_max 'SHOT_MAX'.<BR>  fill_prizn dlot_min 'DLOT_MIN'.<BR>  fill_prizn dlot_max 'DLOT_MAX'.<BR>  fill_prizn marka 'MARKA'.<BR>  fill_prizn stndrt_marka 'STNDRT_MARKA'.<BR>  fill_prizn stndrt_prod  'STNDRT_PROD'.<BR>  fill_prizn tprk 'TPRK'.<BR>  fill_prizn grot 'GROT'.<BR>  fill_prizn vityazhka 'VITYAZHKA'.<BR>  fill_prizn krom 'KROM'.<BR>  fill_prizn chisl_st_pokr 'CHISL_ST_POKR'.<BR>  fill_prizn kls_tol_pokr  'KLS_TOL_POKR'.<BR>  fill_prizn proch_izg_t_lic_max 'PROCH_IZG_T_LIC_MAX'.<BR>  fill_prizn priz_zasch_pov 'PRIZ_ZASCH_POV'.<BR>  fill_prizn vid_pokr  'VID_POKR'.<BR>  fill_prizn mark_pokr 'MARK_POKR'.<BR>  fill_prizn mat_pokr_lic 'MAT_POKR_LIC'.<BR>  fill_prizn plsk 'PLSK'.<BR>  fill_prizn vid_postavki 'VID_POSTAVKI'.<BR>  fill_prizn dressir 'DRESSIR'.<BR>  fill_prizn travl   'TRAVL'.<BR>  fill_prizn fsfr_min 'FSFR_MIN'.<BR>  fill_prizn fsfr_max 'FSFR_MAX'.<BR>  fill_prizn krmn_min 'KRMN_MIN'.<BR>  fill_prizn krmn_max 'KRMN_MAX'.<BR>  fill_prizn mrgn_min 'MRGN_MIN'.<BR>  fill_prizn mrgn_max 'MRGN_MAX'.<BR>  fill_prizn almn_min 'ALMN_MIN'.<BR>  fill_prizn almn_max 'ALMN_MAX'.<BR>  fill_prizn cugl_min 'CUGL_MIN'.<BR>  fill_prizn cugl_max 'CUGL_MAX'.</STRONG></P>
    <P><STRONG>  ls_schedules_in-itm_number = '000001'.<BR>*  ls_schedules_in-req_date = sy-datum.<BR>  ls_schedules_in-sched_line = '0001'.<BR>  ls_schedules_in-req_qty = '1'.<BR>  APPEND ls_schedules_in TO lt_schedules_in.</STRONG></P>
    <P><STRONG>  ls_schedules_inx-itm_number = '000001'.<BR>  ls_schedules_inx-sched_line = '0001'.<BR>*  ls_schedules_inx-req_date = 'X'.<BR>  ls_schedules_inx-req_qty = 'X'.<BR>  ls_schedules_inx-updateflag = 'I'.<BR>  APPEND ls_schedules_inx TO lt_schedules_inx.</STRONG></P>
    <P><STRONG>  ls_cfgs_partof-parent_id = '00000001'.<BR>  ls_cfgs_partof-inst_id = '00000001'.<BR>  ls_cfgs_partof-class_type = '300'.<BR>  ls_cfgs_partof-obj_type = 'MARA'.<BR>  ls_cfgs_partof-obj_key = is_cost_order-matnr.<BR>  APPEND ls_cfgs_partof TO lt_cfgs_partof.</STRONG></P>
    <P><STRONG>  ls_cfgs_inst-config_id = '000001'.<BR>  ls_cfgs_inst-inst_id = '00000001'.<BR>  ls_cfgs_inst-obj_type = 'MARA'.<BR>  ls_cfgs_inst-class_type = '300'.<BR>  ls_cfgs_inst-obj_key = is_cost_order-matnr.<BR>  APPEND ls_cfgs_inst TO lt_cfgs_inst.</STRONG></P>
    <P><STRONG>  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'<BR>    EXPORTING<BR>      order_header_in               = ls_header_in<BR>      order_header_inx              = ls_header_inx<BR>*      testrun                       =<BR>    IMPORTING<BR>      salesdocument                 = lv_vbeln<BR>    TABLES<BR>      return                        = lt_return<BR>      order_items_in                = lt_items_in<BR>      order_items_inx               = lt_items_inx<BR>      order_partners                = lt_partners<BR>      order_schedules_in            = lt_schedules_in<BR>      order_schedules_inx           = lt_schedules_inx<BR>      order_cfgs_ref                = lt_cfgs_ref<BR>      order_cfgs_inst               = lt_cfgs_inst<BR>      order_cfgs_part_of            = lt_cfgs_partof<BR>      order_cfgs_value              = lt_cfgs_value<BR>            .</STRONG></P>
    <P><STRONG>  READ TABLE lt_return TRANSPORTING NO FIELDS WITH KEY type = 'E'.<BR>  IF sy-subrc = 0.<BR>    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'<BR>              .<BR>  ELSE.<BR>    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'<BR>      EXPORTING<BR>        wait          = 'X'<BR>              .<BR>  ENDIF.</STRONG></P>
    <P><STRONG>ENDFUNCTION.</STRONG></P>
    <P><STRONG></STRONG> </P>
    <P><STRONG></STRONG> </P>

  • Creating Sales Orders from Quantity Contract - ORDERS05 IDOC

    Hi,
    I have created a Quantity Contract in ECC. Now I want sales orders to be created w.r.t to the Contract through ORDERS05.
    Can anyone suggest which IDOC Segment and Qualf i have to populate to achive the same.
    Also say once I am able to achive the creation of Release Orders from the Contract through ORDERS05. If I surpass the Qty of the Contract . The IDOC should be have a field for notifying the same.
    REgards,
    BInayak

    Hello Binayak
    You  may use the following segment and fields for reference data:
    Segment: E2EDK02
    Fields:
    QUALF : IDOC qualifier reference document - I think for contracts this is '001'.
    BELNR : IDOC document number
    POSNR : Item number
    As per a flag to indicate that the contract quantity is surpassed, I doubt there will be anything like that becasue is an Idoc is before you created the order and how will the system know you have surpassed until an order is entered?
    I think you need to use 'completion rule' and copy control 'update document flow' features to work on this.
    Hope this helps.

Maybe you are looking for

  • How do I get my account Itunes account credited for incorrect charges?

    Today we received an email invoice from iTunes for $699.99.  It says it is for a postcard. There is no phone number on the invoice however it does have a link to click on for  for "questions".  A link to "cancel order" and a link that says "not your

  • HT1689 can i transfer purchases from iphone to computer

    can i transfer purchases from iphone to my pc?

  • Asset history

    Hi all, I have to create a asset history report. I get error saying Fiscal year is not maintained for the company code. To solve this i need to proceed with transaction code AJRW to maintain fiscal year. I am currently working in the production syste

  • Removing adobe reader icon from excell and outlook

    How can I permanently remove the adobe reader V9 icon from Excel and Outlook? I used toolbar customize to delete the icons but they come back when I restart the programs.

  • Creating New FrontEnd User

    Hi, I have installed Oracle EBS on Amazon EC2 Cloud and would like to create some users with same privileges like "operations" user. How can I do this?