Skip to Content
0

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

Feb 09, 2017 at 03:33 AM

39

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Nagarajan K Feb 09, 2017 at 04:35 AM
0

Hi,

For AP invoice object type is 18 not 20.

Regards,

Nagarajan

Share
10 |10000 characters needed characters left characters exceeded
Nagarajan K Feb 09, 2017 at 04:35 AM
0

Hi,

For AP invoice object type is 18 not 20.

Regards,

Nagarajan

Share
10 |10000 characters needed characters left characters exceeded
Taseeb Saeed Feb 09, 2017 at 10:48 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded