Skip to Content
0
Former Member
Mar 04, 2009 at 07:55 PM

Exporting Invoice to SAP Business one 2007 shows $0 as amount

13 Views

I have 2007 Business one installed and I am exporting invoice from our Software to SAP but it shows the Amount $0 in SAP when I see the A/R Invoice. Below is my code:

Dim vDrafts As SAPbobsCOM.Documents

Set vDrafts = vCmp.GetBusinessObject(oDrafts)

vDrafts.CardCode = invoiceEvents.ClientId

vDrafts.ManualNumber = invoiceEvents.InvoiceNumber

vDrafts.HandWritten = tNO

vDrafts.DocDate = invoiceEvents.DocumentDate

vDrafts.DocType = dDocument_Service

vDrafts.DiscountPercent = CDbl("0")

vDrafts.PaymentGroupCode = "-1"

If isFirstOne <> 1 Then vDrafts.Lines.Add

vDrafts.Lines.AccountCode = AcctCode

vDrafts.Lines.ItemDescription = invItem.Reference

vDrafts.Lines.Price = IIf(isCreditNote = 1, -CDbl(invItem.Amount), CDbl(invItem.Amount))

vDrafts.Lines.Quantity = 1

RetVal = vDrafts.Add

If RetVal <> 0 Then

vCmp.GetLastError RetVal, ErrMsg

If RetVal = -2028 Then ErrMsg = strError(8)

WriteToReportFile gstrLogFile, ErrMsg

Exit Function

End If