2017 Nov 30 7:01 PM - edited 2024 Feb 04 12:56 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
9 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.