Hi everyone,
I'm trying to add an incomint payment by B1WS but I can not
The error is:
Base document card and target document card do not match. [RCT2.DocLine][line: 1]
the code is:
oPayment = New WCF_SCI.IncomingPaymentsServiceWebRef.Payment
' fill Documents class
WriteLog(DateTime.Now.ToString("dd"), "Rellenando cabecera cobro", enTypeMessage.sINFO)
oPayment.CardCode = oIncomingPayments.CardCode
oPayment.DocDate = Convert.ToDateTime(oIncomingPayments.DocDate)
oPayment.DocDateSpecified = True
oPayment.DueDate = Convert.ToDateTime(oIncomingPayments.DocDueDate)
oPayment.DueDateSpecified = True
oPayment.DocObjectCode = PaymentDocObjectCode.bopot_IncomingPayments
oPayment.DocObjectCodeSpecified = True
oPayment.DocType = PaymentDocType.rCustomer
oPayment.DocTypeSpecified = True
oPayment.DocTypte = PaymentDocTypte.rCustomer
oPayment.DocTypteSpecified = True
' Omplim línies amb les factures
If Not IsNothing(oIncomingPayments.Invoices) Then
Dim NumLinesDocument(oIncomingPayments.Invoices.Length - 1) As WCF_SCI.IncomingPaymentsServiceWebRef.PaymentPaymentInvoice
oPayment.PaymentInvoices = NumLinesDocument
Amount = 0
For i = 0 To oIncomingPayments.Invoices.Length - 1
' Omplim la línia
oPaymentPaymentInvoice = New WCF_SCI.IncomingPaymentsServiceWebRef.PaymentPaymentInvoice
oPaymentPaymentInvoice.DocEntry = NullToLong(oIncomingPayments.Invoices(i).DocEntry)
oPaymentPaymentInvoice.DocEntrySpecified = True
oPaymentPaymentInvoice.InvoiceType = 13
oPaymentPaymentInvoice.InvoiceTypeSpecified = True
oPaymentPaymentInvoice.DocLine = i
oPaymentPaymentInvoice.DocLineSpecified = True
oPaymentPaymentInvoice.InstallmentId = oIncomingPayments.Invoices(i).TermsNumber
oPaymentPaymentInvoice.InstallmentIdSpecified = True
oPaymentPaymentInvoice.SumApplied = oIncomingPayments.Invoices(i).Amount
oPaymentPaymentInvoice.SumAppliedSpecified = True
' Anem guardant l'import
Amount += oIncomingPayments.Invoices(i).Amount
'
oPayment.PaymentInvoices.SetValue(oPaymentPaymentInvoice, i)
'
Next
End If
'
Select Case oIncomingPayments.PaymentType
Case BoPaymentType.pCash
oPayment.CashAccount = oIncomingPayments.Account
oPayment.CashSum = Amount
oPayment.CashSumSpecified = True
Case BoPaymentType.pTransfer
oPayment.TransferAccount = oIncomingPayments.Account
oPayment.TransferSum = Amount
oPayment.TransferSumSpecified = True
End Select
' service command call
WriteLog(DateTime.Now.ToString("dd"), "Añadiendo el cobro", enTypeMessage.sINFO)
oPaymentParams = oInvoicesService.Add(oPayment)
Then I've tried to add by DI Server.
First, I had the object by:
sCmdXML = "<?xml version=""1.0"" encoding=""UTF-16""?>" & _
"<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
"<env:Header>" & _
"<SessionID>" & CStr(sSessionID) & "</SessionID>" & _
"</env:Header><env:Body><dis:GetBusinessObjectTemplate xmlns:dis=""http://www.sap.com/SBO/DIS"">" & _
"<Object>" + idObject + "</Object>" & _
"</dis:GetBusinessObjectTemplate></env:Body></env:Envelope>"
And the error is:
Data 'Document' not found
Finally, I've tried like here but i receive the same error:
Data 'Document' not found
I'm developing with SBO9.
If anyone knows anything... Thanks