cancel
Showing results for 
Search instead for 
Did you mean: 

outgoing payments against journal entry-DIAPI

Former Member
0 Kudos

Hai All,

I add one outgoing payments against Journal Entry using DIAPI...but it shows a error

"Base Document card and targer document card do not match [VPM2.Docline] [line:1]"

My coding,

Dim OP As SAPbobsCOM.Payments

OP = objAddOn.objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments)

OP.DocType = SAPbobsCOM.BoRcptTypes.rCustomer

OP.CardCode = "C0000002"

OP.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_JournalEntry

OP.Invoices.DocEntry = 149

OP.CashAccount = "161000"

OP.CashSum = 9686344.75

OP.Invoices.SumApplied = 9686344.75

OP.Invoices.Add()

lretcode = OP.Add

If lretcode <> 0 Then

MsgBox(objAddOn.objCompany.GetLastErrorDescription)

'MsgBox("Error : " & objAddOn.objCompany.GetLastErrorDescription, MsgBoxStyle.Information, MIPL_Msgbox_Title1)

Exit Sub

Else

MsgBox("Added successfully")

End

Please Help me immediately...its urgent

Edited by: praveenkumar.e29 on Sep 7, 2011 4:48 PM

Edited by: praveenkumar.e29 on Sep 7, 2011 4:49 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

OP.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_JournalEntry may not be correct if you want to pay customer.

Try manually create the same outgoing payment and check VPM2 table in test environment.

Thanks,

Gordon

Former Member
0 Kudos

hi GordonDu,

Thanks for ur reply..

Please tell me for paying customer what i need to use?

but if i give this line opay.docline=1 it works sometimes...

then opay.docline=0 this line also work sometimes..

With Regards,

Praveenkumar Elangovan

Former Member
0 Kudos

If the problem is for more than one line, you have problem in adding a new line.

Former Member
0 Kudos

I am adding only one line but it shows the error

Former Member
0 Kudos

In your posting: i give this line opay.docline=1 it works sometimes... then opay.docline=0 this line also work sometimes., what do you refer to?

Former Member
0 Kudos

i use this line in coding (op.docline=1)...it works..but some times it show a error......

so i replace this line by this (op.docline=0 ) it also works..but sometimes it also shows the same error which i mentioned first..

Former Member
0 Kudos

Try DocTransId with the correct Transaction ID to pick up the right JE.