cancel
Showing results for 
Search instead for 
Did you mean: 

How create a vendor payment with cash flow ?

Former Member
0 Kudos

Dear experts,

I'm usign SBO 8.82 PL12

I want create a vendor payment with cash flow, I tried the next code (C#) but i cant get sucess (my payment was created with 0 value in cash flow field)

Note : the document and currency of payment is local, payed by automatic check.

myVendorPayment.PrimaryFormItems.SetCurrentLine(0);

myVendorPayment.AmountLC = 1000;

myVendorPayment.PrimaryFormItems.CashFlowLineItemID = 48; /* is a valid value */

myVendorPayment.PrimaryFormItems.CheckNumber = "1";

myVendorPayment.PrimaryFormItems.PaymentMeans = PaymentMeansTypeEnum.pmtChecks;

myVendorPayment.PrimaryFormItems.Add();

....Then add the payment

Also I tried without the 1rst and last line and I get no sucess.

Please help me.

Thank yo so much

Accepted Solutions (0)

Answers (1)

Answers (1)

Johan_H
Active Contributor
0 Kudos

Hi Carlos,

In this code you have set the CashFlowLineItemID, but you are not setting a value after that.

Regards,

Johan

Former Member
0 Kudos

Hello Johan,

You are right, I´ve changed my code to :

myVendorPayment.PrimaryFormItems.SetCurrentLine(0);

myVendorPayment.PrimaryFormItems.CashFlowLineItemID = 48; /* is a valid value */

myVendorPayment.PrimaryFormItems.AmountLC = 1000;

myVendorPayment.PrimaryFormItems.CheckNumber = "1";

myVendorPayment.PrimaryFormItems.PaymentMeans = PaymentMeansTypeEnum.pmtChecks;

myVendorPayment.PrimaryFormItems.Add();

But I get the same error, Could you give me an example code ?

I tried with BankTransfer (without CheckNumber) and it works fine

But my problem is with checks, I tried with CheckNumber equals to manual value specified for Payment, with 0, 1 , null (for automatic number) but i get the same error (Im paying with only one check)

Regards,

Carlos

Johan_H
Active Contributor
0 Kudos

Hi Carlos,

I am sorry, I do not have the CashFlow property / object in my version yet (8.8), so I cannot test this.

If this property / object follows the common pattern however, your code should look something like this:

myVendorPayment.PrimaryFormItems.SetCurrentLine(0);

myVendorPayment.AmountLC = 1000;

myVendorPayment.PrimaryFormItems.CashFlowLineItemID = 48; /* is a valid value */

myVendorPayment.PrimaryFormItems.CashFlowLineTotal = 1000;

myVendorPayment.PrimaryFormItems.CheckNumber = "1";

myVendorPayment.PrimaryFormItems.PaymentMeans = PaymentMeansTypeEnum.pmtChecks;

myVendorPayment.PrimaryFormItems.Add();

You will have to check if there are any such properties available, or something that sounds the same.

Regards,

Johan

Former Member
0 Kudos

Hello Johan,

The properties for amounts are : PrimaryFormItems.AmountLC and

PrimaryFormItems.AmountFC

This looks like a bug only when specifing the Cash Flow with checks (Transfer and Cash no problem)

Maybe I should send a message to SAP

Thanks anyway

Regards,

Carlos

Johan_H
Active Contributor
0 Kudos

Hi Carlos,

Actually, come to think about it, this may be system behavior ?

With cash and transfer payments you get the money right away (=cashflow). With checks you get the money later?

However, just to be on the safe side, you are right and should probably log a message.

Regards,

Johan