Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

(Back to Z-TS Transaction Notification SQL Scripts Posted to Wiki Listing -Z-TS Transaction Notification SQL Scripts Posted to Wiki )

TYPE: Frequently Requested SQL

AUTHOR NAME: Neetu Dhami

PURPOSE AND BACKGROUND:  This SQL was created in 2007A SP01 PL08. It can be used to prevent users from receiving final product without issue of component Items on production order.

Copy and Paste this SQL:

--Z-TS Block Receipt of Final Product without Component Issue Ver 1 ND 03 June,2011

--DESCRIPTION:  Transaction notification SQL script can be used to prevent users from receiving final product without issue of component Items and can be modified as required.

--AUTHOR(s):
--Version 1 Neetu Dhami 03,June, 2011

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 @entry INT

SELECT @entry = 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 = @entry)

SELECT @Error = 1, @error_message = 'Components Items not Issued Yet'

END

ELSE

SELECT @Error = 1, @error_message = 'Components Items not Issued Yet'

END

  • No labels