From 1cc526f132a7bddeb85e4b5c257008986b980c7c Mon Sep 17 00:00:00 2001 From: Ilia Pezkine <133650766+ipezkine-ext@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:11:03 +0100 Subject: [PATCH] Fixed mapping of the optional parameters when getting the parameters description from SAP SDK (#315) --- src/YaNco.Core/Internal/Api.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/YaNco.Core/Internal/Api.cs b/src/YaNco.Core/Internal/Api.cs index d0935eb..5a2f990 100644 --- a/src/YaNco.Core/Internal/Api.cs +++ b/src/YaNco.Core/Internal/Api.cs @@ -162,7 +162,7 @@ public static RfcRc AddFunctionParameter(FunctionDescriptionHandle descriptionHa Name = parameterDescription.Name, Type = parameterDescription.Type, Direction = parameterDescription.Direction, - Optional = parameterDescription.Optional ? 'X' : '\0', + Optional = parameterDescription.Optional ? '1' : '0', Decimals = parameterDescription.Decimals, NucLength = parameterDescription.NucLength, UcLength = parameterDescription.UcLength, @@ -190,7 +190,7 @@ public static RfcRc GetFunctionParameterDescription(FunctionDescriptionHandle de { var rc = Interopt.RfcGetParameterDescByName(descriptionHandle.Ptr, name.ToUpperInvariant(), out var parameterDescr, out errorInfo); parameterInfo = new RfcParameterInfo( - parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 'X'); + parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 1); return rc; } @@ -200,7 +200,7 @@ public static RfcRc GetFunctionParameterDescription(FunctionDescriptionHandle de { var rc = Interopt.RfcGetParameterDescByIndex(descriptionHandle.Ptr, (uint)index, out var parameterDescr, out errorInfo); parameterInfo = new RfcParameterInfo( - parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 'X'); + parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 1); return rc; }