cancel
Showing results for 
Search instead for 
Did you mean: 

SBO_SP_TransactionNotification weird error

0 Kudos
242

Hello,

I'm trying to add a condition in this SP to perform a specific task, but it always return a strange error in SAP B1. (version 9.2 PL06)

Here's the SP code:

IF @object_type = '4' AND @transaction_type IN ('A', 'U') BEGIN
	Declare @ManufCode NVARCHAR(30),
			@Cout NUMERIC(10,2)

SET @Cout = (SELECT T0.U_COUTAUTRE FROM OITM T0 WHERE T0.DocEntry = @list_of_cols_val_tab_del)

END

This should be straighforward. Get the value of a UDF in the OITM table when Adding or Updating an Item in the Inventory module.

But in B1, it always returns the error message: "Conversion failed when converting the NVARCHAR value 'XXXXX' to data type INT"

XXXX is the value in the Mfr Catalog No (SuppCatNum)

I can't see what I'm missing here.

Any help would be really appreciate,

thanks for your time

View Entire Topic
former_member233854
Active Contributor
0 Kudos

Your @list_of_cols_val_tab_del is the itemCode, the PK of OITM table so you need to use itemcode instead of docentry as follow

IF@object_type ='4'AND@transaction_type IN('A','U')BEGIN
	Declare @ManufCode NVARCHAR(30),@Cout NUMERIC(10,2)SET@Cout =(SELECT T0.U_COUTAUTRE FROM OITM T0 WHERE T0.ItemCode = @list_of_cols_val_tab_del)END
0 Kudos

I didn't knew the @list_of_cols_val_tab_del refered to the PK the the target table. All examples I could find used DocEntry. Thanks a lot for your help, it works now!