Quantcast
Viewing all articles
Browse latest Browse all 8501

Re: check double entry in UDF

Hi,

 

The easiest way to do this is via transaction notification:

 

I normally start by doing the following and getting the @Object_Type and @list_of_cols_val_tab_del

 

The easiest way to do this is to paste the following script into the transaction notification store procedure.

 

select @error = @object_type, @error_message = @list_of_cols_val_tab_del

 

Then try adding the object through the UI. The system will return the error number and mesage. Below I have drop in a simple script to check duplicate Business Partner Names.

 

if @Object_Type = '2'

begin

select @error = 1, @error_message = 'Business Partner Name ' + t0.cardname + ' already exists'

from ocrd t0

where t0.cardcode =  @list_of_cols_val_tab_del

     and t0.cardname in (select t1.cardname from ocrd t1 where t1.cardcode <> @list_of_cols_val_tab_del)

end

 

You can simple paste this into transaction notification and you should be able to adapt it quite easily to your needs.

 

Please note: Although I did return @error as the @Object_Type, please not that although most object id in SAP are numeric most UDO are not so you may get an error.

 

Regards,

 

Ansel


Viewing all articles
Browse latest Browse all 8501

Trending Articles