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

Re: Is it possible to restrict creation of Issue Component and Report Completion against a Production Order ?

$
0
0

Hi Sameer Ji,

I think there is no use of UDF. There should be only simple concept at user level that if issue for production is not completed then receipt from production should not be commited in production order.

Try this SP for your requirement...

IF @transaction_type = 'A' AND @Object_type = '59'

BEGIN

IF EXISTS (SELECT T0.DOCENTRY FROM dbo.IGN1 T0 WHERE T0.DOCENTRY = @list_of_cols_val_tab_del)

BEGIN

DECLARE @Trigger INT

SELECT @Trigger = T0.BASEENTRY FROM dbo.IGN1 T0 WHERE T0.DOCENTRY = @list_of_cols_val_tab_del

IF EXISTS (SELECT T1.ITEMCODE, T1.PLANNEDQTY, T2.QUANTITY, T2.BASEENTRY AS 'ISSUED QTY' FROM dbo.OWOR T0 INNER JOIN dbo.WOR1 T1

ON T0.DOCENTRY = T1.DOCENTRY LEFT OUTER JOIN dbo.IGE1 T2 ON T2.BASEENTRY = T0.DOCENTRY AND T1.ITEMCODE = T2.ITEMCODE

WHERE T1.PLANNEDQTY > ISNULL(T2.QUANTITY, 0) AND T0.DOCENTRY = @Trigger)

SELECT @Trigger = 1, @error_message = 'Please complete Issue for Production First'

END

ELSE

SELECT @Trigger = 1, @error_message = 'Please complete Issue for Production First'

END


Viewing all articles
Browse latest Browse all 8372

Trending Articles



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