cancel
Showing results for 
Search instead for 
Did you mean: 

Error at Stored procedure at sbo_transaction notification

Former Member
0 Kudos

if @object_type='20' and @transaction_type='A'

BEGIN

  if exists(select T1.[ItemCode] FROM OPDN T0  INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry WHERE  T1.[BaseEntry] IS NULL  and T0.[DocTotal] >'1500' and  T0.[DocNum] = @list_of_cols_val_tab_del)

  begin

     set @error = '-2'

     set @error_message = 'GRPO with out Purchase Order in not allowed for value more than 1500!'

  end

END

Error is showing

Msg 137, Level 15, State 2, Line 2

Must declare the scalar variable "@object_type".

Msg 137, Level 15, State 2, Line 4

Must declare the scalar variable "@list_of_cols_val_tab_del".

Msg 137, Level 15, State 1, Line 6

Must declare the scalar variable "@error".

Msg 137, Level 15, State 1, Line 7

Must declare the scalar variable "@error_message".

Not particulary this one the same error is comming any stored procedure writing...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This SP has a section with Add your code here. You code can only be added there. Please post your question on SAP Business One forum.

Try:

IF @object_type='20' and @transaction_type='A'

BEGIN

  IF exists (select T0.DocEntry FROM OPDN T0  INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry WHERE  T1.BaseEntry IS NULL  and T0.DocTotal >1500 and  T0.DocEntry = @list_of_cols_val_tab_del)

  Begin

     set @error = '-2'

     set @error_message = 'GRPO with out Purchase Order is not allowed for value more than 1500!'

  End

END

Thanks, Gordon