cancel
Showing results for 
Search instead for 
Did you mean: 

SP for Inventory Transfer blocking by Warehouse

Former Member
0 Kudos

Dear experts,

Need a SP

I have 2 Warehouse named

1) A

2) B

I want to allow inventory transfer from warehouse A to Warehouse B

But I also want to block inventory transfer from warehouse B to warehouse A.

Thanks In advanced...

Regards

Rahul P.

rahulpathare@outlook.com

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member312729
Active Contributor
Try this to block from B to A warehouse


IF (@object_type= N'67') and @transaction_type= N'A' BEGIN IF EXISTS (SELECT T0.DocNum FROM dbo.OWTR T0 INNER JOIN WTR1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE (T1.[FromWhsCod]='B'and T1.[WhsCode]='A' AND T0.DocEntry = @list_of_cols_val_tab_del)) BEGIN SET @error = 123 SET @error_message = 'Transfer Type for respective Whse not allowed, input please' END End

Regards:
Balaji.S
Former Member
0 Kudos

Dear Balaji Sir,

Thank you for reply sir.

I already create & linked this SP to my database. but it denied both transaction. that is A to B & B to A.

Regards

Rahul P.

former_member312729
Active Contributor
0 Kudos

I had given the condition for not allowing from B to A. This will not stop inventroy transfer from A to B.

WHERE(T1.[FromWhsCod]='B'and T1.[WhsCode]='A')

Regards:

Balaji.S