Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI error

Hi Experts,

When I am test excuting the BAPI 'BAPI_INCOMINGINVOICE_CREATE' in se37, the BAPI is executing correctly without any error and is returning an invoice number.

But when I am using the same data to execute the BAPI in my program, it is throwing a BAPI error:

Error Type: F

Error ID: F5

Error Message:Program error: incorrect callup of FI_PERIOD_CHECK

I am filling the input files like this,i.e. my code:

IF NOT t_inputfile IS INITIAL.

SORT t_inputfile BY inv_doc_no .

LOOP AT t_inputfile assigning <f_inputfile>.

at new inv_doc_no.

wa_invoice_header-invoice_ind = c_inv_indicator.

wa_invoice_header-doc_type = c_doc_type.

wa_invoice_header-doc_date = <f_inputfile>-doc_date.

wa_invoice_header-pstng_date = <f_inputfile>-pstng_date.

wa_invoice_header-ref_doc_no = <f_inputfile>-ref_doc_no.

wa_invoice_header-comp_code = <f_inputfile>-comp_code.

wa_invoice_header-diff_inv = <f_inputfile>-diff_inv.

wa_invoice_header-currency = <f_inputfile>-currency.

wa_invoice_header-gross_amount = <f_inputfile>-gross_amount.

wa_invoice_header-calc_tax_ind = c_calc_tax_ind.

wa_invoice_header-bline_date = <f_inputfile>-bline_date.

endat.

at new invoice_doc_item.

wa_invoice_item-invoice_doc_item = <f_inputfile>-invoice_doc_item.

wa_invoice_item-po_number = <f_inputfile>-po_number.

wa_invoice_item-po_item = <f_inputfile>-po_item.

wa_invoice_item-ref_doc = <f_inputfile>-ref_doc.

wa_invoice_item-ref_doc_year = <f_inputfile>-ref_doc_year.

wa_invoice_item-ref_doc_it = <f_inputfile>-ref_doc_it.

wa_invoice_item-de_cre_ind = c_de_cr_ind.

wa_invoice_item-tax_code = <f_inputfile>-tax_code.

wa_invoice_item-item_amount = <f_inputfile>-item_amount.

wa_invoice_item-quantity = <f_inputfile>-quantity.

wa_invoice_item-po_unit = <f_inputfile>-po_unit.

wa_invoice_item-po_pr_qnt = <f_inputfile>-po_pr_qnt.

wa_invoice_item-po_pr_uom = <f_inputfile>-po_pr_uom.

append wa_invoice_item to t_invoice_item.

clear wa_invoice_item.

endat.

at end of inv_doc_no.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'

EXPORTING

headerdata = wa_invoice_header

  • ADDRESSDATA =

IMPORTING

INVOICEDOCNUMBER = v_inv_no

FISCALYEAR = v_year

tables

itemdata = t_invoice_item

  • ACCOUNTINGDATA =

  • GLACCOUNTDATA =

  • MATERIALDATA =

  • TAXDATA =

  • WITHTAXDATA =

  • VENDORITEMSPLITDATA =

return = t_return

  • EXTENSIONIN =

.

Where can I be wrong.

Regards,

Sangeeta.

Former Member
Not what you were looking for? View more on this topic or Ask a question