Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Feb 09, 2017 at 04:35 AM

    Hi,

    For AP invoice object type is 18 not 20.

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 09, 2017 at 04:35 AM

    Hi,

    For AP invoice object type is 18 not 20.

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 09, 2017 at 10:48 AM

    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

    Add comment
    10|10000 characters needed characters exceeded