Skip to Content
0
Former Member
Feb 27, 2012 at 10:02 AM

Stored procedure updating PO

381 Views

Hi Experts

I have created a stored procedure which updates a UDF on the PO when a certain criteria is met. The stored proc works fine, however, for some reason i am unable to add any items with this proc activated - any idea why? Proc below:

--Set QC parametre on PO

IF @transaction_type = 'A' or @transaction_type = 'U' AND @object_type = '22'

begin

declare @QC as nvarchar(20)

set @QC = (

select distinct 'Yes' from por1

inner join opor on OPor.DocEntry = POR1.DocEntry

inner join OITM on OITM.ItemCode = POR1.ItemCode

where

OITM.U_QC = 'Yes'

and

POR1.docentry=@list_of_cols_val_tab_del)

begin

update opor

set opor.u_QC = @QC where opor.docentry=@list_of_cols_val_tab_del

end

end