Hola, tengo un procedimiento almacenado en hana el cual ejecuta perfectamente desde HANA STUDIO, pero al hacer el llamado desde mi proyecto C# Visual Studio 2022 sale este error => “”
Este es el procedimiento:
create PROCEDURE REG_ENTRADA_MERCANCIA_MOD (DocNum INT default 0,
DocDate NVARCHAR(10) default null,
ItemCode NVARCHAR(100) default null,
BatchNum NVARCHAR(36) default null,
CardCode NVARCHAR(100) default null,
Almacen NVARCHAR(8) default null,
RefFactura NVARCHAR(30) default null
) LANGUAGE SQLSCRIPT AS
BEGIN SELECT
DISTINCT T4."DocNum",
TO_CHAR(T4."DocDate",
'YYYY-MM-DD'),
T4."CardCode",
T4."CardName",
T4."Address",
T3."WhsCode",
T5."FirmCode",
(SELECT
"FirmName"
FROM "B1H_COBEFAR_2018".OMRC
WHERE "FirmCode" = T5."FirmCode") ,
T3."ItemCode" ,
T3."Dscription",
T3."Quantity",
T5."NumInBuy",
T5."BuyUnitMsr",
T2."DistNumber" ,
TO_CHAR(T2."ExpDate",
'YYYY-MM-DD')
,T4."U_SYP_MDTO"||'-'||T4."U_SYP_MDSO"||'-'||T4."U_SYP_MDCO"
,(SELECT MAX(distinct x2."NumAtCard")
from opdn x
inner join pdn1 x1 on x1."DocEntry"=x."DocEntry"
and x1."ItemCode" = T1."ItemCode"
inner join pch1 x0 on ((x0."BaseEntry"= x1."DocEntry"
and x0."BaseType"=x1."ObjType"
AND x0."BaseLine" = x1."LineNum")
or (x0."DocEntry"= x1."BaseEntry"
and x0."ObjType"=x1."BaseType"
AND x0."LineNum" = x1."BaseLine"))
and x0."ItemCode" = x1."ItemCode"
inner join opch x2 on x2."DocEntry" = x0."DocEntry"
where x."DocEntry" =T1."DocEntry"
and x."CANCELED"='N'
and x."U_SYP_STATUS"='V'
AND x2."NumAtCard" NOT LIKE 'AC%'
--and x."DocEntry"=DocEntryOPDN
and x2."CardCode"=T4."CardCode")
FROM "B1H_COBEFAR_2018".ITL1 T0
INNER JOIN "B1H_COBEFAR_2018".OITL T1 ON T0."LogEntry" = T1."LogEntry"
INNER JOIN "B1H_COBEFAR_2018".OBTN T2 ON T0."ItemCode" = T2."ItemCode"
and T0."SysNumber" = T2."SysNumber"
INNER JOIN "B1H_COBEFAR_2018".PDN1 T3 ON T1."DocEntry" = T3."DocEntry"
INNER JOIN "B1H_COBEFAR_2018".OPDN T4 ON T3."DocEntry" = T4."DocEntry"
INNER JOIN "B1H_COBEFAR_2018".OITM T5 ON T5."ItemCode" = T3."ItemCode"
WHERE T4."CANCELED" ='N'
and T1."ApplyLine"=T3."LineNum"
and T3."ItemCode" = T2."ItemCode"
and ((DocNum <>0
and T4."DocNum" =DocNum)
or DocNum =0)
and ((DocDate is not null
and T4."DocDate" =DocDate)
or DocDate is null)
and ((ItemCode is not null
and T3."ItemCode" =ItemCode)
or ItemCode is null)
and ((BatchNum is not null
and T2."DistNumber" =BatchNum)
or BatchNum is null)
and ((CardCode is not null
and T4."CardCode" =CardCode)
or CardCode is null)
and ((Almacen is not null
and T3."WhsCode" =Almacen)
or Almacen is null)
and ((RefFactura is not null
and T4."U_SYP_MDTO"||'-'||T4."U_SYP_MDSO"||'-'||T4."U_SYP_MDCO" =RefFactura)
or RefFactura is null)
order by TO_CHAR(T4."DocDate",
'YYYY-MM-DD') desc ,
T4."DocNum" desc ;
END ;