Error in invoice creation using BAPI BAPI_INCOMINGINVOICE_CREATE

Hi All,
I am using BAPI_INCOMINGINVOICE_CREATE to create an invoice using below data,
wa_header-invoice_ind = 'X'.
wa_header-doc_date = sy-datum.   "Enter the document date
wa_header-pstng_date = sy-datum. "Enter the posting date
wa_header-ref_doc_no = 'Test'.
wa_header-comp_code = 'L110'.
wa_header-gross_amount = '528.2400'.  "Enter the gross amount(aft. tax) for the invoice
wa_header-calc_tax_ind = 'X'.
wa_header-currency = 'USD'.
wa_item-invoice_doc_item = '000001'.
wa_item-po_number = '4600013733'.    "Enter the PO number
wa_item-po_item = '00010'.           "Enter the PO item number
wa_item-tax_code = 'I1'.             "Enter the tax code applicable
wa_item-item_amount = '528.2400'.     "Enter the item amount
wa_item-quantity = '1'.           "Enter the invoice quantity
wa_item-po_unit = 'PC'.              "Enter the UoM
APPEND wa_item TO it_item.
when i call the BAPI its giving me an error
Enter a tax code in item 000001
so  when i entered a data in  TAXDATA  table of BAPI again it throw an error,
Enter value in either field HEADERDATA-CALC_TAX_IND or field TAX_AMOUNT (import parameter TAXDATA).
As per my requirement we wanted to set CALC_TAX_IND .
Kindly suggest me.
Thanks and regards,

Dear Reddy
My excel contain date format 'YYYYMMDD'
But the server in i am uploading data having date format 'DDMMYYYY'.
bapi also having date format YYYYMMDD.
BUT in TCODE AS91 HAVING DATE IN DDMMYYYY FORMAT.
Due to this format it is giving error.

Similar Messages

  • How to post invoice parked using  BAPI-  BAPI_INCOMINGINVOICE_CREATE

    Hi all,
    Can anybody help me with the following scenario:
    I am parking Invoice document using BAPI:  <b>BAPI_INCOMINGINVOICE_PARK</b>. It gives me a document no. which I can see in frontend system also by committing the BAPI.
    But when I try to post the same using BAPI: <b>BAPI_INCOMINGINVOICE_CREATE</b> , It gives me a different document no.
    Means it is not posting the document which has been parked earlier but it is creating totally a new document. Can anybody  tell me using BAPIs how to post the same document that I had parked using  BAPI:  <b>BAPI_INCOMINGINVOICE_PARK</b>??
    Thanks
    Saurabh

    Hi Shraman,
    For a requirement for Intercompany GL posting, use BAPI_ACC_DOCUMENT_POST for standard posting with some advanced parameters
    In Header of the BAPI, pass the hardcoded values like
    DOCUMENTHEADER
           OBJ_TYPE            =            FKKSU
           OBJ_KEY             =          $
           OBJ_SYS              =          System name 
           BUS_ACT             =           RFBU
    Other parameters you can pass in Header is:
    USERNAME
    HEADER_TXT
    COMP_CODE
    DOC_DATE
    PSTNG_DATE
    TRANS_DATE
    FISC_YEAR
    FIS_PERIOD
    DOC_TYPE
    REF_DOC_NO
    If you are posting a document in cross-companies 1000 & 1001, you need to pass cost-center with the line item. That is the mandatory field.
    Thanks,
    Guru

  • Vendor invoice creation using BAPI BAPI_ACC_DOCUMENT_POST

    Hi,
    I am trying to create vendor invoice(FB60) using BAPI_ACC_DOCUMENT_POST.
    Could anyone please let me know what all mandatory fields we have to pass in vendor item and header to create this ?
    Regards,
    Anubhuti Pandey

    Hi,
    Please call the FM BAPI_ACC_DOCUMENT_POST and try with the following parameters:
    Function module to post the accounting document
          CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'           
    "      EXPORTING
              documentheader    = w_documentheader                                          
    "      TABLES
              accountgl               = i_accountgl
              accountreceivable = i_accountreceivable
              accountpayable     = i_accountpayable
              currencyamount    = i_currencyamount
              return                     = i_return
              contractitem           = i_contractitem.
    The required fields in the header document:
        w_documentheader-bus_act    
        w_documentheader-username    = sy-uname.                                             "Username
        w_documentheader-header_txt 
        w_documentheader-comp_code 
        w_documentheader-doc_date  
        w_documentheader-pstng_date  = sy-datum. 
        w_documentheader-trans_date                                 " Transaction date value as per document date
        w_documentheader-fisc_year   = sy-datum(4).      
        w_documentheader-doc_type      
    Pass the necessary information in the account GL and accounts payable.
    I hope this helps you in some way.

  • Error while salesorder creation using bapi

    Hi  All
    while testing the bapi salesordercreatefromdat2 in se37 ,its working.
    but in reports i m passing same data with this bapi ,its not working.
    its showing error message like:sales document type OR is not defined.
    so where is the problem.

    Hi
    Check with the value of import parameter ORDER_HEADER_IN-DOC_TYPE you are passing to function module BAPI_SALESORDER_CREATEFROMDAT2.
    Regards
    Srilaxmi

  • Error while using bapi BAPI_INCOMINGINVOICE_CREATE to post MIRO

    Hi Friends,
             Im using bapi BAPI_INCOMINGINVOICE_CREATE to post MIRO.
             im passing data to table GLACCOUNTDATA.
             Below are the table fields im paasing
         INVOICE_DOC_ITEM " '000001' deafault always
         GL_ACCOUNT  "Which is constant for all in my case               
         ITEM_AMOUNT      " Total PO net amt + Frieght charges header level      
         DB_CR_IND      " 'S' always default     
         COMP_CODE      " 'RPPL' always default          
         TAX_CODE      " 'V0'     deafault always     
         PROFIT_CTR       " for ex 1100180. based on plant
              While posting this bapi is trhrowing error as below
         'profit centre  RPPL/1100180 does not exist for 01.12.2008'
         where 01.12.2008 is the MIRO posting date which im passing in header.
            We checked dates for profit centres they are correct.
            Awaiting the reply ASAP.
    Regards,
    Venky

    Hi,
    It would be better if you do a recheck on data input for BAPI. If you sure the data are ok but the BAPI still gives error message, then I suggest to post to OSS.
    Regards,
    Teddy Kurniawan

  • Reena Prabhakar - Sales order creation Using BAPI

    Hi Reena,
    This is Dinesh,i also face problem in Sales order creation using BAPI if you can send me the code it would be great help to me.
    Regards,
    Dinesh

    Anyhow, here is the code that I am using currently which works perfectly well. Not sure if it will be of any help to you, since the values to the BAPI come from the Webdynpro application. I have values stored in my "Test data directory" which I use for testing from the backend.
    FUNCTION ztest.
    Call the BAPI to create Sales Order
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in     = l_order_header
        IMPORTING
          salesdocument       = l_salesdocument
        TABLES
          return              = it_return
          order_items_in      = it_order_items
          order_partners      = it_order_partners
          order_schedules_in  = it_order_schdl
          order_conditions_in = it_order_conditions
          order_text          = it_order_text.
      READ TABLE it_return WITH KEY type = 'E'.
      IF sy-subrc = 0.
    *-- error occured
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ELSE.
    *-- no error
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      ENDIF.
    ENDFUNCTION.

  • Posting Subsequent Credit Using BAPI: BAPI_INCOMINGINVOICE_CREATE

    Hi,
    I need to post subsequent credits using BAPI: BAPI_INCOMINGINVOICE_CREATE.
    In MIRO transaction we get option to select transaction (Invoice/Credit Memo/Subsequent Debit/Subsequent Credit).
    But in case of BAPI I am not able to find such field. At headerdata there is one field INVOIC_IND to determine whether the system posts a credit memo or an invoice.
    How can we post Subsequent Credit using this BAPI?
    Regards,
    Umesh

    Hi,
    For the BAPI below is the structure mapping.
    <b>BAPI Structurename Field Value Value Description
    Headerdata</b>
    DOC_DATE 02/08/2005
    INVOICE_IND X Post Invoice
    PSTNG_DATE 02/08/2005
    COMP_CODE 5010 Hospira Inc.
    CURRENCY/ CURRENCY_ISO USD United States Dollar
    GROSS_AMOUNT 100.0000
    DOC_TYPE RE PO Invoice
    REF_DOC_NO 1 Billing document no
    EXCH_RATE 1.00000
    CALC_TAX_IND X
    HEADER_TXT header text
    <b>Item Data</b>
    INVOICE_DOC_ITEM 000001 Invoice Document no
    PO_NUMBER 4500125768 PO No
    PO_ITEM 1 PO item no
    ITEM_AMOUNT 100.0000
    QUANTITY 10.000
    PO_UNIT EA Each
    REF_DOC 5000000007 Goods Receipt No
    REF_DOC_YEAR 2005 GR year
    REF_DOC_IT 0001 Goods Receipt item no
    TAX_CODE I0 AP, not relevant to tax
    ITEM_TEXT Text
    <b>Note:</b>For standard purchase order(Po's start with 45*****) it wont allow you to create without Goods Receipt. U can create an invoice without a Good receipt for only intercompany purchase orders.
    If this is useful, pls reward with points.
    Regards,
    savitha

  • Need sales order creation using bapi in oops

    need code for sales order creation using bapi in oops

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

  • Mass sales order creation using BAPI

    Dear All,
    Can anyone help in  mass sales order creation using Bapi BAPI_SALESORDER_CREATEFROMDAT2.
    For example if i want to create 3 sales order with three item per order . i am populating
    HEADER = 3 Records
    Item   = 9 records
    schedule = 9 records
    partner  = 1 record.
    Then after populating the records I am calling Bapi BAPI_SALESORDER_CREATEFROMDAT2
    to create order. It should have created three order but unfortunately it creates
    only one sales order. I debugged and found that records are correct both in header,
    item, scheudle and partners.
    Could you please guide me what I am missing for creation of mass orders.
    I appreciate your time and many thanks in advance.
    cheers
    chandra

    Hi Chandra,
    Do like this.
    Loop at Header table into wa_header.
    *-- Move BAPI Header data
    Loop at item table into wa_item where condition.
    *--  in this move all Item and Schedule line item  to the BAPI.
      At end of item .
    Use the below function modules.
    BAPI_SALESORDER_CREATEFROMDAT2
    BAPI_TRANSACTION_COMMIT.
    Endloop.
    Endloop.
    Regards,
    Balavardhan.K

  • Facing error while invoice creation in AR.

    Facing error while invoice creation in AR as Please complete your tax accounting flexfield. We are creating invoice through API.
    Regards
    Sridhar

    Hi,
    Please go through the below Note ID.
    Autoinvoice Error On Tax Codes - Please Complete Your Tax Accounting Flexfield [ID 1469285.1]
    Regards,
    Raju.

  • Material Master Creation Using BAPI

    Hi,
    I m using BAPI_MATERIAL_SAVEDATA for Material creation using BAPI.
    Now the problem is , i have created a Screen exit long back in Purchasing view.. the corresponding Z field is created in table MARC..
    How can i pass value to this Z field using BAPI.
    i tried with BAPI_MARC.. my Z field is not coming in that structure.
    Can anyone guide me how can this be achieved.
    Thanks in Advance
    Aravindh Mani

    Hi,
    The Function Module BAPI_MATERIAL_SAVEDATA has the options to pass the Z fields. There exits a structure parameters
    EXTENSIONIN
    EXTENSIONINX
    in BPAI. In EXTENSIONIN pass the data and value part you can pass  in EXTENSIONINX. So this will update the Z fileds in material
    master .

  • Error in standard network creation using BAPI

    hi,
    I need to create standard network using BAPI.
    I am trying with BAPI_BUS2002_CREATE. As per the documentation, I need to call function BAPI_PS_INITIALIZATION. But, I am not able to get the required output since its giving me error.
    Does anybody has used the same BAPI for standard network creation.
    Regards,
    Ujjwala

    HI,
            How did u create standard network? If u used bapi, which bapi did u use???

  • Service order creation using bapi with repair order number

    Hi experts,
    Pls suggest me a BAPI to create a service order for those repair orders where a PGR has been done(for return delivery type : LR).
    The plant should be 0260 with storage location wh01 and item category ZRRE
    Creation of a service order with repair order type SM03 is not allowed in iw31.
    thanks and regards,
    Vijayb.

    Hi prakash,
    Thank u for the BAPI
    But an error is being displayed saying that the REFURBISHMENT ORDERS CANNOT BE PROCESSED USING BAPI.
    ERROR DURING PROCESSING OF BAPI METHODS.
    This is while u pass the order type as either ZM03 or SM01or SM02 or SM03.
    pls help me on that.
    thanks and regards,
    Vijayb.

  • Internal Error -2038 Invoice Creation

    ¡Hi! Help!
    I explain my problem
    I've created a vb.net 2005 application. Through DI API (SBO 2005 SP 01, patch level 20).
    This application, windows forms run, it opens an SBO conection and  starts a timer. Every 5 secconds the timer ticks, it
    searches for custom xml files containing info needed to create/update Invoices, or Sales Orders. Whenever I find files to
    process, the timer stops, documents are processed one after another and then timer continue ticking. I use one Company and
    one conection open since the moment the program starts and it remains opened the whole day.
    There are two servers. SAP Server, and there's another server (in this server runs my application, here I have just my app
    and DI API so it connects to SAP Server) both on same Domain.
    Database size is 50 GB, and it grows about 90 - 100 MB every day
    The amount of invoices created is about 500/600 daily.
    Problem is many times invoices creation are unsuccesfull due to one of the following errors:
    OINV.Series , 'Internal error (-2038) occurred'  or just OINV.Series , 'Internal error (-2038) occurred'
    this makes more difficult to figure out the reason why this happen and moreover how to solve it, because as some or many of
    you may know, internal error is not much explict and the causes for this error are very different.
    Now, I'm certain Invoice series are OK because the same Invoice creation that fails in one moment, simply is succesfully
    created after 2, 3 or even 5 or 6 tries!.
    Errors increase a lot at evening, when intensive use of SBO database is taking place. However these errors use to happen
    even  at morning when few Invoices are created, I mean, not necessarily happen at intensive use.
    Invoices are not that large. The biggest are about 10 - 12 lines.
    This situation is frustrating both for my customer and myself
    Has anyone experienced something similar? is this something about sbo db performance? does anyone knows if there's some kind
    of document about Internal error?

    Hi Marcel,
    I think the first thing I'd check is for deadlocks on the database. Earlier patches of SBO 2005A SP1 are known to have issues in this area (see SAP note 1113543 for an example). It would certainly fit the symptoms you are getting (ie the same document can be created without errors at a different time).
    Kind Regards,
    Owen

  • Problem with Multiple record creation using BAPI BAPI_PRICES_CONDITION

    Hi,
    I am working on IS Media Sales And Distribution wherein i am using BAPI BAPI_PRICES_CONDITION for condition record creation in TCODE JC9B. I am able to create one record using this BAPI for one sales promotion but having problem while creation of multiple records for the same sales promotion wherein my internal table have multiple records. It gives me error that data in BAPICONDIT is missing.
    I am aatching followig code for reference
    BAPI have field of varkey which i am filling as combination of sales org. + distn channel + sales promotion + delivery type
    In this varkey  delivery type is changing for sales promotion Can be said that one sales promotion can have multiple delivery type .
    Am i giving the correct varkey for each itration of internal table ?
    I am attaching code for reference.
    Here loop it_cond contain one promotion and multiple delivery type.
    sales org   distn ch  promotion     delivery
    0100             01        zsalesprom   03
    0100             01        zsalesprom   z3
      LOOP AT it_cond INTO wa_cond.
    Get next condition number
          CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING
              nr_range_nr                   = '01'
              object                        = 'KONH'
      QUANTITY                      = '1'
      SUBOBJECT                     = ' '
      TOYEAR                        = '0000'
      IGNORE_BUFFER                 = ' '
           IMPORTING
              number                        = number
      QUANTITY                      =
      RETURNCODE                    =
    EXCEPTIONS
      INTERVAL_NOT_FOUND            = 1
      NUMBER_RANGE_NOT_INTERN       = 2
      OBJECT_NOT_FOUND              = 3
      QUANTITY_IS_0                 = 4
      QUANTITY_IS_NOT_1             = 5
      INTERVAL_OVERFLOW             = 6
      BUFFER_OVERFLOW               = 7
      OTHERS                        = 8
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Here i am concacating varkey for each new delivery
    CLEAR : l_min,l_length,l_var.
    CONCATENATE wa_cond-vkorg wa_cond-vtweg wa_cond-wrbakt INTO l_var.
    l_length = STRLEN( l_var ).
    IF l_var+14(2) IS INITIAL.
    WRITE wa_cond-lifart TO L_VAR+14.
    l_length = STRLEN( l_var ).
    ENDIF.
    W_LINE = W_LINE + 1.
    *First table in BAPI
            wa_bapicondct-operation = '009'.
            wa_bapicondct-cond_usage = 'A'.
            wa_bapicondct-table_no = '506'.
            wa_bapicondct-applicatio = 'J0'.
            wa_bapicondct-cond_type = 'RATE'.
            wa_bapicondct-varkey = l_var.
            wa_bapicondct-valid_to = wa_cond-datbi.
            wa_bapicondct-valid_from = wa_cond-datab.
            wa_bapicondct-cond_no = number. "
            APPEND wa_bapicondct TO it_bapicondct.
    *Second table in BAPI
            wa_bapicondhd-operation = '009'.
            wa_bapicondhd-cond_no = number.
            wa_bapicondhd-cond_usage = 'A'.
            wa_bapicondhd-table_no = '506'.
           wa_bapicondhd-created_by = sy-uname.
           wa_bapicondhd-creat_date = sy-datum.
            wa_bapicondhd-applicatio = 'J0'.
            wa_bapicondhd-cond_type = 'RATE'.
            wa_bapicondhd-varkey = l_var.
            wa_bapicondhd-valid_from = wa_cond-datab.
            wa_bapicondhd-valid_to = wa_cond-datbi.
            APPEND wa_bapicondhd TO it_bapicondhd.
    *Third table in BAPI
            wa_bapicondit-operation = '009'.
            wa_bapicondit-cond_no = number.
            wa_bapicondit-cond_count = wa_cond-cond_count.
            wa_bapicondit-applicatio = 'J0'.
            wa_bapicondit-cond_type = 'RATE'.
            wa_bapicondit-calctypcon = 'C'.
           wa_bapicondit-scaletype  = 'A'.
            wa_bapicondit-cond_value = wa_cond-kbetr.
            wa_bapicondit-condcurr = wa_cond-konwa.
            wa_bapicondit-promotion = wa_cond-wrbakt.
            APPEND wa_bapicondit TO it_bapicondit.
    *Fourth table in BAPI
            wa_bapicondqs-operation = '009'.
            wa_bapicondqs-cond_no = number.
            wa_bapicondqs-cond_count = wa_cond-cond_count.
            wa_bapicondqs-currency = wa_cond-kbetr.
            wa_bapicondqs-condcurr = wa_cond-konwa.
           wa_bapicondqs-cond_unit = 'EA'.
            wa_bapicondqs-LINE_NO = W_LINE."'0001'.
            APPEND wa_bapicondqs TO it_bapicondqs.
    *Fifth table in BAPI
            wa_bapicondvs-operation = '009'.
            wa_bapicondvs-cond_no = number.
            wa_bapicondvs-cond_count = wa_cond-cond_count.
            wa_bapicondvs-currenckey = wa_cond-konwa.
            wa_bapicondvs-currenciso = wa_cond-konwa.
           wa_bapicondvs-currency = wa_cond-kbetr.
           wa_bapicondvs-condcurr = wa_cond-konwa.
           wa_bapicondvs-curren_iso = wa_cond-konwa.
           wa_bapicondvs-LINE_NO = W_LINE."'0001'.
            APPEND wa_bapicondvs TO it_bapicondvs.
            CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
      PI_INITIALMODE       = ' '
      PI_BLOCKNUMBER       =
              TABLES
                ti_bapicondct        = it_bapicondct
                ti_bapicondhd        = it_bapicondhd
                ti_bapicondit        = it_bapicondit
                ti_bapicondqs        = it_bapicondqs
                ti_bapicondvs        = it_bapicondvs
                to_bapiret2          = it_bapiret2
                to_bapiknumhs        = it_bapiknumhs
                to_mem_initial       = it_cnd_mem_initial
             EXCEPTIONS
               update_error         = 1
               OTHERS               = 2
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
               wait          = 'X'
    IMPORTING
      RETURN        =
            CLEAR : wa_bapicondct,wa_bapicondhd,wa_bapicondvs,wa_bapicondqs.
            CLEAR : wa_bapicondit.
          ENDLOOP.
        ENDIF.
      ENDIF.
    Kindly Suggest.
    Thanks
    Parag

    Solved By myself
    There is problem while passing data to internal table for item level

Maybe you are looking for

  • Billing Doc can't cancelled--Urgent

    < MODERATOR:  Message locked.  Please read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting next time. > Pls help on this issue. When i cancelled the billing doc through VF11 Fi docume

  • Accounts for Goods issue

    Hi all, After creating a Sales order, i created a outbound delivery document and did a Goods issue here. A material and accounting document is created for the Goods issue. In the accounting document i can see that it hits a G/L account and costcenter

  • Issues with Backup-GPO Scheduled Task as a non-admin account

    I'm having an issue trying to get a daily backup of domain GPO's from a non-administrative account. I'm using Powershell 2.0, the Backup-GPO cmdlet runs fine as a standard user, but when I run the same cmdlet with the same user, but with a scheduled

  • How to connect contacts to facebook??

    how to connect my contacts to facebook??like displaying the profile picture to contacts??

  • Count of rows in ALv report

    Hi! I would like to get the count of rows in my ALV report . How to get the count of the rows ? Can anyone guide me in getting it dome please. Thanks