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

Re: SP_Transaction to restrict Production Order for insufficient stock !!!

$
0
0

Hi Harshal,

 

check this

 

IF @transaction_type IN ('A','U') AND @Object_type = '202'

BEGIN

 

 

/* Stop Prd. Order if InStock less than Planned. */

IF Exists ( SELECT T1.[DocEntry],T1.[ItemCode], T1.[PlannedQty], T2.[OnHand]

FROM [dbo].[OWOR]  T0 INNER JOIN [dbo].[WOR1]  T1 ON T0.[DocEntry] = T1.[DocEntry]  INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode

WHERE T2.[WhsCode] =  T1.[wareHouse] and  T1.[PlannedQty] >  T2.[OnHand]

and 'Y' = (select T10.InvntItem from oitm T10 where T10.Itemcode = T1.[ItemCode] )

and T0.DocEntry = @list_of_cols_val_tab_del)

BEGIN

SELECT @Error = 1, @error_message = ' Stock is less than Planned'

END

END


Viewing all articles
Browse latest Browse all 8378

Trending Articles



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