Skip to Content
0
Former Member
Sep 05, 2006 at 02:45 PM

Error - "The data area passed to a system call is too small"

261 Views

When I will add the invoice, this error raise in the GetLastErrorDescription of company object... What it's wrong with my code ?

    Dim sComp As New SAP.Company
    With sComp
      .Server = "(local)"
      .CompanyDB = "SBODemo_Brazil"
      .UserName = "manager"
      .Password = "manager"
      If .Connect <> 0 Then        
        MsgBox(.GetLastErrorDescription)
        Me.Close()
      End If
    End With
    Dim sPedi As SAP.Documents
    sPedi = sComp.GetBusinessObject(SAP.BoObjectTypes.oInvoices)
    sPedi.CardCode = "GUI"
    sPedi.CardName = "f"
    sPedi.DocDueDate = Now
    sPedi.Lines.ItemCode = "1"
    sPedi.Lines.Quantity = 3
    sPedi.Lines.Usage = "3"
    sPedi.Lines.Add()
    sPedi.Lines.ItemCode = "2"
    sPedi.Lines.Quantity = 3
    sPedi.Lines.Usage = "3"
    sPedi.DocTotal = 60
    If sPedi.Add() <> 0 Then
      MsgBox(sComp.GetLastErrorDescription)
    End If