Problem In Creating Sales Order Through DI API

Hi
I am Creating The Sales Order Through DI API.
the Error Is Coming - " [OACT] , 'No matching records found (ODBC -2028)'"
anyone  can help me solving it.

Hi vivek,
Have you tried adding the same document with the client ?
OACT is the accounts table and this error message typically indicates that there is an account parameter missing somewhere in the system.
Possible causes include:
- you are using a tax group or warehouse which does not have all the required accounts set
- There is a price rounding and the rounding price account has not been set in the account settings
- etc.
The first things I would check include the tax group settings and the G/L Account determination settings.
Henry

Similar Messages

  • Create Sales Order through OE_ORDER_PUB  API and get credit card authorizat

    Hi,
    I was trying to know if there is some way to get credit card authorization (when payment type is CREDIT CARD) creating a Sales Order through de OE_ORDER_PUB API.
    I need to reproduce the manual process where you get this authorization, through the Action Button, in the Sales Order Window.
    Thanks in Advance.
    Nicolas.

    Hi Nagamohan,
    Thanks for the reply..It was Vision Instance that i was working on..
    There was some problem in setups. I had run the same script on other instance and it is working.
    Before signing off i have one more doubt...
    The script which i used is creating a sales order with booked_flag='Y' but flow_status_code is still 'ENTERED'
    how can i change it to 'BOOKED' using API...
    Thanks for the help...

  • Problem in Creating Sales Order PL/SQL API

    Hey,
    I've to create a Sales Order 'n BPEL by using Apps Adapter. In Module Browser, I've chosen the OE_ORDER_PUB.PROCESS_HEADER and given the correct details.
    I passed the new ORDER_NUMBER and HEADER_ID as blank. I'm getting the response RETURN_STATUS as 'S' ( I mean which is success) and it is not throwing any error message.
    But while checking in the OE_ORDER_HEADERS_ALL table, I am not finding any created Sales Order record.
    Please help.
    -- Eric.

    Hi,
    After giving some parameters, I am facing different problem as shown in below.
    FND FND_AS_UNEXPECTED_ERROR N PKG_NAME OE_Delayed_Requests_PVT N PROCEDURE_NAME LOGREQUEST N ERROR_TEXT ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    This error I am getting as Response while executing from BPEL.
    Please help.
    -- Eric.

  • Creating sales order through Bapi

    Hi all,
    I am trying to create sales order through bapi.
    Now my problem is mapping sales order fields with bapi structure fields.
    1.'Overall Order status' field in the 'Status' tab of the header in VA02.
    2.'Tax'feild in the 'conditions' tab of the header in VA02.
    Please help me to map these fields into Bapi structure.
    Thanks in advance.
    Regards,
    Shalem.

    HI
    GOOD
    GO THROUGH THIS LINK,I HOPE THIS WILL GIVE YOU THE COMPLETE IDETA OF CREATING A SALES ORDER THROUGH BAPI,
    http://help.sap.com/saphelp_nw04/helpdata/en/4c/fd7ebb515911d395f900a0c94260a5/content.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    THANKS
    MRUTYUN

  • Issue in creating sales order using process_header API (web service)

    Hi All,
    I am trying to create sales order header using web service call to OE_ORDER_PUB.Process_header API.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Is there any commit missing? Pls help me resolve this issue.
    Thanks,
    Vinoth

    Hi All,
    I am trying to create sales order header using web service call to OE_ORDER_PUB.Process_header API.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Is there any commit missing? Pls help me resolve this issue.
    Thanks,
    Vinoth

  • Issue in creating sales order using process_header API

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

    Hi all,
    We have a requirement to create sales order using apps adapter in ebiz from SOA suite composite.I used OE_ORDER_PUB.Process_header API to create order header.
    When I pass the inputs and test the service,I get output with return_status='S'. But no record falls at the OE_ORDER_HEADER_ALL table.
    I cant identify where the problem is.Pls suggest me with the things to resolve this issue.
    Thanks,
    goutham

  • A problem about create sales order with reference to contract.

    Hello,everyone,
    when I create sales order va01,there is user exit in MV45AFZB to check the vbkd-bstkd,unique and fixed  length.
    but there is no such in contract  creation va41.
    when I create a contract and copy the data to sales order ,the check code is prevent me from copying
    message error:the vbkd-bstkd check is wrong.
    how to solve the problem, if I have to use the check in sales order.

    The Simple thing may be put a check at contract stage it self, then whatever data is in contract will copy in sales order. So you wont face this problem.
    Thanks,
    Raja

  • Pricing problem while creating sales order doc

    Hi friends,
    My requirement is to create sales order with ref to contract i am using 'BAPI_SALESORDER_CREATEFROMDAT2' , and I am extracting data from konv table to get price through condition record , but i am getting 4 messages
    (S) SALES_HEADER_IN has been processed successfully
    (E) Condition PR00 is not allowed as header condition
    (W) The sales document is not yet complete: Edit data
    (E) Sales document was not changed
    and i am not getting pricing for created sales order document.
    please help.
    regards,
    Sravani.

    solved

  • Problem while creating sales order

    Hi
       We are facing a problem while creating a sales order in R/3. The sales order number is getting generated. But we are not able to view the same in the backend meaning it is not there in the database. Any inputs would be of help.
    regs
    Steve

    Hi everybody,
    I've got a problem with this too. I use the BAPI_SALESORDER_CREATEFROMDAT2 with BAPI_TRANSACTION_COMMIT and the webdynpro shows me the document number created in R3 with a Success message. But when I go to R3 and try to display the created sales order, it doesn't exists. So... Maybe I'm doing something wrong with the BAPI_TRANSACTION_COMMIT. ¿Can anybody help me with this?
    The code I use is this:
    When the user pushes the SAVE button in the WebDynpro, this code executes:
        //@@begin onActionSave(ServerEvent)
         wdThis.wdGetSOCreaCustController().executeBapi_Salesorder_Createfromdat2();
         wdThis.wdGetSOCreaCustController().executeBapi_Transaction_Commit();
        //@@end
    In the custom Controller I've got the code for those executions:
      public void executeBapi_Salesorder_Createfromdat2( )
        //@@begin executeBapi_Salesorder_Createfromdat2()
         try {
              wdContext.currentBapi_Salesorder_Createfromdat2Element().modelObject().execute();
         catch (Exception ex) {
              wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
         wdContext.nodeOutput().invalidate();
        //@@end
      public void executeBapi_Transaction_Commit( )
         try {
              wdContext.currentBapi_Transaction_CommitElement().modelObject().execute();
         catch (Exception ex) {
              wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);
         wdContext.nodeOutput().invalidate();   
        //@@end
    ¿Is something wrong? ¿Is something missing?

  • 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

  • Problem while Creating Service order through Work Order

    Hi Gurus,
    I have a problem While creating Service order (me21n) through - Work order it contains service requisitions.
    So that means they carry information such as G/L and work order number while entering the requistion no in PO Creation Screen (me21n)  which automatically should be picked from the work order refference.
    But problem here is the service items and all other are assigned to PO except the Account Assingnment tab which is GL Account and Work Order No and Cost center..
    Can anyone explain me this?
    Is this something that one can explain?
    Regards,
    Murugesh R
    Rewards for value replies.

    Closed..

  • ITem category  error while creating sales order through

    Hi,
    I am trying to create a sales order through Bapi  and in between im getting the below error.
    ' Item category TAM is not defined for non material items'.
    Can anybody pls provide the solution for this.
    Thanks

    speak to your SD functional person.  The Error is pretty self explanatory; SAP is telling you that the item category for that order item is not permitted by your SD configuration.

  • Create Sales Order through VB

    Hi Experts
              I am new to BAPI, my requirement is to create sales order in SAP through VB.
              Please provide me the BAPI coding part which are needed and also suggest me the steps to be followed in SAP and VB.
             Thanks in advance.
    Regards
    Rajaram

    Hi Vinodh
      I tried this coding as part of your link, but it contains Run-time error as Object Required.
          Anything needs to be added in my VB Project, i have already added the BAPI ActiveX contol in my project.
    Pls sugges me.
    Dim boOrder As Object 'Business object SalesOrder
    Dim oPartners As Object 'Parameter OrderPartners of BAPI method
    Dim oHeader As Object 'Parameter OrderHeaderIn of BAPI method
    Dim oItemsIn As Object 'Parameter OrderItemsIn of BAPI method
    Dim oReturn As Object 'Parameter Return of BAPI method
    Private Sub Form_Load()
    'Connect to business object SalesOrder
    '(this creates an anonymous object with an empty key field):
    Set boOrder = oBAPICtrl.GetSAPObject("SalesOrder")
    'Get structure/table objects:
    Set oPartners = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderPartners")
    Set oHeader = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderHeaderIn")
    Set oItemsIn = oBAPICtrl.DimAs(boOrder, "CreateFromData", "OrderItemsIn")
    'Fill header:
    oHeader.Value("DOC_TYPE") = "TA" 'Standard order
    oHeader.Value("SALES_ORG") = "0001" 'Sales organization
    oHeader.Value("DISTR_CHAN") = "01" 'Sales channel
    oHeader.Value("DIVISION") = "01" 'Division
    oHeader.Value("PO_NUMBER") = "" 'Customer purchase orderNumber
    oHeader.Value("PRICE_DATE") = Now 'Date
    'Fill partners:
    oPartners.Rows.Add
    oPartners.Value(1, "PARTN_ROLE") = "AG" 'PartnerRoll: Person posting the order
    oPartners.Value(1, "PARTN_NUMB") = "0000010096" 'Customer number
    'Fill items:
    oItemsIn.Rows.Add
    oItemsIn.Value(1, "REQ_QTY") = "0000000010000" 'Quantity
    oItemsIn.Value(1, "MATERIAL") = "BERLINER" 'Product ID
    oItemsIn.Value(1, "COND_VALUE") = "1432" 'Rate
    'Call the method:
    boOrder.CreateFromData OrderHeaderIn:=oHeader, _
    OrderPartners:=oPartners, _
    OrderItemsIn:=oItemsIn, _
    Return:=oReturn
    'Free the business objects:
    Set boOrder = Nothing
    End Sub
    Regards
    Rajaram

  • Problem while creating sales order using BAPI

    Hi all,
    i am creating a sales order from the purchase order data.
    when my client will send a PO in EDI format, my 3rd party edi tool will convert that edi formatted PO to text format. then i will upload that text formatted PO to my program then i will create a SO from those uploaded PO data using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
      but,no sales order is being created.& also i am not getting any return message.by debugging also, i am not getting the error.plz suggest where i am doing mistake.below is the coding.
    DATA:
      gfilename LIKE rlgrap-filename.
    *--Internal tables
    DATA: BEGIN OF i_item OCCURS 50.    "Create Material Document Item
            INCLUDE STRUCTURE BAPISDITM .
    DATA: END OF i_item .
    DATA: BEGIN OF i_partner OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPIPARNR.
    DATA: END OF i_partner.
    DATA: BEGIN OF i_schedule OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPISCHDL .
    DATA: END OF i_schedule.
    DATA: BEGIN OF i_cond OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPICOND .
    DATA: END OF i_cond.
    DATA: BEGIN OF i_part OCCURS 0,     " Internal table for split data
            part(20),
          END OF i_part.
    DATA: BEGIN OF i_return OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF i_return.
    *-- Work areas
    DATA: BEGIN OF wa_header .       "sales Document Header Data
            INCLUDE STRUCTURE BAPISDHD1.
    DATA: END OF wa_header .
    *DATA: BEGIN OF wa_return .       "Output Structure
           INCLUDE STRUCTURE BAPIRET2.
    *DATA: END OF wa_return .
    DATA: begin of sorder.
         INCLUDE STRUCTURE BAPIVBELN.
    DATA: end of sorder.
    data:begin of t_upload,
         ebeln(10),  "PO no(seagate)
         aedat like sy-datum , "PO date
         bsart(4) , "PO type
         vdatu like sy-datum , "requested delivery date
         kunnr(10) , "customer no-sold-to-party
        kunak like vbak-kunnr, "bill-to-party
         name1_s(20), "name1 of sold-to-party
         name2_s(15), "name2 of sold-to-party
         land1_s(3), "country
         ort01_s(10),  "city
         regio_s(3), "region(state/province)
         pstlz_s(10), "postal code
         adrnr_s(10), "address
         bstkd_e(10), "end customer purchase order
         posex(6),     "end customer PO line no(item no)
         kdmat(18),     "end customer material no(part no)
         kunag(10),     "ship-to-party
         name1_c(20),   "name1 of ship-to-party
         name2_c(15),   "name2 of ship-to-party
         land1_c(3),   "country
         ort01_c(10),    "city
         regio_c(3),   "region(state/province)
         pstlz_c(10),   "postal code
         adrnr_c(10),   "address
         posnr(6), "item no(seagate PO line no)
         pstyv(4), "item category
         matnr(18), "material no(seagate 9 digit part no)
         zmeng(13), "Target quantity in sales unit
        vrkme like vbap-vrkme, "sales unit
         meins(3), "UOM
        posnr_tot like vbap-posnr,"Total no. of line items
         werks(4), "plant
        vstel like vbap-vstel, "shipping point
         empst(10), "receiving point
         shtyp(4), "shipment type
         route(6), "route
         vsbed(2), "shipping conds
        rkfkf like vbap-rkfkf, "method of billing for co/ppc orders
         zterm(4), "terms of payment key
         inco1(3), "F.O.B inco term1
         inco2(3), "F.O.B inco term2
         end of t_upload.
    Data: wa_upload like t_upload,
           i_upload like standard table of t_upload.
    Data:v_kunnr like kna1-kunnr,
          v_posnr like vbap-posnr,
          v_matnr like vbap-matnr,
          v_zmeng like vbap-zmeng,
          v_kunag like kna1-kunnr.
    *---Constants
    CONSTANTS: c_comma TYPE c VALUE ',',   " For splitting data at commas
               c_01(2) TYPE c VALUE '01',  " For movement code in Bapi
               c_b     TYPE c VALUE 'B',   " For mvt. Indicator in Bapi
               c_creat(5) TYPE c VALUE 'CREAT', " For button text
               c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
               c_mvmt(4) TYPE c VALUE 'MVMT',
               c_ok(2)   TYPE c VALUE 'OK',
               c_error(5) TYPE c VALUE 'Error'.
    *--SELECTION SCREEN DESIGN--
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS:     
                p_auart LIKE vbak-auart, " order type
                p_vkorg LIKE vbak-vkorg, " sales org
                p_vtweg LIKE vbak-vtweg, " dist channel
                p_spart LIKE vbak-spart, " division
                p_vkgrp LIKE vbak-vkgrp, " sales group
                p_vkbur LIKE vbak-vkbur, "sales office
                p_file(256) default 'c:/saleorder.txt'.         "File name
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN PUSHBUTTON 15(10) v_create USER-COMMAND creat.
    SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
      INITIALIZATION -
    INITIALIZATION.
      v_create = c_creat .
      v_clear = c_clear.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    PERFORM selectfile USING p_file.
    *--AT SELECTION_SCREEN--
    AT SELECTION-SCREEN .
      IF sy-ucomm = c_clear.
        PERFORM f_clear.
    ELSE.
       IF sy-ucomm <> c_mvmt.
    **--- Validating the input data.
         PERFORM f_check_inputs.
        ELSEif sy-ucomm = c_creat.
    *--- Validating the input data.
          PERFORM f_check_inputs.
    *-- Uploading the PO data.
          PERFORM f_PO_upload.
    *---checking the PO data
         PERFORM f_check_upload_data.
    *---create sales order from PO data
        PERFORM f_Sales_order_create.
        ENDIF.
    FORM f_PO_upload.
    gfilename = p_file.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                filename                = gfilename
                filetype                = 'DAT'
           TABLES
                data_tab                = i_upload
           EXCEPTIONS
                conversion_error        = 1
                file_open_error         = 2
                file_read_error         = 3
                invalid_type            = 4
                no_batch                = 5
                unknown_error           = 6
                invalid_table_width     = 7
                gui_refuse_filetransfer = 8
                customer_error          = 9
                OTHERS                  = 10.
      IF sy-subrc <> 0.
        MESSAGE i398(00) WITH '(WS_UPLOAD)'
        ' Errors occured with exception '
         sy-subrc.
      ENDIF.
    ENDFORM.                    " f_PO_upload
    *&      Form  selectfile
          text
         -->P_P_FILE  text
    FORM selectfile CHANGING value(filename) TYPE c.
    CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = gfilename
                def_path         = 'C:\'
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Select File Name'
           IMPORTING
                filename         = filename
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    ENDFORM.                    " selectfile
    FORM f_Sales_order_create.
      PERFORM f_fill_header.
      PERFORM f_fill_partner.
      PERFORM f_fill_item.
      PERFORM f_call_BAPI.
    ENDFORM.                    " f_Sales_order_create
    *&      Form  f_fill_header
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_header.
    move p_auart to wa_header-doc_type.
    move p_vkorg to wa_header-sales_org.
    move p_vtweg to wa_header-distr_chan.
    move p_spart to wa_header-division.
    move p_vkgrp to wa_header-sales_grp.
    move p_vkbur to wa_header-sales_off.
    Read table i_upload into wa_upload index 1.
    move wa_upload-ebeln to wa_header-purch_no_c.
    move wa_upload-aedat to wa_header-purch_date.
    move wa_upload-bsart to wa_header-po_method.
    move wa_upload-vdatu to wa_header-req_date_h.
    move wa_upload-bstkd_e to wa_header-purch_no_s.
    *move wa_upload-route to wa_header-route.
    move wa_upload-vsbed to wa_header-ship_cond.
    move wa_upload-empst to wa_header-rec_point.
    move wa_upload-shtyp to wa_header-ship_type.
    move wa_upload-zterm to wa_header-pmnttrms.
    move wa_upload-inco1 to wa_header-incoterms1.
    move wa_upload-inco2 to wa_header-incoterms2.
    ENDFORM.                    " f_fill_header
    *&      Form  f_fill_partner
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_partner.
    if not wa_upload-kunnr is initial.
    select single kunnr from kna1 into v_kunnr
                where kunnr = wa_upload-kunnr.
    if sy-subrc <> 0.
    Message E014 with 'customer does not exist'.
    else.
    move 'AG' to i_partner-partn_role.
    move wa_upload-kunnr to i_partner-partn_numb.
    move wa_upload-land1_s to i_partner-country.
    move wa_upload-name1_s to i_partner-name.
    move wa_upload-name2_s to i_partner-name_2.
    move wa_upload-ort01_s to i_partner-city.
    move wa_upload-regio_s to i_partner-region.
    move wa_upload-pstlz_s to i_partner-postl_code.
    move wa_upload-adrnr_s to i_partner-address.
    append i_partner.
    endif.
    endif.
    if not wa_upload-kunag is initial.
    select single kunnr from kna1 into v_kunag
                where kunnr = wa_upload-kunag.
    if sy-subrc <> 0.
    Message E015 with 'end customer does not exist'.
    else.
    move 'WE' to i_partner-partn_role.
    move wa_upload-kunag to i_partner-partn_numb.
    move wa_upload-land1_c to i_partner-country.
    move wa_upload-name1_c to i_partner-name.
    move wa_upload-name2_c to i_partner-name_2.
    move wa_upload-ort01_c to i_partner-city.
    move wa_upload-regio_c to i_partner-region.
    move wa_upload-pstlz_c to i_partner-postl_code.
    move wa_upload-adrnr_c to i_partner-address.
    append i_partner.
    endif.
    endif.
    ENDFORM.                    " f_fill_partner
    *&      Form  f_fill_item
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_item.
    loop at i_upload into wa_upload.
    if not wa_upload-matnr is initial.
    select single  maramatnr msegmenge into (v_matnr, v_zmeng) from
                       mara inner join mseg on maramatnr = msegmatnr
                       where mara~matnr = wa_upload-matnr.
    if sy-subrc <> 0.
    Message E016 with 'material no does not exist'.
    elseif v_zmeng LT wa_upload-zmeng.
    Message E017 with 'order quantity is greater than the quantity present'.
      endif.
    endif.
    move wa_upload-posnr to i_item-itm_number.
    move wa_upload-pstyv to i_item-item_categ.
    move wa_upload-matnr to i_item-material.
    move wa_upload-zmeng to i_item-target_qty.
    move wa_upload-meins to i_item-target_qu.
    move wa_upload-werks to i_item-plant.
    *move wa_upload-meins to wa_vbap-meins.
    *move wa_upload-posnr_tot to wa_vbap-posnr_tot.
    move wa_upload-posex to i_item-po_itm_no.
    move wa_upload-kdmat to i_item-cust_mat22.
    move wa_upload-inco1 to i_item-incoterms1.
    move wa_upload-inco2 to i_item-incoterms2.
    move wa_upload-zterm to i_item-pmnttrms.
    move wa_upload-empst to i_item-rec_point.
    move wa_upload-shtyp to i_item-ship_type.
    move wa_upload-route to i_item-route.
    append i_item.
    PERFORM f_fill_schedule_line.
    PERFORM f_fill_conditions.
    ENDLOOP.
    ENDFORM.                    " f_fill_item
    *&      Form  f_fill_schedule_line
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_schedule_line.
    move wa_upload-matnr to i_schedule-itm_number.
    move sy-datum to i_schedule-req_date.
    move wa_upload-zmeng to i_schedule-req_qty.
    append i_schedule.
    ENDFORM.                    " f_fill_schedule_line
    *&      Form  f_fill_conditions
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_conditions.
    move wa_upload-matnr to i_cond-itm_number.
    move sy-datum to i_cond-conpricdat.
    append i_cond.
    ENDFORM.                    " f_fill_conditions
    *&      Form  f_clear
          text
    -->  p1        text
    <--  p2        text
    FORM f_clear.
    clear:p_auart,
          p_vkorg,
          p_vtweg,
          p_spart,
          p_vkgrp,
          p_vkbur.
    ENDFORM.                    " f_clear
    *&      Form  f_call_BAPI
          text
    -->  p1        text
    <--  p2        text
    FORM f_call_BAPI.
    clear:i_item,i_partner,i_schedule.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
      SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = wa_header
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                  = sorder
      TABLES
      RETURN                        =
       ORDER_ITEMS_IN                 = i_item
      ORDER_ITEMS_INX               =
        ORDER_PARTNERS                = i_partner
       ORDER_SCHEDULES_IN             = i_schedule
      ORDER_SCHEDULES_INX           =
      ORDER_CONDITIONS_IN            = i_cond.
      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 ( sorder-vbeln is initial ).
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    write: /'Order number:', sorder.
    else.
    loop at i_return.
    write: / i_return-id, i_return-number, i_return-message(80).
    endloop.
    *write: /'Error'.
    endif.
    *loop at i_return.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    ENDFORM.                    " f_call_BAPI

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • Error while creating Sales Order Through BAPI

    Hi Friends,
      i am creating a RFC where i have to create sales order .
    I am using bapi
    BAPI_SALESORDER_CREATEFROMDAT2
    for same and entering values to it.
    I got the following return messages:
    S V4                   233 SALES_HEADER_IN has been processed successfully
    S V4                   233 SALES_ITEM_IN has been processed successfully
    S V1                   311 BDN Order 3112800903 has been saved
    But when I go to transaction VA03 and enter the number i get the following error:
    SD document 3112800903 is not in the database or has been archived
    Can any one know how to resolve this error.I am also using BAPI_TRANSACTION_COMMIT with wait = 'X'.
    Regards,
    Santosh Alle

    Hi,
    Try to check the return message once.
    SD document 3112800903 is not in the database or has been archived
    You will get this message if the sales document is deleted from the database .The BAPI   'BAPI_SALESORDER_CHANGE'  is used to delete salesorder.Check whether anyone has deleted it
    Also, sometimes it may take few seconds to update the sales order in the database when using BAPI. Check the transaction after some time.
    Regards,
    Lakshman.
    Edited by: Lakshman N on May 14, 2010 7:43 AM

Maybe you are looking for

  • Error while installing Device Software Update usin...

    I have installed Nokia Suite 3.2.100 on my Win XP-SP3 machine. Upon signing in, Nokia Suite indicated that I have an update available for my device (Nokia N8-00 running Symbian Anna, Type RM-596). The application available for update was Nokia Maps -

  • Filter is not working

    Hi Experts, We are trying to replicate the data from one oracle database to more than one target oracle database , For this we have used region wise filter on data PUMP process , like where region_id =US,EU,IN The filter is working normally for ascii

  • Sent messages from secondary account are not saved in Outlook 2011 for Mac

    We are using a shared email account added in Outlook 2011 for Mac.  It's not the default account but we send from it often. Whenever sending from this secondary mailbox, the message is not saved in sent items folder under the secondary mailbox or the

  • How to compile a java file in J9 for windows mobile 5.0

    I have downloaded J9 for windows mobile 5.0 and need help on how to compile a java file.

  • My iPod 5 message isn't working

    I've tried logging out of my apple but it still isn't working. I've also reset my ipod and reset the wifi but I can't send or receive messages.. I've also turned off the messages.. It's just not working