Skip to Content
0
Former Member
Aug 13, 2005 at 08:54 AM

Error F5104 BAPI_INCOMINGINVOICE_CREATE

333 Views

Hi All,

I am not sure, whether this is right thread or I should post this message in ABAP thread.

I am trying to create incoming invoice using BAPI_INCOMINGINVOICE_CREATE, below is my code. But I am getting Error with ID F5 and with Number 104 as "Vendor is not defined in company code 0100". I am a .Net Developer, I am not getting how do I pass Vendor code to this BAPI.

Can anybody please help me to get rid of this error?

Dim conn As String = ConfigurationSettings.AppSettings("SAPConnectionString")

BbpIncomingInvoice1.ConnectionString = conn

Dim vHeaderData As New sapnet.BAPI_INCINV_CREATE_HEADER

Dim vItemTable As New sapnet.BAPI_INCINV_CREATE_ITEMTable

Dim vAddressData As New sapnet.BAPI_INCINV_CREATE_ADDRESSDATA

Dim vAccountingData As New sapnet.BAPI_INCINV_CREATE_ACCOUNTTable

Dim vGLAccountData As New sapnet.BAPI_INCINV_CREATE_GL_ACCOUNTTable

Dim vMaterialData As New sapnet.BAPI_INCINV_CREATE_MATERIALTable

Dim vTaxData As New sapnet.BAPI_INCINV_CREATE_TAXTable

Dim vWithTaxData As New sapnet.BAPI_INCINV_CREATE_WITHTAXTable

Dim vVendorItemSplitData As New sapnet.BAPI_INCINV_CREATE_VENDORSPLITTable

Dim vBapiReturn As New SAP.Connector.BAPIRET2Table

vHeaderData.Invoice_Ind = "X"

vHeaderData.Doc_Date = "20050813"

vHeaderData.Pstng_Date = "20050813"

vHeaderData.Comp_Code = "0100"

vHeaderData.Gross_Amount = "100"

vHeaderData.Currency = "INR"

vHeaderData.Calc_Tax_Ind = "X"

Dim ItemDataTable As New DataTable

ItemDataTable = vItemTable.ToADODataTable.Clone

Dim drDataRow As DataRow

drDataRow = ItemDataTable.NewRow()

drDataRow("INVOICE_DOC_ITEM") = "000010"

drDataRow("PO_NUMBER") = "3520000227"

drDataRow("PO_ITEM") = "00010"

drDataRow("TAX_CODE") = ""

drDataRow("ITEM_AMOUNT") = "100"

drDataRow("QUANTITY") = "2"

drDataRow("PO_UNIT") = ""

ItemDataTable.Rows.Add(drDataRow)

For i As Integer = 0 To ItemDataTable.Rows.Count - 1

vItemTable.ToADODataTable.Rows.Add(ItemDataTable.Rows(i).ItemArray)

Next

BbpIncomingInvoice1.CreateFromData(vHeaderData, vAddressData, vItemTable, vAccountingData, vGLAccountData, _

vMaterialData, vTaxData, vWithTaxData, vVendorItemSplitData, vBapiReturn, "", "")

DataGrid1.DataSource = vBapiReturn.ToADODataTable

DataGrid1.DataBind()

Thanks in advance,

Nitin