Skip to Content
0
Former Member
Jul 19, 2010 at 09:29 AM

Incoming Payments in DI

1464 Views

Dear Experts,

The following is the scenario,

say i have 2 invoices of the same customer one for 2000 and another for -2000, Now i'm making an incomming paymnet for both of these things.... in SAP UI when i select these 2 invoices i cannot add a payment with 0 amount, so i just add 0.1 as the payment and add the payment doc.

Now when i do the same in DI its not accepting. The following is the code..

Dim oPymt As SAPbobsCOM.Payments
        Dim totalPayment As Double

        totalPayment = TextBox5.Text
        oPymt = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)



        oPymt.DocDate = "07/19/10"
        oPymt.CardCode = "CK0001"
        oPymt.CashSum = TextBox5.Text '15000 'TextBox2.Text '1000.0
        If TextBox5.Text <= 1 Then
            oPymt.CashAccount = "428104" '"580026"
        Else
            oPymt.CashAccount = "428104"
        End If


        oPymt.Invoices.DocEntry = "536" 'TextBox1.Text
        'MsgBox(oPymt.Invoices.PaidSu)
        'oPymt.Invoices.SumApplied = 0.25 '500 + AllocateAmount(totalPayment, TextBox1.Text, "IN") 'TextBox2.Text
        'totalPayment = totalPayment - AllocateAmount(totalPayment, TextBox1.Text, "IN")
        oPymt.Invoices.Add()

        oPymt.Invoices.DocEntry = "537" 'TextBox1.Text
        'MsgBox(oPymt.Invoices.PaidSu)
        'oPymt.Invoices.SumApplied = 0.25 '500 + AllocateAmount(totalPayment, TextBox1.Text, "IN") 'TextBox2.Text
        'totalPayment = totalPayment - AllocateAmount(totalPayment, TextBox1.Text, "IN")
        oPymt.Invoices.Add()

 oErrorInv = oPymt.Add()

But when i am adding the payment i am getting the following error. Enter Valid Code [JDT1.ContraAct]

Where am I going wrong.?

Thanks in advance.

Vasu Natari.