Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3576

Re: SP for blocking PO

$
0
0

Hi Datta,

 

Please try the below.

 

IF

    @object_type = '22' AND @transaction_type IN ('A', 'U')

BEGIN

    IF

        (SELECT COUNT(POR1.ItemCode) FROM POR1 INNER JOIN OITM ON POR1.ItemCode = OITM.ItemCode WHERE POR1.DocEntry = @list_of_cols_val_tab_del AND OITM.InvntItem = 'Y') > 0

    AND

        (SELECT COUNT(POR1.ItemCode) FROM POR1 INNER JOIN OITM ON POR1.ItemCode = OITM.ItemCode WHERE POR1.DocEntry = @list_of_cols_val_tab_del AND OITM.InvntItem = 'N') > 0

            BEGIN

                SET @error = 500

                SET @error_message = 'Purchase Order includes items that are inventory and non-inventory. This is not allowed.'

            END

END

 

 

Kind Regards,

 

Nick Lakasas


Viewing all articles
Browse latest Browse all 3576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>