Problem in creating IR through BAPI_INCOMINGINVOICE_create BAPI

Hi,
Some problem in creating IR through the BAPI BAPI_INCOMINGINVOICE_create. I am able to see the IR number after executing the BAPI but unable to see the IR number in the table. The IR number is not getting updated in the database table even though we are doing the commit work after executing the BAPI. Could anyone help me out with this error.
Regards,
Ram

First of all I am assuming that you did not get any error in the BAPI return structure (even though you see document number populated).
Secondly,  I guess you tested the BAPI with SE37 and did not get any error (functionally there are a number of BAPIs available to post an invoice and it is important to figure out the correct BAPI - e.g. PO, non-PO invoice, invoice as a GL entry only, etc.).
If that is not true (there is some error in posting), since during the BAPI call the next document number is obtained as a first step, you will see the document number but subsequently if for some reason it is not posted, you will see the result as you mentioned (no data in the database).
If you are using correct BAPI and have no errors, then  in ABAP program make sure to call 'BAPI_TRANSACTION_COMMIT' after the BAPI call to post invoice.
For non-SAP external system, you need not have to call the commit BAPI but just closing the connection to SAP will help.

Similar Messages

  • Problem in creating delivery through VL10B

    Hi,
    While creating delivery through VL10B, i am getting error -
    An item with no delivery quantity is not permitted. Item will be deleted.
    What should be error???
    Ref. My previous Thread..
    Re: Problem in creating delivery through VL10B
    Regards...

    In MMBE transaction, there is sufficient stock.
    Please clear, if this will be allocated to other outbound deliveries..then any problem... How can I check this, that it is allocated to other outbound deliveries.
    How can we it found under the stock "Schedule for delivery"..
    Regards..

  • Problem while creating IR with BAPI_INCOMINGINVOICE_CREATE

    Hi,
    Getting error message while creating IR through some external service. We are using the BAPI BAPI_INCOMINGINVOICE_CREATE to create IR.
    Error Message is "There is different account assignment information in item 000001".
    Could anyone let me know what exactly we need to pass for the field "Invoice Doc Item".
    Regards,
    Uma

    Did you check the FM documentation? There are some illustrative examples given.
    In case you do not have it:
    here is an excerpt:
    Example: Incoming Invoice
    This example shows the header data that you need to enter in table Headerdata and the item data that you need to enter in table Itemdata to post an invoice.
    Purchase order: 10 pieces of material A at $10/piece
    Goods receipt: 10 pieces of material A
    You receive an invoice against this purchase order, with reference to purchase order number 4500007491, order item 10, for a quantity of 10 pieces of material A and an amount of $116, including 16% sales tax. Enter the following data:
    Table HeaderData
    INVOICE_IND (Post invoice/credit memo): X
    DOC_DATE (Document date): 05.20.2000
    PSTNG_DATE (Posting date): 05.23.2000
    COMP_CODE (Company code): 1000
    GROSS_AMOUNT (Gross amount): 116.00
    CURRENCY (Currency key): USD
    CALC_TAX_IND (Calculate tax): X
    Table ItemData
    INVOICE_DOC_ITEM (Invoice document item): 00001
    PO_NUMBER (Purchase order number): 4500007491
    PO_ITEM (Purchase order item): 00010
    TAX_CODE (Tax code): VN
    ITEM_AMOUNT (Item amount): 100
    QUANTITY (Quantity): 10
    PO_UNIT (Unit of measure): PC
    For more information, see the parameter documentation for tables HeaderData and Itemdata.
    Example: Incoming Invoice in Foreign Currency, Goods-Receipt-Based
    Invoice Verification and Tax Information
    This example specifies the header data that you need to enter in table Headerdata, the item data that you need to enter in table Itemdata and the tax information that you need to enter in table TaxData to post an invoice in a foreign currency.
    Purchase order: 10 pieces of material A at $10/piece
    First goods receipt: 4 pieces of material A
    Second goods receipt: 6 pieces of material A
    You receive an invoice against this purchase order, with reference to purchase order number 4500007505, order item 10, goods receipt document 50010095, 2000, item 1. The invoice is for a quantity of 4 pieces of material A, a gross amount of $46.60 and 16% sales tax ($6.60). Enter the following data:
    Table HeaderData
    INVOICE_IND (Post invoice/credit memo): X
    DOC_DATE (Document date): 05.20.2000
    PSTNG_DATE (Posting date): 05.23.2000
    COMP_CODE (Company code): 1000
    CURRENCY (Currency key): USD
    GROSS_AMOUNT (Gross amount): 46.60
    Table ItemData
    INVOICE_DOC_ITEM (Invoice document item): 00001
    PO_NUMBER (Purchase order number): 4500007505
    PO_ITEM (Purchase order item): 00010
    REF_DOC (Goods receipt document): 50010095
    REF_DOC_YEAR (Fiscal year of current period): 2000
    REF_DOC_ITEM (Goods receipt document item): 1
    TAX_CODE (Tax code): VN
    ITEM_AMOUNT (Item amount): 40.00
    QUANTITY (Quantity): 4
    PO_UNIT (Unit of measure): PC
    Table TaxData
    TAX_CODE (Sales tax code): VN
    TAX_AMOUNT (Tax amount in document currency): USD 6.60
    For more information, see the parameter documentation for tables HeaderData, ItemData, and TaxData.
    Example: Incoming Invoice for Blanket Purchase Order
    This invoice shows which header data you need to enter in table HeaderData, which item data you need to enter in table ItemData, and which account assignment data you need to enter in table AccountingData in order to post an incoming invoice for a blanket purchase order.
    You receive an invoice for the blanket PO 4500015172, PO item 10 for an amount 110 USD incl. sales tax at 10%. You want to distribute the invoice amount to the cost centers 1200 and 1500. Enter, for example, the following data:
    Table HeaderData
    INVOICE_IND (Post invoice/credit memo): X
    DOC_DATE (Document date): 02.19.2001
    PSTING_DATE (Posting date): 02.21.2001
    COMP_CODE (Company code): 1000
    GROSS_AMOUNT (Gross amount): 110
    CURRENCY (Currency): USD
    CALC_TAX_IND (Calculate tax): X
    Table ItemData
    INVOICE_DOC_ITEM (Item in the invoice document): 00001
    PO_NUMBER (PO number): 4500015172
    PO_ITEM (PO item): 00010
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Item amount): 100
    Table AccountingData
    1st line: Change account assignment data
    INVOICE_DOC_ITEM (Document item in invoice document): 0001
    SERIAL_NO (Serial number for the acc. assignment): 01
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Amount in document currency): 30
    GL_ACCOUNT (G/L account number): 890000
    COSTCENTER (Cost center): 1200
    2nd line: Add unplanned account assignment
    INVOICE_DOC_ITEM (Document item in invoice document): 0001
    XUNPL (Unplanned acct. assignment from IV): X
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Amount in document currency): 70
    GL_ACCOUNT (G/L account number): 890000
    COSTCENTER (Cost center): 1500
    In the case of a blanket purchase order, the following fields for quantities and units of measurement must not be filled in the tables ItemData and AccountingData:
    Quantity (QUANTITY)
    PO_UNIT (PO unit of measure)
    PO_UNIT_ISO (PO unit of measure in ISO code)
    PO_PR_QNT (Quantity in PO price unit of measure)
    PO_PR_UOM (PO price unit of measure)
    PO_PR_UOM_ISO (PO price unit of measure in ISO code)
    For more information, see the parameter documentation for tables HeaderData, ItemData, and AccountingData, or in the SAP Library under Logistics Invoice Verification.
    Example: Change Account Assignments and Add Unplanned Assignments
    This example shows the header data that you need to enter in table Headerdata, the item data that you need to enter in table Itemdata, and the account assignment information that you need to enter in table AccountingData to change, add, and post account assignments for an invoice. If you want to change or add account assignments, there must be a non-valuated goods receipt or no goods receipt in the system. Goods-receipt-based invoice verification is specified.
    Purchase order: 300 pieces of material A at $1.00/piece
    Goods receipt: 300 pieces of material A
    This purchase order is subject to account assignment. You receive an invoice for it, refering to purchase order number 4500006846, order item 10, goods receipt document 50008849, 2000, item 1. The invoice is for a quantity of 100 pieces of material A, with a gross invoice amount of USD 116.00, including 16% sales tax. You want to change the planned account assignment for the second account assignment item and add an unplanned account assignment. Enter the following data:
    Table HeaderData
    INVOICE_IND (Post invoice/credit memo): X
    DOC_DATE (Document date): 08.05.2000
    PSTNG_DATE (Posting date): 08.08.2000
    COMP_CODE (Company code): 1000
    CURRENCY (Currency key): USD
    GROSS_AMOUNT (Gross amount): 17.40
    CALC_TAX_IND (Calculate tax automatically): X
    PMNTTRMS (Terms of payment key): 0001
    Table ItemData
    INVOICE_DOC_ITEM (Invoice document item): 00001
    PO_NUMBER (Purchase order number): 4500006846
    PO_ITEM (Purchase order item): 00010
    REF_DOC (Goods receipt document): 500008849
    REF_DOC_YEAR (Fiscal year of current period): 2000
    REF_DOC_ITEM (Goods receipt document item): 1
    TAX_CODE (Tax code): VN
    ITEM_AMOUNT (Item amount): 100
    QUANTITY (Quantity): 100
    PO_UNIT (Unit of measure): PC
    Table AccountingData
    Row 1: Change second account assignment item
    INVOICE_DOC_ITEM (Invoice document item): 0001
    SERIAL_NO (Account assignment serial number): 02
    TAX_CODE (Tax code): VN
    ITEM_AMOUNT (Amount in document currency): 10.00
    QUANTITY (Quantity): 10
    PO_UNIT (Order unit): PC
    GL_ACCOUNT (G/L account number): 890000
    COSTCENTER (Cost center): 1200
    Row 2: Add unplanned account assignment
    INVOICE_DOC_ITEM (Invoice document item): 0001
    XUNPL (Unplanned account assignment in Invoice Verification): X
    TAX_CODE (Tax code): VN
    ITEM_AMOUNT (Amount in document currency): 5.00
    QUANTITY (Quantity): 5
    PO_UNIT (Order unit): PC
    GL_ACCOUNT (G/L account number): 890000
    COSTCENTER (Cost center): 1200
    For more information, see the parameter documentation for tables HeaderData, ItemData, and TaxData, or Logistics Invoice Verification in the SAP Library.
    Example: Invoice with Planned Delivery Costs
    This examples shows the header data that you need to enter in table HeaderData, the item data that you need to enter in table ItemData, and the tax information that you need to enter in table TaxData to post an invoice containing planned delivery costs.
    Purchase order: 100 pieces of material A at $1.00/piece
    Goods receipt: 100 pieces of material A
    You receive an invoice for this purchase order refering to purchase order number 4500006986, order item 10, for a quantity of 100 pieces of material A and $136.00, including 16% sales tax and $20.00 planned delivery costs. Enter the following data:
    Table HeaderData
    INVOICE_IND (Post invoice/credit memo): X
    DOC_DATE (Document date): 08.10.2000
    PSTNG_DATE (Posting date): 08.12.2000
    COMP_CODE (Company code): 1000
    CURRENCY (Currency key): USD
    GROSS_AMOUNT (Gross amount): 136,00
    Table ItemData
    Row 1: Posting the purchase order item
    INVOICE_DOC_ITEM (Invoice document item): 00001
    PO_NUMBER (Purchase order number): 4500006986
    PO_ITEM (Order item): 00010
    TAX_CODE (Sales tax code): VN
    ITEM_AMOUNT (Item amount): 100.00
    QUANTITY (Quantity): 100
    PO_UNIT (Unit of measure): PC
    Row 2: Posting the planned delivery costs
    INVOICE_DOC_ITEM (Invoice document item): 00002
    PO_NUMBER (Order number): 4500006986
    PO_ITEM (Order item): 00010
    ITEM_AMOUNT (Item amount): 20.00
    QUANTITY (Quantity): 100
    PO_UNIT (Unit of measure): PC
    COND_TYPE (Condition type): FRB1
    Table TaxData
    TAX_CODE (Sales tax code): VN
    TAX_AMOUNT (Tax amount in document currency): 16.00
    For more information, see the parameter documentation for tables HeaderData, ItemData, and TaxData.
    Example: Incoming Invoice with Withholding Tax
    This example shows you what header data you can enter in table HeaderData, and what item data and withholding tax information you can enter in table TaxData in order to park an incoming invoice with withholding tax.
    Purchase order: 10 pieces of material A at $10
    Goods receipt: 10 pieces of material A
    You receive an invoice for this delivery with reference to purchase order number 4500007505, PO item 10, GR document 50010095 2000, Item 1. The invoice is for a quantity of 10 pieces and a gross amount of $100. You have to pay 10% withholding tax for the gross amount. Enter the following data:
    Table HeaderData
    INVOICE_IND (Invoice/Credit memo): X
    DOC_DATE (Document date): 05.20.2000
    PSTNG_DATE (Posting date): 05.23.2000
    COMP_CODE (Company code): WT01
    CURRENCY (Currency key): USD
    GROSS_AMOUNT (Gross amount): $100
    Table ItemData
    INVOICE_DOC_ITEM (Item from invoice document): 00001
    PO_NUMBER (PO number): 4500007505
    PO_ITEM (PO item): 00010
    REF_DOC (GR document): 50010095
    REF_DOC_YEAR (Fiscal year of the current period): 2000
    REF_DOC_ITEM (Item in a GR document): 1
    TAX_CODE (Tax code): V0
    ITEM_AMOUNT (Item amount): $100
    QUANTITY (Quantity): 10
    PO_UNIT (Unit of measure): PC
    Table WithTaxData
    SPLIT_KEY (Grouping key for withholding tax split): 0001
    WI_TAX_TYPE (Code for withholding tax type): R1
    WI_TAX_CODE (Withholding tax code): 01
    WI_TAX_BASE (Withholding tax base amount): 100
    WI_TAX_AMT (Withholding tax amount in doc. currency): 10.00
    For more information, see the parameter documentation for tables HeaderData, ItemData, and WithTaxData.
    Example: Incoming Invoice with Amount Split
    This example shows you what header data you need to enter in table HeaderData, what item data you enter in table ItemData, and what information you can enter in table VendorSplitData in order to create an invoice with an amount split.
    Purchase order: 10 pieces of material A at $10
    Goods receipt: 10 pieces of material A
    You receive an invoice for this purchase order with reference to PO number 4500007505, PO item 10, GR document 50010095, item 1. The invoice is for a quantity of 10 pieces and a gross amount of $100. You want to distribute the gross amount to two vendor lines. 40% of the gross amount should be paid immediately by check, and 60% of the gross amount should be paid within 14 days, taking into account a 3% cash discount. Enter the following data:
    Table HeaderData
    INVOICE_IND (Invoice/Credit memo): X
    DOC_DATE (Document date): 05.20.2000
    PSTNG_DATE (Posting date): 05.23.2000
    COMP_CODE (Company code): 0001
    CURRENCY (Currency key): USD
    GROSS_AMOUNT (Gross amount): 100.00
    Table ItemData
    INVOICE_DOC_ITEM (Item from the invoice document): 00001
    PO_NUMBER (PO number): 4500007505
    PO_ITEM (PO item): 00010
    REF_DOC (GR document): 50010095
    REF_DOC_YEAR (Fiscal year for the current period): 2000
    REF_DOC_ITEM (Item from a GR document): 1
    TAX_CODE (Tax code): V0
    ITEM_AMOUNT (Item amount): 100
    QUANTITY (Quantity): 10.00
    PO_UNIT (Unit of measure): PC
    Table VendorItemSplitData
    1st vendor line
    SPLIT_KEY (Grouping key for split in the vendor line): 0001
    SPLIT_AMOUNT (Gross invoice partial amount in doc. currency): 40.00
    PYMT_METH (Payment method): S
    TAX_CODE (Tax code): V0
    PMNTTRMS (Payment terms key): 0001
    2nd vendor line
    SPLIT_KEY (Grouping key for split in the vendor line): 0002
    SPLIT_AMOUNT (Gross invoice partial amount in doc. currency): 60.00
    PYMT_METH (Payment method): U
    TAX_CODE (Tax code): V0
    PMNTTRMS (Payment terms key): 0003
    For more information, see the parameter documentation for tables HeaderData, ItemData, and VendorItemSplitData.
    Example: Incoming Invoice with G/L and Material Account Posting
    This example shows you which data you have to provide in order to enter and post an incoming invoice (header data in table HeaderData, item data in table ItemData, G/L account information in table GlAccountData, and material account information in table MaterialData).
    You receive an invoice with reference to PO number 4500006846, PO item 10. The invoice is for a quantity of 100 PC of material A, a gross amount of 150.80 USD incl. 16% tax. Included in this is a G/L account posting of 10 USD to account 400000 in company code 1, and a material account posting to the material MAT01n for 20 USD.
    Enter the following data:
    Table HeaderData
    INVOICE_IND (Post invoice/credit memo): X
    DOC_DATE (Document date): 08.05.2000
    PSTNG_DATE (Posting date): 08.08.2000
    COMP_CODE (Company code): 1000
    CURRENCY (Currency key): USD
    GROSS_AMOUNT (Gross amount): 150.80
    CALC_TAX_IND (Automatically calculate tax): X
    PMNTTRMS (Payment terms key): 0001
    Table ItemData
    INVOICE_DOC_ITEM (Invoice document item): 00001
    PO_NUMBER (PO number): 4500006846
    PO_ITEM (PO item): 00010
    TAX_CODE (Tax code): VN
    ITEM_AMOUNT (Item amount): 100
    QUANTITY (Quantity): 100
    PO_UNIT (Unit of measure): PC
    Table GlAccountData
    INVOICE_DOC_ITEM (Document item in invoice document): 00001
    GL_ACCOUNT (G/L account): 400000
    ITEM_AMOUNT (Item amount): 10,00
    DB_CR_IND (Debit/credit indicator): S
    COMP_CODE (Company code): 0001
    TAX_CODE (Tax code): VN
    COSTCENTER (Cost center): 1
    Table MaterialData
    INVOICE_DOC_ITEM (Document item in invoice document): 0001
    MATERIAL (Material): MAT01
    PLANT (Valuation area): 0001
    DB_CR_INP (Debit/credit indicator): S
    ITEM_AMOUNT (Item amount): 10.00
    QUANTITY (MENGE_D): 1
    PO_UNIT (PO quantity unit of measure): PC
    TAX_CODE (Tax code): VN
    For more information, see the parameter documentation for the tables HeaderData, ItemData, GlAccountData and MaterialData or in the SAP Library under Logistics Invoice Verification.
    Example: Invoice for a Purchase Order for External Services and Service-Based Invoice Verification.
    This example shows you which header data to enter in table HeaderData, which item data to enter in table ItemData, and which account assignment data to enter in table AccountingData in order to enter and post an incoming invoice.
    You receive an invoice with reference to the PO number 4500000191, PO item 10. Two services A and B are invoiced, each with a quantity of six service units. Service A has a gross amount of 580 Euro incl. 16% tax. Service B has 812 Euro incl. 16% tax. Service A has an account assignment of 50% to both cost centers 1000 and 2000. Service B also has an account assignment to cost centers 1000 and 3000. The service acceptance is performed jointly for both services in one service entry sheet number 1000000022. You cannot change the account assignments.
    Enter the following data:
    Table HeaderData
    INVOICE_IND (Post invoice/credit memo): X
    DOC_TYPE (Document type): RE
    DOC_DATE (Document date): 01.10.2002
    PSTNG_DATE (Posting date): 01.10.2002
    COMP_CODE (Company code): 0001
    CURRENCY (Currency key): USD
    GROSS_AMOUNT (Gross amount): 1392.00
    CALC_TAX_IND (Calculate tax automatically): X
    PMNTTRMS (Payment terms key): 0001
    Table ItemData
    First entry for service A:
    INVOICE_DOC_ITEM (Item in invoice document): 000001
    PO_NUMBER (PO number): 4500000191
    PO_ITEM (PO item): 00010
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Item amount): 250.00
    QUANTITY (Quantity): 1
    PO_UNIT (Unit of measure): SU
    SHEET_NO (Service entry sheet number): 1000000022
    SHEET_ITEM (Line number): 10
    Second entry for service A:
    INVOICE_DOC_ITEM (Item in invoice document): 000002
    PO_NUMBER (PO number): 4500000191
    PO_ITEM (PO item): 00010
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Item amount): 250.00
    QUANTITY (Quantity): 3
    PO_UNIT (Unit of measure): SU
    SHEET_NO (Entry sheet number): 1000000022
    SHEET_ITEM (Line number) : 10
    First entry for service B:
    INVOICE_DOC_ITEM (Item in invoice document): 000003
    PO_NUMBER (PO number): 4500000191
    PO_ITEM (PO item): 00010
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Item amount): 350.00
    QUANTITY (Quantity): 3
    PO_UNIT (Unit of measure): SU
    SHEET_NO (Entry sheet number): 1000000022
    SHEET_ITEM (Line number) : 20
    Second entry for service B:
    INVOICE_DOC_ITEM (Item in invoice document): 000004
    PO_NUMBER (PO number): 4500000191
    PO_ITEM (PO item): 00010
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Item amount): 700.00
    QUANTITY (Quantity): 1
    PO_UNIT (Unit of measure): SU
    SHEET_NO (Service entry sheet number): 1000000022
    SHEET_ITEM (Line number) : 20
    Table AccountingData
    First account assignment for service A:
    INVOICE_DOC_ITEM (Document item in invoice document): 000001
    SERIAL_NO (Sequential number of the account assignment): 01
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Amount in document currency): 250.00
    QUANTITY (Quantity): 3
    PO_UNIT (PO unit of measure): SU
    Second account assignment for service A:
    INVOICE_DOC_ITEM (Document item in invoice document): 000001
    SERIAL_NO (Sequential number of the account assignment): 02
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Amount in document currency): 250.00
    QUANTITY Quantity): 3
    PO_UNIT (PO unit of measure): SU
    First account assignment for service B:
    INVOICE_DOC_ITEM (Document item in invoice document): 000003
    SERIAL_NO (Sequential number of the account assignment): 01
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Amount in document currency): 350.00
    QUANTITY (Quantity): 3
    PO_UNIT (PO unit of measure): SU
    Second account assignment for service B:
    INVOICE_DOC_ITEM (Document item in invoice document): 000004
    SERIAL_NO (Sequential number of the account assignment): 03
    TAX_CODE (Tax code): V1
    ITEM_AMOUNT (Amount in document currency): 350.00
    QUANTITY (Quantity): 3
    PO_UNIT (PO unit of measure): SU
    For more information, see the parameter documentation for the tables HeaderData, ItemData, and AccountingData, or see the SAP Library under Logistics Invoice Verification.
    Example: Incoming Invoice for a One-Time Vendor
    This example shows you how to proceed in order to enter and post an invoice for a one-time vendor.
    You do not need to enter data into table AddressData. If you do not enter data in table AddressData, the address data for the one-tine vendor are copied 1:1 from the purchase order into the invoice.
    If you use table AddressData to transfer data, the address data for the one-time vendor is read from the purchase order into the invoice and is either overwritten or enhanced in the fields of table AddressData.
    The purchase order for the one-time vendor has the following stored data: Name 'SAP AG', postal code '60000' and street and building number 'Neurottstraße 16'. You receive an invoice with the one-time vendor address: Name 'SAP AG', postal code '69190', and city 'Walldorf'. Enter the following data:
    Table AddressData
    ACC_1_TIME (Indicator one-time vendor): X
    NAME (Name): SAP AG
    POSTL_CODE (Postal code): 69190
    CITY (City): Walldorf
    The invoice is posted with the following one-time vendor: Name 'SAP AG' street and building number 'Neurottstraße 16', postal code '69190', city 'Walldorf'.
    For more information, see the parameter documentation for table AddressData.
    Example: Incoming Invoice for a Different Payee
    This example shows you which address data you must enter in table AddressData in order to enter and post an invoice for a different payee.
    You receive an invoice for a different payee with name 'SAP AG', postal code '69190', city 'Walldorf', bank number '38070724' and account number '4711'.
    Enter the following data:
    Table AddressData
    ACC_1_TIME (Indicator one-time vendor): ' '
    NAME (Name): SAP AG
    POSTL_CODE (Postal code): 69190
    CITY (City): Walldorf
    BANK_NO (Bank number): 38070724
    BANK_ACCT (Bank account number): 4711

  • Problem with creating order through order template

    Hi experts,
    We have problem with creating order by order template.  Extensions data available in order template is not sent to order.   Extension data are showing upto order submission form.  But after sucessful creation of order  extension data are no longer available in  CRM-ORDEr.
    We are using ISA 4.0 with CRM 4.0.
    We recently applied patches on CRM server.  Before patching it was working fine.
    Can you please suggest us to solve this issue?
    Thanks in Advance.
    Regards,
    Murugan Arumugam.

    closed.

  • Problem in creating Purchase order Using BAPI

    Dear ABAPers,
             I am creating the Purchase order Using BAPI_PO_CREATE1. In that the Purchase order Line item i am giving the Net Price for the Material.But While creating the purchase order the system creates the puchase order with the net price which is already available in the memory.So how to solve this problem.
    Thanks & Regards,
    Ashok.

    Hi,
        Try to pass the value NO_PRICE_FROM_PO in the BAPI and see
    NO_PRICE_FROM_PO = 'X'
    Regards
    Bala Krishna

  • 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

  • Problem with creating business partner via BAPI

    Hello! I have a simple File-RFC-File scenario:
    XML-file with Firstname, Lastname and PartnerCategory. I use BAPI_BUPA_CREATE_FROM_DATA to create a partner with this data.
    It works, in target file I have a number of new business partner, but I can't find new partner in the system. Like I only tested BAPI_BUPA_CREATE_FROM_DATA in "bapi" transaction without real effect.

    Hi,
    probably you didn't comit the BAPI
    RFC adapter allows to specify comit for BAPI
    add this to your RFC channel configuration and you will see the partner
    for more info read section:
    Commit Control for Single BAPI Calls
    from
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/e80440a832e369e10000000a155106/content.htm
    Regards,
    Michal Krawczyk

  • Problem in creating work center using bapi

    hai all,
    i am creating work center using " CRAP_WORKCENTER_CREATE ", it is also getting created successfully when I try to check CAPACITY for capacities and scheduling it is giving a error called.
    " in table T006 entry is missing " . why it is comming like that.

    Hi Goutam/Ram,
        I am trying to create capicity . I am useing CRAP_CAPACITY_CREATE .
       But I am getting so many errors. Is it the right Bapi or do know any other BAPI.
       We are trying to copy Capacities and work center from one plant to other.
    Plz send if you any documentation or code. Also send work order creating code.
    Thanks in Advance.

  • Problem with Creating Appointments

    Hi All
    I am facing the following problem while creating appointment through Collaboration Launch Pad.
    " An exception occurred while reading or writing from/to the IIS server "
    What can be the problem?
    Points Assured
    Thanks
    Karan

    Hello Karan,
    Please refer to SAP note:736644.
    Also check if user mapping for exchange is maintained??
    Please read "User rights on the IIS server" section in the note.
    I am sure this will resolve the issue.
    Best Regards
    Anjali

  • Unable to create PO with multiple line items through LSMW-BAPI method

    Hi All,
    I have a requirement of creating PO through LSMW. I can't use LSMW standard batch input program since there are some fileds not available and also it has many limitations. I'm using LSMW-BAPI method ( Business object BUS2012) which create IDOC and uses BAPI_PO_CREATE1 to ultimately post the PO in the system. I am trying to create PO from a single file which contains both Header and Item data.
    Now my problem is that everytime PO is being created with Single line item only. Everytime I am giving multiple item data in the source file LSMW is preparing multiple IDOCs for multiple line items. As per my understanding this is happenng since header and item is in the same hierarchy level of IDOC type PORDCR102 and the control record is inserted for every line item in the source file.
    It seems that through LSMW-BAPI  it is not possible to create PO with multiple line items. Can anybody provide some input regarding this? Thanks in advance.
    BR,
    Atanu Mukherjee

    Solved by myself.
    Earlier the problem was that LSMW was not being able to recognize items under same header. It was creating new IDOCs every time it gets a new item. To enable this we need to create two structure HEADERDATA and ITEMDATA.  Two additional identifier fields with identifier value 'H' and 'I' should be added in these two structures respectively. Then we need one sequential file with the identifiers field followed by the header and Item data. Example:
    H~header data
    I~item data
    I~item data 
    This would help the standard program to understand what are the items under same header and ultimately create PO with multiple line items.
    BR,
    Atanu Mukherjee

  • Problem when creating a sales order with reference by BAPI

    I am facing one problem when creating Sales Order.
    <b>The scenario is like this while creating SO With reference to an Order type, a new SO will be automatically created with a diff order Type</b>.
    I am using "BAPI_SALESORDER_CREATEFROMDAT2".
    I am calling this BAPI in USEREXIT_REFRESH_DOCUMENT.
    Am I using the right exit to call this Bapi ?
    <b>Problems are like :
    1. Ref Sales Order creating without Sales Unit .
    2. "Object Status does not exist" error msg is coming for Header and Item level(when clicking the status tab and then object status pushbutton).</b> But if testing the bapi from SE37 in test sequence....no such problem persists.
    As for example in case of sales unit,in the debugging mode i have seen that BAPI uses a perform to fill the values in the VBAP structure.But after that when it come back to the main program VBAP remains blank.This ocuurs when the BAPI is called from the exit whereas  if tested from SE37, VBAP retains the value.
    Can u suggest in this ? This is very very urgent............
    Thx in Adv.........................

    Thanks........
    Your suggestion was a great help to me.I have used a custom FM and called it in <b>starting new task</b>.
    Since i am a university fresher working in SAP for nearly 1 year.....can you please explain me the difference between <b>in update task</b> and <b>starting new task</b>.Why the problem was occuring for which you have suggested to call a custom function module.
    what is V1 update and V2 update?Is it attached with asynchronous ans synchronous update.It would be a great help to me if you kindly clear my confusions....
    thanks in advance.

  • Problem in Creating Business Partner through BP

    Hi All,
    I am facing a problem in creating a business partner through transaction BP. I am selecting the Create Person tab. Selecting 'Employee' as BP role, choosing Xxternal Assignment. I am also giving mandatory fields like First name , last name and country. When i am saving it it is getting saved but an error message comes which says "Personal Address does not exist".
    The entry comes in table BUT000 also but when I go to BP transaction again and open the Business partner it is not opening giveing the same error message. Please help in resolving this.
    Thanks & Regards,
    Saket

    Hello Saket,
    The error "Personal Address does not exist" (AM013) indicates a DB inconsistancy. That is the address number in table BUT020 does not have data in table ADRC. Please check whether this is your case.
    If you can recreate such error in a non-modified SAP enverionment, please raise a customer message to SAP.
    To correct the inconsistancies, please use the reports in note 865271 and note 1096330.
    Best regards,
    Maggie

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

  • TO CREATE SALES ORDER USING BAPI PROBLEM

    I am trying to create Sales Order using bapi function, this is giving me error as mentioned below
    *Please enter SHIP-TO-PARTY OR SOLD TO PARTY
    *SALES DOCUMENT WAS NOT CHANGED.
    it does not GIVE ME THE SALES DOCUMENT NO .
    The BAPI I am using is BAPI_SALESORDER_CREATEFROMDAT2.
    Would someone know which parameters I have to papulate,or have any other suggestion
    THE INTERNAL TABLES I AM PASSING TO BAPI FUNCTION ARE
    DATA:  IT_BAPI_HEADER LIKE BAPISDHD1.
    DATA:     IT_BAPI_SOLD_TO_PARTY LIKE BAPIPARNR occurs 0 with header line.
    DATA:  SO_NO LIKE BAPIVBELN-VBELN.
    DATA:  IT_BAPI_ITEMS_IN LIKE BAPISDITM occurs 0 with header line.
    DATA: IT_BAPI_RETURN LIKE BAPIRET2 occurs 0 with header line.
    IS THERE ANYTHING ELSE TO POPULATE OTHER THAN THIS STRUCTURES
    HEADER
          Sales-Document type:      
    *     Sales-Organization
    *     Distrubution-Channel: 
    *     Division          
    PARTNER
            Partner Function     
         Customer Number      
    ITEM DETAIL
             Material Number      
    how to accomplish my task?

    Nandan,
    Please go through the documentation of the BAPI. It gives you details of what needs to be filled in in which structure/parmater. Also, read the documentation associated with each structure, that will tell what to fill.
    It is really hard to explain it in simple terms as to what are required. But, you need the header, items and partners at the minimum. Also, with some of these structures there are also 'X' structures(like ORDER_ITEMS_INX for ORDER_ITEMS_IN) which should also be filled based on what fields you filled in the original structure. For example, if you filled 'MATERIAL' field on the ORDER_ITEMS_IN structure, you should also fill in the same field on the ORDER_ITEMS_INX structure with an 'X' in it.
    All this is well documented in the BAPI.
    Srinivas

  • How to create sales order using BAPI.

    Hi all,
    I am trying to create sales order using standard BAPI
    "BAPI_SALESORDER_CREATEFROMDAT2". But, even I had entered all mandatory fields, I am unable to create sales order sucessfully.
    I had gone through the documentaion of this BAPI and entered these fields.
    These are the mandatory fields that which I had tried to create,
    ORDER_HEADER_IN :
    DOC_TYPE Sales document type
    SALES_ORG Sales organization
    DISTR_CHAN Distribution channel
    DIVISION Division
    ORDER_PARTNERS..:
    PARTN_ROLE Partner role, SP sold-to party
    PARTN_NUMB Customer number
    ORDER_ITEMS_IN..:
    MATERIAL Material number
    Do we have anymore fields to give as inputs? I am getting this error message as below :
    Msg: Personal number 00007176 does not exit.
    But, I am not giving any personal number manually. This personal number was having connection with partner role field,
    I had reffered this from the VBPA (Sales Document: Partner Table). Now, please suggest me how to solve this?
    Can anyone tell me how to solve this problem and create sales order sucessfully.
    Thanks in advance,
    Surender Batlanki.

    hi surendra ,
    chech with below code.
    REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    let us know if you have any qauistions.
    ~linganna

Maybe you are looking for

  • Probably stupid question - Windows background in black

    This is probably a stupid question for longtime Mac users... I'm trying to adjust to this OS... I recently 'upgraded' to a MacBookPro from a PC, and have been very happy with my decision so far. However, when using windows I ran themes that displayed

  • BDC for Document Clearing - FBRA

    Hi, When I use transaction FBRA and try clearing document then it populates window asking three options - 1. Only Resetting  2. Resetting and Reverse  3. Cancel.  I need to choose 1st option i.e. Only Resetting. I am trying to record the transaction

  • Nothing on mediasource is work

    a message comes up saying "unable to change the sound device to your selected device" all of my drivers and applications are updated so i do not know what else to do. Please help..

  • Encode the URL with space

    Hi all Ihave some content which needs to be encode with the URL.. E.G: URL is --http://localhost:8080/appname/notify? content need to encode---msgtxt=bal P0045IN I am using HttpConnector.executeGetMethod(URL_BAL, URLParameters); But it giving Error c

  • Can we adjust the camera resolution in Palm Pre?

    I am a Volunteer here, not employed by HP. You too can become an HP Expert! Details HERE! If my post has helped you, click the Kudos Thumbs up! If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you