Skip to Content

SBO_SP_TransactionNotification weird error

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 30, 2017 at 08:18 PM

    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
    Add comment
    10|10000 characters needed characters exceeded

    • 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!