Skip to Content
0
Former Member
May 10, 2012 at 09:53 PM

Store Procedure

14 Views

Hello, I have a stored procedure that is started when Adding or updating a stock transfer.

I however only want the procedure to process if the TO warehouse(WTR1.whscode does not contain the word INT)

PLease assist, thanks in advance

I tried the following but it does not work :


if @object_type = '67' and (@transaction_type = 'A' or @transaction_type = 'U')


begin


declare @contCap numeric(19,6),

@curWeight numeric(19,6),

@serWeight numeric(19,6),

@count int,

@numRows int,

@curContNo int, @factor numeric(19,6),


@itemCode varchar(40),

@sysSerial int,

@suppserial int



select a.baseEntry, a.baseLinNum, a.itemCode, a.sysSerial, c.suppserial ,

d.u_factor,d.U_ContCapacity, 0 processed, 0 contNumber

into #tmptrnnotif

from SRI1 a INNER JOIN WTR1 b ON a.baseEntry = b.docEntry

and a.baseLinNum = b.lineNum

INNER JOIN OSRI c ON a.sysSerial = c.sysSerial

and a.itemCode = c.itemCode

INNER JOIN OWTR d ON b.docEntry = d.docEntry

where a.baseType = 67

and d.docEntry = @list_of_cols_val_tab_del

and a.direction = '1'

and b.whscode not like '%INT'

order by isnull(c.located,'') asc, convert(nchar,c.itemCode),convert(nchar, c.suppserial)