Internal Error (-5002) on adding Additional Expenses in a sales-document

Hi All,
I try to add an additional expense in a sales-document. I receice an internal error (-5002) What is the problem ?
I want to transfer the additional expense from a sales-order to my target delivery note.
See my example in C#:
               oDlvNote.CardCode = cuno;
                oDlvNote.DocDueDate = oDate;
                string queryvx2 = "Select ExpnsCode, LineTotal, Comments,
DocEntry, LineNum From " + tablenameexp + " Where DocEntry
= " + origornov;
                using (System.Data.SqlClient.SqlDataReader sqlReadervx2 =
SwissAddonFramework.B1Connector.GetB1Connector().ExecuteQuery(queryvx2))
                    while (sqlReadervx2.Read())
                        expcode = sqlReadervx2.GetInt32(0);
                        linetotexp =
Decimal.ToDouble((Decimal)sqlReadervx2.GetSqlDecimal(1));
                        remarksexp = sqlReadervx2.GetString(2);
                        docentryexp = sqlReadervx2.GetInt32(3);
                        linenumexp = sqlReadervx2.GetInt32(4);
                oDlvNote.Expenses.BaseDocEntry = docentryexp;
                oDlvNote.Expenses.BaseDocLine = linenumexp;
                oDlvNote.Expenses.BaseDocType = objectnr;
                oDlvNote.Expenses.ExpenseCode = expcode;
                oDlvNote.Expenses.LineTotal = linetotexp;
                oDlvNote.Expenses.Remarks = remarksexp;
          --->    oDlvNote.Expenses.Add();
                oDlvNote.Lines.ItemCode = Artikel;
Regards,
Roland

Hi Roland,
I think it's the same issue as here:
-5002,if you reference production in a row,so all rows should be refer prod
Regards,
Frank
PS: Expenses are a "lines" type oject - just like Document_Lines - which are handled in the TB1300
Message was edited by:
        Frank Moebius

Similar Messages

  • "Internal Error -5002" every order

    On every order submitted from web tools, either thru the administrative screen or by the customer, is giving this error:
    -5002:Internal error (-5002) occurred
       at NetPoint.SynchSBO.SBOObjects.SBODocument.NP_2_SBO(Documents& document, NPOrder order)
       at NetPoint.SynchSBO.SBOObjects.SBOOrder.NetPointToSBO(NPQueueObject qData)
       at NetPoint.SynchSBO.SynchObjectBase.Synch()
    I searched the forums to see if that error number was asked previously, didn't find any posts about this specific error.  The error only gives that number and doesn't say anything about what could cause it, so I don't have any leads to go off of   Every order gets this sync error; the sync error repeats each time sync runs.
    Any suggestions?

    Hi Jason
    Something with the forum search makes it so that searching for "-5002" returns nothing while searching for "5002" returns this
    [https://forums.sdn.sap.com/search.jspa?threadID=&q=5002&objID=f252&dateRange=all&numResults=15&rankBy=10001|https://forums.sdn.sap.com/search.jspa?threadID=&q=5002&objID=f252&dateRange=all&numResults=15&rankBy=10001]

  • Internal Error (-5002) occurred

    Hi,
    I got the error : Internal Error (-5002) occurred when adding a new A/R invoice
    I would like so much to know what exactly causes the error.
    Is there any way to pin point what is it ?
    Or I'm stuck alone with this not so friendly message ?
    I've eliminated everything suspected to be a problem.
    There's a lot of user defined field.  Is there something I should know about them ?
    Is there any trick to find out where the problem is ?
    The code is working for SBODemo_US but when I try with the Customer's database which is BIG and have a lot of UDF, I got this.
    Since its INTERNAL ERROR, I don't really know where the problem can be !
    Thx you for your helps

    This was due to setting the ExpensesCode when no expenses existed
    I had to eliminate possible problem line by line.  A pain in the you know what...

  • "Internal error (-5002) occurred" On Pick List Update Picked Quantity

    Hi Experts,
    I have an SDK program that simply tries to update the Picked Quantity in SAP. Previously it has been working fine, until I try to use the same logic for items managed by Batch or Serial Number.
    In this scenario, I have created a PickList with only 1 row, the item is managed by Serial Number.
    I try to simplify the code as below.
    Dim oBaseDocument As SAPbobsCOM.PickLists
    oBaseDocument = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPickLists)
    BaseDocument.GetByKey(12345)
    oBaseDocument.Lines.SetCurrentLine(0)
    oBaseDocument.Lines.PickedQuantity += 1
    oBaseDocument.Lines.BinAllocations.Add()
    oBaseDocument.Lines.BinAllocations.SetCurrentLine(0)
    oBaseDocument.Lines.BinAllocations.BinAbsEntry = CInt(sBinAbsEntry)
    oBaseDocument.Lines.BinAllocations.Quantity += dXML_Quantity
    oBaseDocument.Lines.SerialNumbers.InternalSerialNumber = sXML_BatchSerialNo      ' <--- ***
    lRet = oBaseDocument.Update
    I have added the *** line for handling the Serial Number, but when it hit the Update command, the SDK returns "Internal error (-5002) occurred".
    I'm not sure what does it means.
    Anyway I tried to remove the *** line and it works fine for item not managed by Batch or Serial, but the issue will remains for the Items managed by Serial or Batch.
    Please advise whether I missed anything in this code.
    Thank you in advance.
    Best Regards,
    Krisma

    Hi Krisma,
    I haven't done this thing practically but error -5002 will occur, if there is any Invalid Object.
    You can check it accordingly.
    Hope it helps.
    Thanks & Regards
    Ankit Chauhan

  • Why do I get "Internal Error (-5002) occurred" when doing external recon via SDK ?

    I can reconcile an invoice and matching incoming payment as below:
    Table OJDT is:
    BatchNum
    TransId
    BtfStatus
    TransType
    BaseRef
    RefDate
    Memo
    Ref1
    Ref2
    CreatedBy
    LocTotal
    FcTotal
    SysTotal
    TransCode
    OrignCurr
    TransRate
    BtfLine
    TransCurr
    Project
    DueDate
    TaxDate
    PCAddition
    FinncPriod
    DataSource
    UpdateDate
    CreateDate
    UserSign
    UserSign2
    RefndRprt
    LogInstanc
    ObjType
    Indicator
    AdjTran
    RevSource
    StornoDate
    StornoToTr
    AutoStorno
    Corisptivi
    VatDate
    StampTax
    Series
    Number
    AutoVAT
    DocSeries
    FolioPref
    FolioNum
    CreateTime
    BlockDunn
    ReportEU
    Report347
    Printed
    DocType
    AttNum
    GenRegNo
    RG23APart2
    RG23CPart2
    MatType
    Creator
    Approver
    Location
    SeqCode
    Serial
    SeriesStr
    SubStr
    AutoWT
    WTSum
    WTSumSC
    WTSumFC
    WTApplied
    WTAppliedS
    WTAppliedF
    BaseAmnt
    BaseAmntSC
    BaseAmntFC
    BaseVtAt
    BaseVtAtSC
    BaseVtAtFC
    VersionNum
    BaseTrans
    ResidenNum
    OperatCode
    Ref3
    SSIExmpt
    SignMsg
    SignDigest
    CertifNum
    KeyVersion
    CUP
    CIG
    SupplCode
    SPSrcType
    SPSrcID
    SPSrcDLN
    DeferedTax
    AgrNo
    SeqNum
    ECDPosTyp
    RptPeriod
    RptMonth
    U_BType
    U_CLIST
    NULL
    3285
    O
    13
    1328
    2014-08-10 00:00:00.000
    A/R Invoices - AFR100
    1328
    1328
    900.000000
    900.000000
    900.000000
    NULL
    NULL
    0.000000
    NULL
    USD
    NULL
    2014-08-10 00:00:00.000
    2014-08-10 00:00:00.000
    N
    104
    I
    2014-08-10 00:00:00.000
    2014-08-10 00:00:00.000
    1
    1
    N
    0
    30
    NULL
    N
    N
    NULL
    NULL
    N
    N
    NULL
    N
    17
    3285
    N
    4
    NULL
    NULL
    944
    N
    N
    N
    N
    NULL
    0
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    9.02.003.11
    NULL
    1
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    N
    NULL
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    3286
    O
    24
    1375
    2014-08-10 00:00:00.000
    Incoming Payments - AFR100
    1375
    1375
    900.000000
    900.000000
    900.000000
    NULL
    NULL
    0.000000
    NULL
    USD
    NULL
    2014-08-10 00:00:00.000
    2014-08-10 00:00:00.000
    N
    104
    I
    2014-08-10 00:00:00.000
    2014-08-10 00:00:00.000
    1
    1
    N
    0
    30
    NULL
    N
    N
    NULL
    NULL
    N
    N
    NULL
    N
    17
    3286
    N
    15
    NULL
    NULL
    945
    N
    N
    N
    N
    NULL
    0
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    9.02.003.11
    NULL
    1
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    N
    NULL
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    Table JDT1:
    TransId
    Line_ID
    Account
    Debit
    Credit
    SYSCred
    SYSDeb
    FCDebit
    FCCredit
    FCCurrency
    DueDate
    SourceID
    SourceLine
    ShortName
    IntrnMatch
    ExtrMatch
    ContraAct
    LineMemo
    Ref3Line
    TransType
    RefDate
    Ref2Date
    Ref1
    Ref2
    CreatedBy
    BaseRef
    Project
    TransCode
    ProfitCode
    TaxDate
    SystemRate
    MthDate
    ToMthSum
    UserSign
    BatchNum
    FinncPriod
    RelTransId
    RelLineID
    RelType
    LogInstanc
    VatGroup
    BaseSum
    VatRate
    Indicator
    AdjTran
    RevSource
    ObjType
    VatDate
    PaymentRef
    SYSBaseSum
    MultMatch
    VatLine
    VatAmount
    SYSVatSum
    Closed
    GrossValue
    CheckAbs
    LineType
    DebCred
    SequenceNr
    StornoAcc
    BalDueDeb
    BalDueCred
    BalFcDeb
    BalFcCred
    BalScDeb
    BalScCred
    IsNet
    DunWizBlck
    DunnLevel
    DunDate
    TaxType
    TaxPostAcc
    StaCode
    StaType
    TaxCode
    ValidFrom
    GrossValFc
    LvlUpdDate
    OcrCode2
    OcrCode3
    OcrCode4
    OcrCode5
    MIEntry
    MIVEntry
    ClsInTP
    CenVatCom
    MatType
    PstngType
    ValidFrom2
    ValidFrom3
    ValidFrom4
    ValidFrom5
    Location
    WTaxCode
    EquVatRate
    EquVatSum
    SYSEquSum
    TotalVat
    SYSTVat
    WTLiable
    WTLine
    WTApplied
    WTAppliedS
    WTAppliedF
    WTSum
    WTSumFC
    WTSumSC
    PayBlock
    PayBlckRef
    LicTradNum
    InterimTyp
    DprId
    MatchRef
    Ordered
    CUP
    CIG
    BPLId
    BPLName
    VatRegNum
    SLEDGERF
    U_CLIST
    3285
    0
    100200200100000
    900.000000
    0.000000
    0.000000
    900.000000
    900.000000
    0.000000
    USD
    2014-08-10 00:00:00.000
    1328
    1
    AFR100
    0
    0
    400100100300000
    A/R Invoices - AFR100
    1
    13
    2014-08-10 00:00:00.000
    NULL
    1328
    1328
    1328
    NULL
    2014-08-10 00:00:00.000
    0.000000
    NULL
    0.000000
    1
    NULL
    104
    -1
    -1
    N
    0
    NULL
    0.000000
    0.000000
    N
    N
    30
    NULL
    0.000000
    0
    N
    0.000000
    0.000000
    N
    0.000000
    NULL
    3
    D
    0
    NULL
    900.000000
    0.000000
    900.000000
    0.000000
    900.000000
    0.000000
    Y
    N
    0
    NULL
    0
    N
    NULL
    NULL
    NULL
    1900-01-01 00:00:00.000
    0.000000
    NULL
    0
    0
    0
    -1
    -1
    0
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    NULL
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    NULL
    NULL
    0
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    3285
    1
    200100200900000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    USD
    2014-08-10 00:00:00.000
    1328
    -2
    200100200900000
    0
    0
    AFR100
    A/R Invoices - AFR100
    13
    2014-08-10 00:00:00.000
    NULL
    1328
    1328
    1328
    NULL
    2014-08-10 00:00:00.000
    0.000000
    NULL
    0.000000
    1
    NULL
    104
    -1
    -1
    N
    0
    X0
    900.000000
    0.000000
    N
    N
    30
    NULL
    900.000000
    0
    Y
    0.000000
    0.000000
    N
    0.000000
    NULL
    3
    C
    0
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    Y
    N
    0
    NULL
    0
    N
    NULL
    NULL
    NULL
    1900-01-01 00:00:00.000
    0.000000
    NULL
    0
    0
    0
    -1
    -1
    0
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    NULL
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    NULL
    NULL
    0
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    3285
    2
    400100100300000
    0.000000
    900.000000
    900.000000
    0.000000
    0.000000
    900.000000
    USD
    2014-08-10 00:00:00.000
    NULL
    NULL
    400100100300000
    0
    0
    AFR100
    A/R Invoices - AFR100
    13
    2014-08-10 00:00:00.000
    NULL
    1328
    1328
    1328
    NULL
    2014-08-10 00:00:00.000
    0.000000
    NULL
    0.000000
    1
    NULL
    104
    -1
    -1
    N
    0
    NULL
    0.000000
    0.000000
    N
    N
    30
    NULL
    0.000000
    0
    N
    0.000000
    0.000000
    N
    0.000000
    NULL
    3
    C
    0
    NULL
    0.000000
    900.000000
    0.000000
    900.000000
    0.000000
    900.000000
    Y
    N
    0
    NULL
    0
    N
    NULL
    NULL
    NULL
    1900-01-01 00:00:00.000
    0.000000
    NULL
    0
    0
    0
    -1
    -1
    0
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    NULL
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    NULL
    NULL
    0
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    3285
    3
    100200100100200
    0.000000
    891.710000
    891.710000
    0.000000
    0.000000
    891.710000
    USD
    2014-08-10 00:00:00.000
    NULL
    NULL
    100200100100200
    0
    0
    AFR100
    A/R Invoices - AFR100
    13
    2014-08-10 00:00:00.000
    NULL
    1328
    1328
    1328
    NULL
    2014-08-10 00:00:00.000
    0.000000
    NULL
    0.000000
    1
    NULL
    104
    -1
    -1
    N
    0
    NULL
    0.000000
    0.000000
    N
    N
    30
    NULL
    0.000000
    0
    N
    0.000000
    0.000000
    N
    0.000000
    NULL
    3
    C
    0
    NULL
    0.000000
    891.710000
    0.000000
    891.710000
    0.000000
    891.710000
    Y
    N
    0
    NULL
    0
    N
    NULL
    NULL
    NULL
    1900-01-01 00:00:00.000
    0.000000
    NULL
    0
    0
    0
    -1
    -1
    0
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    NULL
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    NULL
    NULL
    0
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    3285
    4
    500100100700000
    891.710000
    0.000000
    0.000000
    891.710000
    891.710000
    0.000000
    USD
    2014-08-10 00:00:00.000
    NULL
    NULL
    500100100700000
    0
    0
    AFR100
    A/R Invoices - AFR100
    13
    2014-08-10 00:00:00.000
    NULL
    1328
    1328
    1328
    NULL
    2014-08-10 00:00:00.000
    0.000000
    NULL
    0.000000
    1
    NULL
    104
    -1
    -1
    N
    0
    NULL
    0.000000
    0.000000
    N
    N
    30
    NULL
    0.000000
    0
    N
    0.000000
    0.000000
    N
    0.000000
    NULL
    3
    D
    0
    NULL
    891.710000
    0.000000
    891.710000
    0.000000
    891.710000
    0.000000
    Y
    N
    0
    NULL
    0
    N
    NULL
    NULL
    NULL
    1900-01-01 00:00:00.000
    0.000000
    NULL
    0
    0
    0
    -1
    -1
    0
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    NULL
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    NULL
    NULL
    0
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    3286
    0
    100200500100500
    900.000000
    0.000000
    0.000000
    900.000000
    900.000000
    0.000000
    USD
    2014-08-10 00:00:00.000
    1375
    -1
    100200500100500
    0
    0
    AFR100
    Incoming Payments - AFR100
    NULL
    24
    2014-08-10 00:00:00.000
    NULL
    1375
    1375
    1375
    NULL
    NULL
    2014-08-10 00:00:00.000
    0.000000
    NULL
    0.000000
    1
    NULL
    104
    -1
    -1
    N
    0
    NULL
    0.000000
    0.000000
    NULL
    N
    N
    30
    NULL
    NULL
    0.000000
    0
    N
    0.000000
    0.000000
    N
    0.000000
    NULL
    0
    D
    0
    NULL
    900.000000
    0.000000
    900.000000
    0.000000
    900.000000
    0.000000
    Y
    N
    0
    NULL
    0
    N
    NULL
    NULL
    NULL
    1900-01-01 00:00:00.000
    0.000000
    NULL
    NULL
    NULL
    NULL
    NULL
    0
    0
    0
    -1
    -1
    0
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    NULL
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    NULL
    NULL
    0
    NULL
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    3286
    1
    100200200100000
    0.000000
    900.000000
    900.000000
    0.000000
    0.000000
    900.000000
    USD
    2014-08-10 00:00:00.000
    NULL
    -99
    AFR100
    0
    0
    100200500100500
    Incoming Payments - AFR100
    1375
    24
    2014-08-10 00:00:00.000
    NULL
    1375
    1375
    1375
    NULL
    NULL
    2014-08-10 00:00:00.000
    0.000000
    NULL
    0.000000
    1
    NULL
    104
    -1
    -1
    N
    0
    NULL
    0.000000
    0.000000
    NULL
    N
    N
    30
    NULL
    NULL
    0.000000
    0
    N
    0.000000
    0.000000
    N
    0.000000
    NULL
    0
    C
    0
    NULL
    0.000000
    900.000000
    0.000000
    900.000000
    0.000000
    900.000000
    Y
    N
    0
    NULL
    0
    N
    NULL
    NULL
    NULL
    1900-01-01 00:00:00.000
    0.000000
    NULL
    NULL
    NULL
    NULL
    NULL
    0
    0
    0
    -1
    -1
    0
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    1900-01-01 00:00:00.000
    NULL
    NULL
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    N
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    0.000000
    N
    NULL
    NULL
    0
    NULL
    NULL
    N
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    NULL
    But when I try the same in SDK/DI (oCmpSrv previously set),  I get "Internal Error (-5002) occurred":
            Try
                Dim ExtReconSvc As SAPbobsCOM.ExternalReconciliationsService = oCmpSrv.GetBusinessService(SAPbobsCOM.ServiceTypes.ExternalReconciliationsService)
                Dim ExtReconciliation As SAPbobsCOM.ExternalReconciliation = ExtReconSvc.GetDataInterface(SAPbobsCOM.ExternalReconciliationsServiceDataInterfaces.ersExternalReconciliation)
                ExtReconciliation.ReconciliationAccountType = SAPbobsCOM.ReconciliationAccountTypeEnum.rat_BusinessPartner
                Dim jeLine1 As SAPbobsCOM.ReconciliationJournalEntryLine = ExtReconciliation.ReconciliationJournalEntryLines.Add()
                jeLine1.TransactionNumber = "3285"
                jeLine1.LineNumber = 0
                Dim jeLine2 As SAPbobsCOM.ReconciliationJournalEntryLine = ExtReconciliation.ReconciliationJournalEntryLines.Add()
                jeLine2.TransactionNumber = "3286"
                jeLine2.LineNumber = 1
                ExtReconSvc.Reconcile(ExtReconciliation)
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
    I do not understand what I am doing wrong and I have no idea what this error means.
    Thanks in advance for your help.

    Sorry Images were very poor in original post.

  • Internal error (-5002) occured during sap B1 version updation

    Dear Experts
    Internal error (-5002) occured during sap B1 version updation from SAP B1 2007B to SAP B1 8.8
    Please help
    S K Jana

    Hello
    You may take a look into the upgrade log file:
    C:Program FilesSAPSAP Business OneLog directory,
    filename should be
    B1UpgradePid[xxxx]_[YYYMMHH.....].txt
    You can find information inside !
    If the upgrade failed, please check this file, look for notes, or report the issue to GSC.
    Regards
    János

  • Getting Error- Internal error (-5002).

    Hi
         While trying to add Invoice through DIAPI, i am getting the above mentioned Error -> Internal error (-5002). I am using SAP 8.8 version.
    Please help me to solve the issue..
    Thanking you in Advance...
    Hari

    We have an add-on in SAP used for Project Management. As a part of that add-on, we create A/R Invoices, A/P Invoices, and Journal Entries through the DI. This application works perfectly in SAP 2007. We are in the process of converting the application to SAP 8.8 and are encountering the same error message when we try to post any document to SAP through the DI. We put together a small sample application that tried to create an A/R Invoice passing just the minimum requirements (CardCode on header, ItemCode on line) and even that test is encountering the -5002 error on attempt to Add document.
    We are attempting to determine if the issue is on our Server or if the issue is in the DI. We are aware of issues in the SAP 88 DI that don't work the way they did in the SAP 2007 DI (Dataflush, which SAP has acknowledged will be re-fixed in a higher Patch level than we are running (5) but we aren't sure if anyone else has experienced Document Posting issues.

  • SDK Error -5002 when adding a sales order

    I'm getting an error -5002 when adding a sales order.
    Source code:
          IDocuments m_so2 = SBOCOMUtil.newDocuments(icmp, SBOCOMConstants.BoObjectTypes_Document_oOrders);
          line = m_so2.getLines();
          m_so2.setCardCode("2173231916");
          m_so2.setCardName("test Sales order");
          SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy");
          Date today = Calendar.getInstance().getTime();
          m_so2.setDocDueDate(today);
          line.setItemCode("01005");
          line.setDiscountPercent(new Double(10));
          line.setItemDescription("description Testing");
          line.setQuantity(new Double(3));
          line.setTaxCode("0");
          line.add();
          long rc = m_so2.add();
    Question:
    Where can I find a list of error codes that can be easy to understand? PDF, word, etc.
    Thanks.

    Hi Diego,
    Looking at your code I see that you are doing a
    line.add();
    You don’t need to have this here unless you are adding another line to your document.
    Maybe this will help you.
    Also just because java is a bit different from VB get the last error message using
    SBOErrorMessage errMsg= comp.getLastError();
    System.out.println(errMsg.getErrorMessage());
    -Cormac

  • Exception : DI Error: (-5002) At least one amount is required in document rows

    Trying to create a MaterialRevaulation object. doesn't matter what I am using I can getting this error message "Exception : DI Error: (-5002) At least one amount is required in document rows"
    Formate of payload looks like 
    <Payload Role="X" id="atom1">
    - <MaterialRevaluation xmlns=""> 
    - <row> 
    <RevalType>P</RevalType>  
    <DocDate>20140701</DocDate>  
    <JournalMemo>Inventory Revaluation</JournalMemo>  
    <InflationRevaluation>tNO</InflationRevaluation>  
    </row>
    </MaterialRevaluation>
    - <MaterialRevulation_Lines xmlns=""> 
    - <row> 
    <LineNum>0</LineNum>  
    <ItemCode>Item1</ItemCode>  
    <WarehouseCode>WH1</WarehouseCode>  
    <Price>14.973030</Price>  
    </row>
    - <row> 
    <LineNum>1</LineNum>  
    <ItemCode>Item2</ItemCode>  
    <WarehouseCode>WH1</WarehouseCode>  
    <Price>15.973030</Price>  
    </row>
    - <row> 
    <LineNum>2</LineNum>  
    <ItemCode>Item3</ItemCode>  
    <WarehouseCode>WH1</WarehouseCode>  
    <Price>13.973030</Price>  
    </row>
    </MaterialRevulation_Lines>
    </Payload>
    And my SBO object call looks like this
    <Payload Role="C" id="atom2" system="0010000102" status="success" b1login="Technical User" method="Synchronous Insert with fallback to Update" objectid="162" payload="atom1" keyname="" keyvalue="" DIresult="failure" DImsg="Exception : DI Error: (-5002) At least one amount is required in document rows" />
    I don't think I need to put anything in KeyName or Keyvalue. Since I am insert.
    But it looks like it is not even look at the XML changes. I have tried to with no change
    1. Add BOM/BO admin structure
    2. Rouding price difference (from 0 decimla ot 6)
    3. Put in Quantity
    4. Add LineNum
    5.Change Item
    6.Change WHS
    Running out of ideas!! Any help will be appreciated. Thank You!

    Successful format looks like this
    Strange enough, and I still don't know why. Certain item in combination give me the error message. If I break it out to individual document. Then it give me the proper error message. But if it bundled with number of item together then it become this at least one amount is needed at document row error message.
    <BOM xmlns="">
    <BO>
    <AdmInfo>
    <Object>162</Object>
    <Version>2</Version>
    </AdmInfo>
    <MaterialRevaluation>
    <row>
    <DocDate>20140702</DocDate>
    <RevalType>P</RevalType>
    </row>
    </MaterialRevaluation>
    <MaterialRevaluation_lines>
    <row>
    <ItemCode>ITEM1</ItemCode>
    <WarehouseCode>WH1</WarehouseCode>
    <Price>14.587</Price>
    </row>
    </MaterialRevaluation_lines>
    </BO>
    </BOM>

  • Creating CreditNote throw  Internal error -5002

    Hi experts,
    I have a problem creating CreditNote via DI.
    thorw error: "Returncode: -5002:: Se produjo un error interno (-5002)"  (internal error)
    Anybody could help me? Its extrange this error because the same code had work fine times ago
    My code is:
    oAbono.CardCode = oDev.CardCode
                        oAbono.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
                        oAbono.DocObjectCode = SAPbobsCOM.BoObjectTypes.oInvoices
                        oAbono.DocumentSubType = SAPbobsCOM.BoDocumentSubType.bod_None
                        oAbono.DocDate = oDev.DocDate
                        oAbono.SalesPersonCode = oDev.SalesPersonCode
                        'amm 20081014 forzar % a cero oAbono.DiscountPercent = oDev.DiscountPercent
                        oAbono.Comments = "Viene del albarán: " + oDev.DocNum.ToString
                        oAbono.UserFields.Fields.Item("U_FGIMAR").Value = oDev.UserFields.Fields.Item("U_FGIMAR").Value
                        oAbono.UserFields.Fields.Item("U_FGIDEMAR").Value = oDev.UserFields.Fields.Item("U_FGIDEMAR").Value
                        oAbono.UserFields.Fields.Item("U_FGIName2").Value = oDev.UserFields.Fields.Item("U_FGIName2").Value
                        strProducto = "Select [U_FGIVIAB] as Via, [U_FGICONB] as Cond from [@FGIPAR]"
                        orecordset.DoQuery(strProducto)
                        oAbono.PaymentMethod = orecordset.Fields.Item("Via").Value
                        oAbono.PaymentGroupCode = orecordset.Fields.Item("Cond").Value
                        oAbono.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO
                        'Linea de factura
                        oAbono.Lines.SetCurrentLine(0)
                        strProducto = "Select [U_FGIPRD] as Prod, [U_FGIPRD1] as Prod1,[U_FGIPRD2] as Prod2, [U_FGIPRD3] as Prod3 from [@FGIPAR]"
                        orecordset.DoQuery(strProducto)
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "101" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "103" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod1").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "104" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod2").Value.ToString
                        End If
                        If oDev.UserFields.Fields.Item("U_FGIMAR").Value = "102" Then
                            oAbono.Lines.ItemCode = orecordset.Fields.Item("Prod3").Value.ToString
                        End If
                        strIva = "Select [U_FGIIVAR] as Iva from [@FGIPAR]"
                        orecordset.DoQuery(strIva)
                        oAbono.Lines.VatGroup = orecordset.Fields.Item("Iva").Value.ToString
                        ' Para los albaranes  tomamos el total del albarán.
                        oAbono.Lines.Quantity = 1
                        Dim precio As Double
                        precio = (oDev.DocTotal - oDev.VatSum)
                        Dim neto As Double
                        neto = precio
                        oAbono.Lines.Price = CDbl(neto)
                        lRetCode = oAbono.Add()
                        If lRetCode <> 0 Then
                            vCompany.GetLastError(lErrCode, sErrMsg)
                            GuardarLog("InsertarOfertaEspecialAbono: Failedu2026; Returncode: " + CStr(lErrCode) + ":: " + sErrMsg)
                            Return False
                        End If

    Solved problem!.
    The Origin of then problem is a PaymentMethod.
    My AddOn set PaymentMethod ='C' and this paymentMethod is not set in BP Card.
    I hope this trhead would be useful for the future for another person
    Regards

  • Internal Error -5000 while Adding a PODeliveryNote Document using DI

    Hello friends:
    I am getting an Internal -5000 error while trying to upload a PODeliveryNote (Goods Receipt) into Business One using SDK. The description of error just says Internal Error - so I really cannot understand what's going on. Any help will be appreciated.
    Here is the part of the code that is running into this error:
       Private Sub LoadObjectsFromXML()
            Dim sXmlFileName As String
            Dim iElementCount As Long
            Dim iCounter As Long
            '// setting the file name
            sXmlFileName = "C:\SAP2HJXMLData\Upload\NewPODelivery.xml"
            '// Get the number of Business object in the file ...
            iElementCount = oCompany.GetXMLelementCount(sXmlFileName)
            MsgBox(iElementCount & " Elemnts found in xml file" & vbNewLine & "Ready To Start Transaction")
            '// start a transaction
            oCompany.StartTransaction()
            '// Run a loop through the objects and when with in the file
            '// and the objects to the DB
            For iCounter = 0 To iElementCount - 1
                '// get the objects type at the specified position
                oCompany.XmlExportType = SAPbobsCOM.BoXmlExportTypes.xet_ExportImportMode
                '// get the business object data from the file
                oDocument = oCompany.GetBusinessObjectFromXML(sXmlFileName, iCounter)
                '// add the object to the data base
                oDocument.Add()
                '// Check for errors during connect
                oCompany.GetLastError(lErrCode, sErrMsg)
                If lErrCode <> 0 Then
                    MsgBox("Error: " & lErrCode & " - " & sErrMsg & vbNewLine & "Transaction will be rolled back")
                    oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                    Exit Sub
                End If
            Next iCounter
            '// Commit Transaction
            oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
            MsgBox("Data inserted successfully")
        End Sub
    Following is the XML that we are trying to post. There is a corresponding PO open.
      <?xml version="1.0" encoding="utf-16" ?>
    - <BOM>
    - <BO>
    - <AdmInfo>
      <Object>20</Object>
      <Version>2</Version>
      </AdmInfo>
    - <Documents>
    - <row>
      <DocNum />
      <DocType>dDocument_Items</DocType>
      <HandWritten>tNO</HandWritten>
      <Printed>tNO</Printed>
      <DocDate>20071224</DocDate>
      <DocDueDate>20071224</DocDueDate>
      <CardCode>V30000</CardCode>
      <CardName />
      <Address />
      <DocCurrency />
      <DocRate />
      <DocTotal />
      <Reference1 />
      <Comments>This was received in SAP</Comments>
      <JournalMemo />
      <PaymentGroupCode />
      <DocTime />
      <SalesPersonCode />
      <Confirmed>tYES</Confirmed>
      <ImportFileNum />
      <SummeryType>dNoSummary</SummeryType>
      <ContactPersonCode />
      <ShowSCN>tNO</ShowSCN>
      <Series />
      <TaxDate>20071224</TaxDate>
      <PartialSupply>tYES</PartialSupply>
      <DocObjectCode />
      <DiscountPercent />
      <RevisionPo>tNO</RevisionPo>
      <BlockDunning>tNO</BlockDunning>
      <Pick>tNO</Pick>
      <PaymentMethod />
      <PaymentBlock>tNO</PaymentBlock>
      <MaximumCashDiscount>tNO</MaximumCashDiscount>
      <WareHouseUpdateType>dwh_Stock</WareHouseUpdateType>
      <Rounding>tNO</Rounding>
      <DeferredTax>tNO</DeferredTax>
      <NumberOfInstallments />
      <ApplyTaxOnFirstInstallment>tNO</ApplyTaxOnFirstInstallment>
      <DocumentsOwner>3</DocumentsOwner>
      <DocumentSubType>bod_None</DocumentSubType>
      <Address2 />
      <PayToCode />
      <UseShpdGoodsAct>tNO</UseShpdGoodsAct>
      <IsPayToBank>tNO</IsPayToBank>
      <DownPayment />
      <LanguageCode>3</LanguageCode>
      <PickRemark />
      <SequenceModel>0</SequenceModel>
      <UseCorrectionVATGroup>tNO</UseCorrectionVATGroup>
      <VatPercent />
      </row>
      </Documents>
    - <Document_Lines>
    - <row>
      <LineNum>0</LineNum>
      <ItemCode>A00004</ItemCode>
      <ItemDescription />
      <Quantity>3.000000</Quantity>
      <ShipDate>20071224</ShipDate>
      <Price />
      <PriceAfterVAT />
      <Currency />
      <Rate />
      <DiscountPercent />
      <VendorNum />
      <WarehouseCode>01</WarehouseCode>
      <SalesPersonCode />
      <CommisionPercent />
      <TreeType>iNotATree</TreeType>
      <AccountCode />
      <UseBaseUnits>tNO</UseBaseUnits>
      <SupplierCatNum />
      <CostingCode />
      <ProjectCode />
      <BarCode />
      <VatGroup />
      <Height1 />
      <Height2 />
      <Lengh1 />
      <Lengh2 />
      <Weight1 />
      <Weight2 />
      <Factor1 />
      <Factor2 />
      <Factor3 />
      <Factor4 />
      <BaseType />
      <BaseEntry>6</BaseEntry>
      <BaseLine>0</BaseLine>
      <Volume />
      <VolumeUnit />
      <Width1 />
      <Width2 />
      <Address />
      <TaxCode>0</TaxCode>
      <TaxType>tt_Yes</TaxType>
      <TaxLiable>tYES</TaxLiable>
      <ShippingMethod />
      <CorrectionInvoiceItem>ciis_ShouldBe</CorrectionInvoiceItem>
      <CorrInvAmountToStock />
      <CorrInvAmountToDiffAcct />
      <WTLiable>tNO</WTLiable>
      <DeferredTax>tNO</DeferredTax>
      <NetTaxAmount />
      <NetTaxAmountFC />
      <LineTotal />
      <TaxPercentagePerRow />
      <ConsumerSalesForecast>tNO</ConsumerSalesForecast>
      <ExciseAmount />
      <SWW />
      <DistributeExpense>tYES</DistributeExpense>
      <ShipToCode />
      <RowTotalFC />
      <TaxOnly>tNO</TaxOnly>
      <UnitPrice />
      <LineStatus>bost_Open</LineStatus>
      <LineType>dlt_Regular</LineType>
      <ChangeAssemlyBoMWarehouse />
      </row>
      </Document_Lines>
      </BO>
      </BOM>
    Thank you.
    Kushal Dutta.

    OK - I figured this one out. Bottom line, I was leaving several fields unpopulated, expecting SAP to populate the data. That was not working. I had to populate more fields to make it working.
    Thanks.
    Kushal.

  • Internal error 5002 while DI api stock transfer ?

    Hi Expert,
       I am Getting the error Code -5002  While DI API Stock transfer Add Method.
      but One thing  this error does not occur in demo Company , But Occur in the Company  that i have Created ...
    Do some Specific  Functional  set required or other issue  in it .
    Regards,
    Mayank Shah

    Hi Mayank,
    I haven't done this thing practically but error -5002 will occur, if there is any Invalid Object.
    You can check it accordingly.
    Hope it helps.
    Thanks & Regards
    Ankit Chauhan

  • Internal error 7780 after adding 5 invoices.

    Dear all,
    SAP BO 9.0 PL09HF01, SQL2012,
    When user add 4 - 5 invoices to SAP, SAP client returns error
    Internal error-7780 message 131-1883
    and user have to close SAP client.
    What can be root cause? How to solve this?
    regards
    GN

    Hello
    Please check below link
    Internal error - 7780
    Thanks & Regards
    Pankaj Jha

  • Internal Error -5002

    I always get this error when i want to create a delivery note document after a order document.
    but, it is funny only when i want to add a special item, an item for which i didn't have had a goods receipt, because it isn't an inventory item.
    code:
    while (reader.Read())
                        oDelivery.Lines.ItemCode = reader[0].ToString();
                        oDelivery.Lines.Price = Convert.ToDouble(reader[1].ToString());
                        oDelivery.Lines.VatGroup = reader[2].ToString();
                        oDelivery.Lines.BaseEntry = oOrder.DocEntry;
                        oDelivery.Lines.BaseLine = Convert.ToInt32(reader[3].ToString());
                        oOrder.Lines.SetCurrentLine(Convert.ToInt32(reader[3].ToString()));
                            oOrder.Lines.LineStatus = BoStatus.bost_Close;
                        oDelivery.Lines.Quantity = Convert.ToDouble(reader[4].ToString());
                        oDelivery.Lines.Add();
    when i use this loop, then i get the error message after oDeliver.add()
    what could it be?

    Philipp,
    German:
    Hallo Landsmann
    was mir an dem ganzen nicht gefällt ist das Du
    oDelivery.Lines.Add(); zum Schluß hast.
    das heisst das Du zu letzte ja Praktisch eine letzte leere Zeile hast.
    ich hatte damit oft probleme.
    besser Du machst einen abfrage im kopf und schaust nach
    if zeile > 1 then
       oDelivery.Lines.Add();
    end if
    damit wird bei der ersten zeile nicht hinzugefügt und es gibt keine letzte leere zeile.
    nur ein Tipp ...
    könnte helfen
    English:
    i just wrote that i don't like oDelivery.Lines.Add(); at the end - causes an empty line
    lg David

  • Error in e-commerece The text for the sales document TA RU lacking in langu

    Hi GUYS,
    I am having a e commerce scenario.
    I have done all the settings related to it. When I login with a user in EN language, and try creating a sales order ,I am able to create in e commerce.
    I have created another user with login in russian language.When I try to create a order in front end I am getting the error:
    The text for the sales document TA RU lacking in language.
    Please suggest if I have to maintain any setting specific to RU language in R/3.
    Thanks and regards,
    Nilesh

    Hi
    Please maintain the language for that sales document type using the following path...
    IMG(SPRO) - Sales and Distribution - Sales - Sales Documents - Sales Document Header - Convert Language for each Sales document type - execute and maintain the entries using 'New Entries' tab.
    Thanks,
    Ravi

Maybe you are looking for

  • ITunes 9 crashes when connecting to store

    iTunes 9 is not functioning at all. The problem seems to be linked to something called webkit.dll?? Safari 4 has the same problem. At this point, iTunes is unusable.

  • LaserJet pro 200 color MFP M276nw - Scan setup and installation on Mac Yosemite

    Hi all,  I just bought a new LaserJet pro 200 color MFP M276nw and I'm trying (since 4 days) to coorectly install it. My target would be to use it through the wifi connection and I correctly set it by the front panel. When I try to install the printe

  • N96 Bugs I've noticed

    Generally pleased with my new N96 which replaces my ageing N95 but i have noticed two bugs. I am using a simfree, nokia shop purchased N96 update to SW v11.101.098.1. BUG 1: I've imported my contacts from my N95 and i cannot set defaults for email ad

  • Color Profiles Not Showing Up in Aperture 3

    So, I use WHCC for my lab. They supply printer profiles. So far so good. I have put these profiles in both the system and user ColorSync Profiles folder. These profiles show up in my Color Sync Utility but they don't show up in Aperture?? Now what? T

  • Why do we use Map.Entry ?

    I have this example of mine where am able to do everything using the entrySet() method, hence I dont see any use of Map.Entry. public class HashMapDemo {      public static void main ( String args [])                   HashMap hm = new HashMap();