on 04-09-2010 9:31 AM
I write JournalVoucher with SDK,error code:5011.(SAP Business One 2005B):How to solve it,thanks.
Closed.It is reason for data,but code is correct.Thanks everyboby.
Edited by: Cheng Li on Apr 15, 2010 4:06 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Post the code so that we can take a look.... and did u use try catch block in ur code??
Vasu Natari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks,Everyone:
Code follows as:
______________________________________________________
try
CashTable = New DataTable
Dim JV As SAPbobsCOM.JournalVouchers
JV = vcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalVouchers)
JV.JournalEntries.Reference = DateTime.Parse(FromDate).ToShortDateString
JV.JournalEntries.Reference2 = DateTime.Parse(ToDate).ToShortDateString
JV.JournalEntries.Indicator = company
Dim i As Integer
Dim Bool As Boolean
For i = 0 To vTable.Rows.Count - 1
If vTable.Rows(i)(1) <> 0 Then
If i <> 0 Then
JV.JournalEntries.Lines.Add()
JV.JournalEntries.Lines.AccountCode = vTable.Rows(i)(0)
JV.JournalEntries.Lines.Debit = vTable.Rows(i)(1)
End If
If vTable.Rows(i)(2) <> 0 Then
JV.JournalEntries.Lines.Add()
JV.JournalEntries.Lines.AccountCode = vTable.Rows(i)(0) '+ company
JV.JournalEntries.Lines.Credit = vTable.Rows(i)(2)
End If
Next
iR = JV.Add()
Dim docnum As String
docnum = vcompany.GetNewObjectKey()
If iR <> 0 Then
vcompany.GetLastError(lErrCode, sErrMsg)
MessageBox.Show("错误描述:" + sErrMsg, "报表合并向导", MessageBoxButtons.OK)
Return sErrMsg
End If
Dim MsgCash As String
If AdjTran = "N" Then
MsgCash = AddCash(vTable, docnum)
Else
Call UpdateAdjTran(docnum)
End If
Return "数据导入成功," + MsgCash
Exit Function
Catch ex As Exception
Return "数据导入异常,异常描述:" + Err.Description
End Try
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.