cancel
Showing results for 
Search instead for 
Did you mean: 

Stored procedure Notification

ramco1917
Participant
0 Kudos

Hi

  I have below Notification but i want when user Cancels then it should not work. It should work only in case of Add

IF @object_type ='20' and @transaction_type in ('A')
BEGIN
if exists(Select distinct 'Error' from IBT1 B1 , IBT1 B2
where b1.BatchNum in (isnull(b2.BatchNum,'')) and B1.BaseEntry = @list_of_cols_val_tab_del
and b1.ItemCode = B2.ItemCode and b2.BaseEntry <> @list_of_cols_val_tab_del and b2.BaseType = 20 and b1.BaseType = 20)
begin
SET @error = 2000
SET @error_message = 'Duplicate Batch No. not allowed!'
End
End

Thanks

View Entire Topic
narayanis
Active Contributor
0 Kudos

Hi,

This fires because when the GRPO is cancelled, SAP adds the cancellation document and with canceled fiag as 'Y" and 'C' in original and new document.

Because you have written TN at add operation, it fires when new document gets added. If you want to not to check the new cancellation document for batch add the canceled condition in TN.