cancel
Showing results for 
Search instead for 
Did you mean: 

Store procedure for inventory transactions

former_member209762
Participant
0 Kudos

Hi gurus,

I have an issue. For example, two warehouses A and B. Warehouse A stores only goods received from vendors (using GRPO form). Warehouse B stores only goods transfered from warehouse A. Therefore, it would be impossible to created a GRPO in warehouse B.

Can I get the corrsponding store procedures to handle this in SAP B1 ?

Thanks for your help.

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

Insert this in your SBO_SP_TransactionNotification stored procedure after the line
-- ADD YOUR CODE HERE

IF @Object_type = N'20' and @transaction_type = N'A'
BEGIN
If exists
(SELECT  From PDN1
Where PDN1.DocEntry = @list_of_cols_val_tab_del
   and PDN1.WhsCode='B')
Select @error = 10, @error_message = N'Forbidden receiving to warehouse B !'
END

former_member209762
Participant
0 Kudos

Hi All,

Thanks for your help.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try:

IF @Object_type = '20' and @transaction_type in ( 'A' ,'U')

BEGIN

If exists

(SELECT t0.Docentry From OPDN T0 JOIN PDN1 t1 ON t0.DocEntry=T1.DocEntry

Where t0.DocEntry = @list_of_cols_val_tab_del

   and t1.WhsCode='B')

Begin

Select @error = 20, @error_message = 'Wrong Warehouse !'

End

END

Thanks,

Gordon

KennedyT21
Active Contributor
0 Kudos

Hi Yves....

Try This TN SP... Change the warehouse code according to the live data...

IF @Object_type = '20' and @transaction_type in ( 'A' ,'U')

BEGIN

If exists

(SELECT t1.Docentry From PDN1 t1

Where t1.DocEntry = @list_of_cols_val_tab_del

   and t1.WhsCode='B')

Select @error = 1,

@error_message = 'Check the Warehouse !'

END

Hope Helpful

Regards

Kennedy