cancel
Showing results for 
Search instead for 
Did you mean: 

AP Invoice Value is greater than PO value (Service Type)

Former Member
0 Kudos

Hi,

Would like to seek your advise on following scenario.

I would like to block the total amount in AP Invoice is greater than PO SUM(OPEN amount). As 1 PO = Many Invoice.

I have done the coding to restrict in SP_Transaction.

can anyone of you help me to take alook on the code, it's not working perfectly, what is the issue?

IF @transaction_type IN(N'A',N'U')AND

(@Object_type =N'20')

BEGIN

IFEXISTS(SELECT T1.BaseEntry FROM dbo.OPCH T0

INNERJOIN dbo.PCH1 T1 ON T1.DOCENTRY = T0.DocEntry

INNERJOIN dbo.POR1 T2 ON T2.DOCENTRY = T1.BaseEntry

WHERE T1.BaseType = 22 AND

T1.BaseLine = T2.LineNum AND

T0.DOCENTRY = @list_of_cols_val_tab_del

GROUPBY T1.BaseEntry

HAVINGSUM(T1.OpenSumSys+(T1.OpenSumSys*1.07))>SUM(T2.TotalSumSy))

Begin

SELECT @Error = 10, @error_message ='AP INV Total Amount is greater than PO Open Amount'

End

END

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

Agreed with Nagarajan Object Type for A/P Invoice is 18. See the following link for Object Types

https://blogs.sap.com/2013/07/09/sap-business-one-form-types-and-object-types/

Thanks

Engr. Taseeb Saeed

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

For AP invoice object type is 18 not 20.

Regards,

Nagarajan

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

For AP invoice object type is 18 not 20.

Regards,

Nagarajan