on 02-12-2008 7:59 AM
Dear All,
in the AP Invoice there is a field of Vendor Ref. No. I can understand the use of this but when i put the duplicate reference no. for the same vendor there is no restiction from the system side and that can ultimately lead to the duplicate posting
so can anyone suggest how to go about and how to save the duplicate posting
this is still pending can anyone answer plz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can block the duplication with stored procedure transactionotification. If the document is Added (A), then check, if exist same number, if yes, throw error.
For example for vendor deliveries it will be as:
if @object_type = '20' and (@transaction_type= 'A' or @transaction_type= 'U')
begin
declare @venno as varchar(200)
select @venno = numatcard from opdn where docentry =@list_of_cols_val_tab_del
if 1 != (select count(docentry) from opdn with(nolock) where numatcard = @venno)
begin
select @error =1
select @error_message = 'Duplicate vendor no.'
end
end
Sana,
I would suggest that you first upgrade your 2005A version to the latest patch.
The system has an Auto check (out of the box) and when you enter a duplicate Vendor Invoice No in the Ref No field you will get a message like this
Vendor Ref. No. already exists in a document of this type. Continue?
Hi, Petr,
Actually I hope to get the solution from SAP administration.
If the store procedure is the only solution ...
For user side/role, we don't quite know the program (sp) bundled into SAP system. Currently I only write SP for crystal report usage. Don't know if that's easy and convenient for you to detail how to put the store procedure into AP Invoice function?
Very appreciate.
Michelle
Check this link which explains SBO_SP_TransactionNotification procedure
Its easy, open sql managemet studio and connect to sql server. Then on left side expand the db you want to apply the changes, then expand programability and stored procedures. There find sbo_transaction_notification use right click and modify. In section "Here put your code...." insert my code. It will work.
If you are using sql 2000 (previous was for 2005), open enterprise manager and find the stored procedure. Then click on it and select Edit.
Hi, Gordon and Peru,
Glad to hear my company can go the solution. But I can't find the "Add Code here"! that's in SAP system or SQL Server management studio? can you elaborate the add on process?
Also, before copy the code of Peru, I think I have to fix the code as below, to make it to be available for 'Vendor Ref No ' entried no matter in PO Receipt or AP Invoice either one will get checked if duplicated, Is there any missing to reach my purpose?
if (@object_type = '20' or @object_type ='18') and (@transaction_type= 'A' or @transaction_type= 'U')
begin
declare @venno as varchar(200)
select @venno = numatcard from opdn where docentry =@list_of_cols_val_tab_del
if 1 != (select count(docentry) from opdn with(nolock) where numatcard = @venno)
begin
select @error =1
select @error_message = 'Duplicate vendor no.'
end
end
Very appreciate for you both help on this.
Michelle
Sorry I missed the last 2 mails before I asked question "can't find the SP" this morning.
I found the SP, and tested it. But any data entried in Vendor Ref No will be blocked now.
I think that's because the select count from OPCH/OPDN condition... I am tuning the code now.
Very Thanks to
Peru, Gordon, and Suda. And the question initiator...
Best regards,
Michelle
Hi, guys,
Here's the code I revised and it works. For anyone who needs !
/** block duplicate Vendor Invoice number **/
if (@object_type = '20' or @object_type = '18')
and (@transaction_type= 'A' or @transaction_type= 'U')
begin
declare @venno as varchar(100)
if @object_type = '20'
begin
select @venno = NumAtCard
from opdn
where docentry =@list_of_cols_val_tab_del
if 1 != (select count(docentry) from opdn with(nolock) where NumAtCard = @venno)
begin
select @error = 1
select @error_message = 'Duplicate vendor ref no in PO Receipts. ! '
end
end
else
if @object_type = '18'
begin
select @venno = NumAtCard
from opch
where docentry =@list_of_cols_val_tab_del
if 1 != (select count(docentry) from opch with(nolock) where NumAtCard = @venno)
begin
select @error = 2
select @error_message = 'Duplicate vendor ref no in AP Invoices. ! '
end
end
end
Best regards,
Michelle
Hi Guys,
There is a slight problem in the code given above.
In my system i am having the GRPO with vendor ref no. 100. and when i am adding the Grpo with vendor Ref. no. 0100 it is adding with out blocking the documents in this case also it should block. can any one please give me a solution for this senario.
Regards,
Srinivas
Hi Srinivas,
Seeing as the NumAtCard field in SAP is NVARCHAR then 0100 is not the same as 100 and so it's correct not to block it. However, you are saying you need 0100 to be blocked - to do this you would need to CAST the value as INT and then compare. But, is the Vendor Ref. No. always going to be in numeric format? If not then you will get errors casting as INT and will need further checks to see if the value is numeric before casting.
Regards,
Andrew.
U can restrict from Administration --> System initialization --> Documents settings, per document tab , choose document 'AP Invoice' choose block release when 'When duplicated Vendor Reference No. occurs'
Regards,
Dhana.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.