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: Monthly Special

AUTHOR NAME: Neetu Dhami

PURPOSE AND BACKGROUND:  This SQL was created in 2007A SP01 PL08. It can be used to prevent users from entering duplicate Customer/Vendor reference number on Sales/Purchase order document and can be modifed (Change in object type and Table names for other marketing documents) as per the customer requirement.This script can be pasted in transaction notification procedure. 

Copy and Paste this SQL:

--Z-TS Script to Block users entering duplicate reference number on Sales/Purchase Order documents Ver 1 ND 07 June,2011

--DESCRIPTION:  Transaction notification SQL script can be used to prevent users from entering duplicate Customer/Vendor Reference number on Sales/Purchase Order Documents.

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

1. Script for Sales Order

IF @object_type = '17' and (@transaction_type in ('A' ,'U'))
BEGIN
declare @RefNo as varchar (100)
declare @CardCode as varchar (100)
 IF (@object_type = '17')
  BEGIN
     SELECT @RefNo = NumAtCard, @CardCode = CardCode from ORDR T0 where docentry = @list_of_cols_Val_tab_del
     BEGIN
       if (@RefNo is not null)
         BEGIN
           IF 1!= (select count (docentry) from ORDR  where (NumatCard = @RefNo) and (cardcode = @CardCode))
             BEGIN
                select @error = 10
                select @error_message = 'Duplicate Customer Reference Number!'
             End
           End
       End
  End
End

2. Script for Purchase Order

IF @object_type = '22' and (@transaction_type in ('A' ,'U'))
BEGIN
declare @RefNo as varchar (100)
declare @CardCode as varchar (100)
 IF (@object_type = '17')
  BEGIN
     SELECT @RefNo = NumAtCard, @CardCode = CardCode from OPOR T0 where docentry = @list_of_cols_Val_tab_del
     BEGIN
       if (@RefNo is not null)
         BEGIN
           IF 1!= (select count (docentry) from OPOR  where (NumatCard = @RefNo) and (cardcode = @CardCode))
             BEGIN
                select @error = 10
                select @error_message = 'Duplicate Vendor Reference Number!'
             End
           End
       End
  End
End

  • No labels