GBS working

This commit is contained in:
2026-04-29 11:13:31 +02:00
parent 549cdf3fa5
commit 99a4bc662a
6 changed files with 246 additions and 62 deletions
+17 -5
View File
@@ -60,15 +60,15 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.10" newVersion="9.0.0.10" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.10" newVersion="9.0.0.10" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.10" newVersion="9.0.0.10" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -124,7 +124,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.10" newVersion="9.0.0.10" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Configuration" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -148,7 +148,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.9" newVersion="9.0.0.9" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.10" newVersion="9.0.0.10" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
@@ -178,6 +178,18 @@
<assemblyIdentity name="Microsoft.AspNetCore.Http.Features" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.OData.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.9.4.0" newVersion="7.9.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.OData.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.9.4.0" newVersion="7.9.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.9.4.0" newVersion="7.9.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -37,20 +37,23 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CompControl, Version=4.0.3.2, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.4.0.3.2\lib\net472\CompControl.dll</HintPath>
<Reference Include="CompControl, Version=4.0.3.5, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.4.0.3.5\lib\net472\CompControl.dll</HintPath>
</Reference>
<Reference Include="CompControl.ErpConnector.Utility, Version=1.0.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.ErpConnector.Utility.1.0.6\lib\netstandard2.0\CompControl.ErpConnector.Utility.dll</HintPath>
<Reference Include="CompControl.ErpConnector.Utility, Version=1.0.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.ErpConnector.Utility.1.0.7-beta.13\lib\netstandard2.0\CompControl.ErpConnector.Utility.dll</HintPath>
</Reference>
<Reference Include="CompControl.ProductionControl.Utility, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.ProductionControl.Utility.1.0.0-beta.18\lib\netstandard2.0\CompControl.ProductionControl.Utility.dll</HintPath>
<HintPath>packages\CompControl.ProductionControl.Utility.1.0.0-beta.38\lib\netstandard2.0\CompControl.ProductionControl.Utility.dll</HintPath>
</Reference>
<Reference Include="CompControl.StockControlWMS, Version=1.0.2.19, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.StockControlWMS.1.0.2.19-beta.1\lib\netstandard2.0\CompControl.StockControlWMS.dll</HintPath>
<Reference Include="CompControl.StockControlWMS, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.StockControlWMS.1.0.3\lib\netstandard2.0\CompControl.StockControlWMS.dll</HintPath>
</Reference>
<Reference Include="CompControl.StockControlWMS.API.Client, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.StockControlWMS.API.Client.1.0.3-beta.1\lib\netstandard2.0\CompControl.StockControlWMS.API.Client.dll</HintPath>
<HintPath>packages\CompControl.StockControlWMS.API.Client.1.0.4\lib\netstandard2.0\CompControl.StockControlWMS.API.Client.dll</HintPath>
</Reference>
<Reference Include="CompControl.TraceControl.Utility, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.TraceControl.Utility.2.0.2\lib\netstandard2.0\CompControl.TraceControl.Utility.dll</HintPath>
</Reference>
<Reference Include="Dapper, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Dapper.2.1.66\lib\net461\Dapper.dll</HintPath>
@@ -58,8 +61,8 @@
<Reference Include="Dapper.Contrib, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Dapper.Contrib.2.0.78\lib\net461\Dapper.Contrib.dll</HintPath>
</Reference>
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=10.3.3.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<HintPath>packages\FirebirdSql.Data.FirebirdClient.10.3.3\lib\net48\FirebirdSql.Data.FirebirdClient.dll</HintPath>
<Reference Include="FirebirdSql.Data.FirebirdClient, Version=10.3.4.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL">
<HintPath>packages\FirebirdSql.Data.FirebirdClient.10.3.4\lib\net48\FirebirdSql.Data.FirebirdClient.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
@@ -157,8 +160,14 @@
<Reference Include="Microsoft.AspNetCore.WebUtilities, Version=2.3.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNetCore.WebUtilities.2.3.0\lib\netstandard2.0\Microsoft.AspNetCore.WebUtilities.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.9.0.9\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.9.0.10\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.8.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Data.Edm.5.8.5\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.8.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Data.OData.5.8.5\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Configuration, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Configuration.8.0.0\lib\net462\Microsoft.Extensions.Configuration.dll</HintPath>
@@ -238,6 +247,12 @@
<Reference Include="Microsoft.Net.Http.Headers, Version=2.3.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Net.Http.Headers.2.3.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll</HintPath>
</Reference>
<Reference Include="Microsoft.OData.Core, Version=7.9.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.OData.Core.7.9.4\lib\net45\Microsoft.OData.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.OData.Edm, Version=7.9.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.OData.Edm.7.9.4\lib\net45\Microsoft.OData.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin, Version=4.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Owin.4.2.3\lib\net45\Microsoft.Owin.dll</HintPath>
</Reference>
@@ -247,6 +262,9 @@
<Reference Include="Microsoft.Owin.Hosting, Version=4.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Owin.Hosting.4.2.3\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Spatial, Version=7.9.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Spatial.7.9.4\lib\net45\Microsoft.Spatial.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
@@ -289,11 +307,23 @@
<Reference Include="Serilog.Sinks.File, Version=6.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>packages\Serilog.Sinks.File.6.0.0\lib\net471\Serilog.Sinks.File.dll</HintPath>
</Reference>
<Reference Include="StockControlWMS, Version=1.0.2.19, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.StockControlWMS.1.0.2.19-beta.1\lib\netstandard2.0\StockControlWMS.dll</HintPath>
<Reference Include="Simple.OData.Client.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58885f4495efc1ae, processorArchitecture=MSIL">
<HintPath>packages\Simple.OData.Client.6.0.1\lib\net461\Simple.OData.Client.Core.dll</HintPath>
</Reference>
<Reference Include="StockControlWMS.API.Client, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.StockControlWMS.API.Client.1.0.3-beta.1\lib\netstandard2.0\StockControlWMS.API.Client.dll</HintPath>
<Reference Include="Simple.OData.Client.Dynamic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58885f4495efc1ae, processorArchitecture=MSIL">
<HintPath>packages\Simple.OData.Client.6.0.1\lib\net461\Simple.OData.Client.Dynamic.dll</HintPath>
</Reference>
<Reference Include="Simple.OData.Client.V3.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58885f4495efc1ae, processorArchitecture=MSIL">
<HintPath>packages\Simple.OData.Client.6.0.1\lib\net461\Simple.OData.Client.V3.Adapter.dll</HintPath>
</Reference>
<Reference Include="Simple.OData.Client.V4.Adapter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58885f4495efc1ae, processorArchitecture=MSIL">
<HintPath>packages\Simple.OData.Client.6.0.1\lib\net461\Simple.OData.Client.V4.Adapter.dll</HintPath>
</Reference>
<Reference Include="StockControlWMS, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.StockControlWMS.1.0.3\lib\netstandard2.0\StockControlWMS.dll</HintPath>
</Reference>
<Reference Include="StockControlWMS.API.Client, Version=1.0.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CompControl.StockControlWMS.API.Client.1.0.4\lib\netstandard2.0\StockControlWMS.API.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@@ -323,8 +353,14 @@
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Pipelines, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.IO.Pipelines.9.0.9\lib\net462\System.IO.Pipelines.dll</HintPath>
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Pipelines, Version=9.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.IO.Pipelines.9.0.10\lib\net462\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@@ -333,8 +369,8 @@
<Reference Include="System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebApi.Client.6.0.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Json, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Net.Http.Json.9.0.9\lib\net462\System.Net.Http.Json.dll</HintPath>
<Reference Include="System.Net.Http.Json, Version=9.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Net.Http.Json.9.0.10\lib\net462\System.Net.Http.Json.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -372,11 +408,14 @@
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Encodings.Web.9.0.9\lib\net462\System.Text.Encodings.Web.dll</HintPath>
<Reference Include="System.Spatial, Version=5.8.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\System.Spatial.5.8.5\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=9.0.0.9, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Json.9.0.9\lib\net462\System.Text.Json.dll</HintPath>
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Encodings.Web.9.0.10\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=9.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Text.Json.9.0.10\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Channels, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Threading.Channels.8.0.0\lib\net462\System.Threading.Channels.dll</HintPath>
+8 -12
View File
@@ -31,23 +31,19 @@ pipeline {
}
}
// stage('Info') {
// steps {
// dir("${env.PROJECT_DIR}") {
// echo "msbuild -version: "
// bat 'msbuild -version'
// echo "dotnet msbuild -version: "
// bat 'dotnet msbuild -version'
// }
// }
// }
stage('Pack') {
stage('Build') {
steps {
dir("${env.PROJECT_DIR}") {
bat 'dotnet clean'
bat 'if exist bin\\Release rmdir /s /q bin\\Release'
bat "\"${tool 'MSBuild_2022'}\\MSBuild.exe\" CompControl.csproj /p:Configuration=Release"
}
}
}
stage('Pack') {
steps {
dir("${env.PROJECT_DIR}") {
bat 'nuget pack . -Properties Configuration=Release -OutputDirectory bin\\Release'
}
}
@@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.Text;
using static CompControl.ErpConnector.Utility.Models.SAP_CompControl_Models;
using static CompControl.ErpConnector.Utility.Models.SAP_BAPI_Models;
using System.Security;
using System.Threading;
namespace CompControl.SapFrameworkConnector
@@ -101,6 +100,34 @@ namespace CompControl.SapFrameworkConnector
result.MessageTechnical = result.MessageShort = ermsg;
}
// ==> MAYBE NEVER NEEDED: Lieferplan is also delivered with PO_DETAILS with sufficient rights
//if (result.GrDataItems.Count == 0) //If no Items were found take a look at SAG instead of PO
//{
// _log.Debug($"Could not find any PO Items, will now try and search for SAG '{poNo}'");
// try
// {
// BAPI_SAG_GETDETAIL_IMPORT sagInput = new BAPI_SAG_GETDETAIL_IMPORT();
// sagInput.PURCHASINGDOCUMENT = poNo;
// sagInput.SHIPPING_DATA = "X";
// sagInput.SCHEDULE_DATA = "X";
// sagInput.ITEM_DATA = "X";
// BAPI_SAG_GETDETAIL_EXPORT sagDetails = BAPI_SAG_GETDETAIL(sagInput);
// //TODO: Add logic if RFC works!
// //foreach ()
// //{
// //}
// }
// catch (Exception ex)
// {
// string ermsg = $"GetBestellung SAG: General Error, please check LOG of ErpConnector!";
// _log.Error(ermsg + $" => {ex}");
// result.ErrorNumber = 900;
// result.MessageTechnical = result.MessageShort = ermsg;
// }
//}
_log.Debug($"Result of GetBestellung now consists of {result.GrDataItems.Count} GrDataItems and {result.ManufacturerDataItems.Count} ManufacturerDataItems...");
return result;
@@ -216,9 +243,9 @@ namespace CompControl.SapFrameworkConnector
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
public static ApiResultDefault ExecuteGoodsMovement(GoodsMovementParameters par)
public static ApiResultStringItems ExecuteGoodsMovement(GoodsMovementParameters par)
{
ApiResultDefault result = new ApiResultDefault();
ApiResultStringItems result = new ApiResultStringItems();
try
{
@@ -267,6 +294,19 @@ namespace CompControl.SapFrameworkConnector
_log.Debug(sb.ToString());
BAPI_GOODSMVT_CREATE_EXPORT export = ZBAPI_GOODSMVT_CREATE(import);
//BAPI_TRANSACTION_COMMIT();
bool errorOccurred = false;
string sapMessage = "";
foreach (BAPIRET2 ret in export.RETURN) { if (ret.TYPE.Trim().Equals("E")) { errorOccurred = true; sapMessage += $"{ret.MESSAGE} "; } }
if (errorOccurred)
{
result.ErrorNumber = 900;
result.MessageTechnical = result.MessageLong = result.MessageShort = $"{sapMessage}";
}
else //In case of success return Materialbeleg as String
{
result.StringItems.Add(export.MATERIALDOCUMENT);
}
}
catch (Exception ex)
{
@@ -578,7 +618,7 @@ namespace CompControl.SapFrameworkConnector
temp.PO_PR_QNT = row.GetDecimal("PO_PR_QNT");
temp.SERIAL_NO = row.GetString("SERIAL_NO").TrimStart('0') ?? "";
temp.WITHDR_QTY = row.GetDecimal("WITHDR_QTY");
export.PO_ITEM_HISTORY_TOTAL.Add(temp);
export.PO_ITEM_HISTORY_TOTALS.Add(temp);
}
IRfcTable po_item_hist = func.GetTable("PO_ITEM_HISTORY");
@@ -603,7 +643,7 @@ namespace CompControl.SapFrameworkConnector
export.PO_ITEM_HISTORY.Add(temp);
}
_log.Debug($"BAPI_PO_GETDETAILS: Received {poItemBuffer.Count} PO_ITEMS, {export.PO_ITEM_HISTORY_TOTAL.Count} PO_ITEM_HISTORY_TOTALS, {export.PO_ITEM_HISTORY.Count} PO_ITEM_HISTORY");
_log.Debug($"BAPI_PO_GETDETAILS: Received {poItemBuffer.Count} PO_ITEMS, {export.PO_ITEM_HISTORY_TOTALS.Count} PO_ITEM_HISTORY_TOTALS, {export.PO_ITEM_HISTORY.Count} PO_ITEM_HISTORY");
}
catch (Exception ex) { errorMsg += "CI: SAP Other Exception: " + ex; }
}
@@ -695,7 +735,7 @@ namespace CompControl.SapFrameworkConnector
temp.PO_PR_QNT = row.GetDecimal("ORDER_QTY");
temp.SERIAL_NO = row.GetString("SERIAL_NO")?.TrimStart('0') ?? "";
temp.WITHDR_QTY = row.GetDecimal("WITHDRAWAL_QTY");
export.PO_ITEM_HISTORY_TOTAL.Add(temp);
export.PO_ITEM_HISTORY_TOTALS.Add(temp);
}
// Tables: POHISTORY
@@ -721,7 +761,7 @@ namespace CompControl.SapFrameworkConnector
export.PO_ITEM_HISTORY.Add(temp);
}
_log.Debug($"BAPI_PO_GETDETAIL1: Received {poItemBuffer.Count} POITEM, {export.PO_ITEM_HISTORY_TOTAL.Count} POHISTORY_TOTALS, {export.PO_ITEM_HISTORY.Count} POHISTORY");
_log.Debug($"BAPI_PO_GETDETAIL1: Received {poItemBuffer.Count} POITEM, {export.PO_ITEM_HISTORY_TOTALS.Count} POHISTORY_TOTALS, {export.PO_ITEM_HISTORY.Count} POHISTORY");
}
catch (Exception ex) { errorMsg += "CI: SAP Other Exception: " + ex; }
}
@@ -731,6 +771,94 @@ namespace CompControl.SapFrameworkConnector
return export;
}
private static BAPI_SAG_GETDETAIL_EXPORT BAPI_SAG_GETDETAIL(BAPI_SAG_GETDETAIL_IMPORT import)
{
string errorMsg = "";
BAPI_SAG_GETDETAIL_EXPORT export = new BAPI_SAG_GETDETAIL_EXPORT();
if (import != null)
{
try
{
RfcDestination dest = RfcDestinationManager.GetDestination(ConfigHelper.ActiveSapDestinationName);
IRfcFunction func = dest.Repository.CreateFunction("BAPI_SAG_GETDETAIL"); //Create Function with BAPI_PO_GETDETAIL1
func.SetValue("PURCHASINGDOCUMENT", import.PURCHASINGDOCUMENT?.Trim().PadLeft(10, '0')); //Set Value to function
// Set optional parameters
func.SetValue("SHIPPING_DATA", import.SHIPPING_DATA);
func.SetValue("ITEM_DATA", import.ITEM_DATA);
func.SetValue("SCHEDULE_DATA", import.SCHEDULE_DATA);
func.Invoke(dest); //Invoke function at Sap destination
IRfcStructure structHead = func.GetStructure("HEADER");
export.HEADER = new BAPIMEOUTHEADER();
export.HEADER.COMP_CODE = structHead.GetString("COMP_CODE");
export.HEADER.DOC_TYPE = structHead.GetString("DOC_TYPE");
export.HEADER.NUMBER = structHead.GetString("NUMBER");
export.HEADER.STATUS = structHead.GetString("STATUS");
export.HEADER.VENDOR = structHead.GetString("VENDOR");
_log.Debug($"SAG HEAD => COMP_CODE={export.HEADER.COMP_CODE}, DOC_TYPE={export.HEADER.DOC_TYPE}, NUMBER={export.HEADER.NUMBER}, STATUS={export.HEADER.STATUS}, VENDOR={export.HEADER.VENDOR}");
// RETURN-Tabelle prüfen
IRfcTable returnTable = func.GetTable("RETURN");
foreach (IRfcStructure row in returnTable)
{
_log.Error($"RETURN => Type={row.GetString("TYPE")}, ID={row.GetString("ID")}, Number={row.GetString("NUMBER")}, Message={row.GetString("MESSAGE")}");
}
// Tables: SCHEDULE
IRfcTable schedule_table = func.GetTable("SCHEDULE");
_log.Debug($"Schedule Rows: {schedule_table.RowCount}");
foreach (IRfcStructure row in schedule_table)
{
BAPIMEOUTSCHEDULE sched = new BAPIMEOUTSCHEDULE();
sched.DELETE_IND = row.GetString("DELETE_IND");
sched.DELIVERY_DATE = row.GetString("DELIVERY_DATE");
sched.ITEM_NO = row.GetString("ITEM_NO");
sched.QUANTITY = row.GetDecimal("QUANTITY");
sched.REQ_CLOSED = row.GetString("REQ_CLOSED");
sched.SCHED_LINE = row.GetString("SCHED_LINE");
export.SCHEDULE.Add(sched);
}
// Tables: SHIPPING
IRfcTable shipping_table = func.GetTable("SHIPPING");
_log.Debug($"Shipping Rows: {shipping_table.RowCount}");
foreach (IRfcStructure row in shipping_table)
{
BAPIMEPOSHIPPEXP ship = new BAPIMEPOSHIPPEXP();
ship.DEL_CREATE_TIME = row.GetDecimal("DEL_CREATE_TIME").ToString();
ship.DLV_PRIO = row.GetString("DLV_PRIO");
ship.PLND_DELRY = row.GetDecimal("PLND_DELRY");
ship.PO_ITEM = row.GetString("PO_ITEM");
ship.SRC_DLV_NO = row.GetString("SRC_DLV_NO");
export.SHIPPING.Add(ship);
}
// Tables: ITEM
IRfcTable item_table = func.GetTable("ITEM");
_log.Debug($"Item Rows: {item_table.RowCount}");
foreach (IRfcStructure row in item_table)
{
//BAPIMEPOSHIPPEXP ship = new BAPIMEPOSHIPPEXP();
//ship.DEL_CREATE_TIME = row.GetDecimal("DEL_CREATE_TIME").ToString();
//ship.DLV_PRIO = row.GetString("DLV_PRIO");
//ship.PLND_DELRY = row.GetDecimal("PLND_DELRY");
//ship.PO_ITEM = row.GetString("PO_ITEM");
//ship.SRC_DLV_NO = row.GetString("SRC_DLV_NO");
//export.ITEM.Add(ship);
}
_log.Debug($"BAPI_SAG_GETDETAIL: Received {export.SHIPPING.Count} SHIPPING items and {export.SCHEDULE.Count} SCHEDULE items");
}
catch (Exception ex) { errorMsg += "CI: SAP Other Exception: " + ex; }
}
else { _log.Debug("Error, IMPORT for BAPI_SAG_GETDETAIL was NULL! "); }
if (!errorMsg.Equals("")) { _log.Debug(errorMsg); }
return export;
}
private static BAPI_OBJCL_GETCLASSES_EXPORT BAPI_OBJCL_GETCLASSES(BAPI_OBJCL_GETCLASSES_IMPORT import)
{
@@ -23,7 +23,7 @@ namespace CompControl.SapFrameworkConnector
try
{
result = SapStandardFunctions.GetBestellung(filterBestellungen.OrderNo);
result = SapStandardFunctions.GetBestellung(filterBestellungen.OrderNo); //Maybe use true?
if (result.IsSuccessful) { _log.Debug(result); } //Action was successful => log for debug
else { _log.Error(result); } //An error occurred
@@ -135,7 +135,7 @@ namespace CompControl.SapFrameworkConnector
[HttpPut]
public async Task<HttpResponseMessage> ExecuteGoodsMovement([FromBody] SAP_CompControl_Models.GoodsMovementParameters par, CancellationToken cancellationToken)
{
ApiResultDefault result = new ApiResultDefault(); //New ApiResult to return via Web
ApiResultStringItems result = new ApiResultStringItems(); //New ApiResult to return via Web
_log.Debug("ExecuteGoodsMovement received ");
try
@@ -149,7 +149,7 @@ namespace CompControl.SapFrameworkConnector
{
string sm = $"ExecuteGoodsMovement: An unexpected error occured => " + ex;
_log.Error(sm);
result = new ApiResultDefault //Default ApiResult on error
result = new ApiResultStringItems //Default ApiResult on error
{
ErrorNumber = 101,
MessageShort = sm,
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CompControl" version="4.0.3.2" targetFramework="net48" />
<package id="CompControl.ErpConnector.Utility" version="1.0.6" targetFramework="net48" />
<package id="CompControl.ProductionControl.Utility" version="1.0.0-beta.18" targetFramework="net48" />
<package id="CompControl.StockControlWMS" version="1.0.2.19-beta.1" targetFramework="net48" />
<package id="CompControl.StockControlWMS.API.Client" version="1.0.3-beta.1" targetFramework="net48" />
<package id="CompControl" version="4.0.3.5" targetFramework="net48" />
<package id="CompControl.ErpConnector.Utility" version="1.0.7-beta.13" targetFramework="net48" />
<package id="CompControl.ProductionControl.Utility" version="1.0.0-beta.38" targetFramework="net48" />
<package id="CompControl.StockControlWMS" version="1.0.3" targetFramework="net48" />
<package id="CompControl.StockControlWMS.API.Client" version="1.0.4" targetFramework="net48" />
<package id="CompControl.TraceControl.Utility" version="2.0.2" targetFramework="net48" />
<package id="Dapper" version="2.1.66" targetFramework="net48" />
<package id="Dapper.Contrib" version="2.0.78" targetFramework="net48" />
<package id="FirebirdSql.Data.FirebirdClient" version="10.3.3" targetFramework="net48" />
<package id="FirebirdSql.Data.FirebirdClient" version="10.3.4" targetFramework="net48" />
<package id="Fody" version="6.6.3" targetFramework="net48" developmentDependency="true" />
<package id="Ionic.Zip" version="1.9.1.8" targetFramework="net48" />
<package id="log4net" version="3.2.0" targetFramework="net48" />
@@ -44,8 +45,10 @@
<package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions" version="2.3.0" targetFramework="net48" />
<package id="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" version="2.3.0" targetFramework="net48" />
<package id="Microsoft.AspNetCore.WebUtilities" version="2.3.0" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.9" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.10" targetFramework="net48" />
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net48" />
<package id="Microsoft.Data.Edm" version="5.8.5" targetFramework="net48" />
<package id="Microsoft.Data.OData" version="5.8.5" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration" version="8.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.Abstractions" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Extensions.Configuration.Binder" version="9.0.0" targetFramework="net48" />
@@ -73,9 +76,12 @@
<package id="Microsoft.Extensions.Primitives" version="9.0.0" targetFramework="net48" />
<package id="Microsoft.Net.Http.Headers" version="2.3.0" targetFramework="net48" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net48" />
<package id="Microsoft.OData.Core" version="7.9.4" targetFramework="net48" />
<package id="Microsoft.OData.Edm" version="7.9.4" targetFramework="net48" />
<package id="Microsoft.Owin" version="4.2.3" targetFramework="net48" />
<package id="Microsoft.Owin.Host.HttpListener" version="4.2.3" targetFramework="net48" />
<package id="Microsoft.Owin.Hosting" version="4.2.3" targetFramework="net48" />
<package id="Microsoft.Spatial" version="7.9.4" targetFramework="net48" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net48" />
<package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net48" />
@@ -89,15 +95,17 @@
<package id="Serilog.Sinks.Console" version="6.0.0" targetFramework="net48" />
<package id="Serilog.Sinks.Debug" version="3.0.0" targetFramework="net48" />
<package id="Serilog.Sinks.File" version="6.0.0" targetFramework="net48" />
<package id="Simple.OData.Client" version="6.0.1" targetFramework="net48" />
<package id="System.Buffers" version="4.6.0" targetFramework="net48" />
<package id="System.Collections.Immutable" version="8.0.0" targetFramework="net48" />
<package id="System.Data.Odbc" version="9.0.5" targetFramework="net48" />
<package id="System.Diagnostics.DiagnosticSource" version="9.0.0" targetFramework="net48" />
<package id="System.IO" version="4.3.0" targetFramework="net48" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net48" />
<package id="System.IO.Pipelines" version="9.0.9" targetFramework="net48" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net48" />
<package id="System.IO.Pipelines" version="9.0.10" targetFramework="net48" />
<package id="System.Memory" version="4.6.0" targetFramework="net48" />
<package id="System.Net.Http.Json" version="9.0.9" targetFramework="net48" />
<package id="System.Net.Http.Json" version="9.0.10" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net48" />
<package id="System.Reflection.Metadata" version="8.0.1" targetFramework="net48" />
<package id="System.Runtime" version="4.3.0" targetFramework="net48" />
@@ -107,8 +115,9 @@
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="9.0.9" targetFramework="net48" />
<package id="System.Text.Json" version="9.0.9" targetFramework="net48" />
<package id="System.Spatial" version="5.8.5" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="9.0.10" targetFramework="net48" />
<package id="System.Text.Json" version="9.0.10" targetFramework="net48" />
<package id="System.Threading.Channels" version="8.0.0" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.6.0" targetFramework="net48" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />