You have items sitting on an SSCC, and you want to get rid of the SSCC's. The items must stay in the same location, just no longer on an SSCC.
You can use Move function to put the stock on the location.
On a scanner
Use an ad-hoc move, select Partial SSCC, and 'move' the stock to the location directly. This way, the items will be moved to the same location but without the sscc.
In the Produmex Add-on
You can also book a move in Produmex within SAP. Go to Produmex > Inventory > Move and create a new move.
Insert your item data, keeping Src. Stor. Loc and Dest. Stor. Loc the same. Fill in Src. Log. Unit but leave Dest. Log. Unit open. This way, the items will be moved to the same location but without the sscc.
You can also automate this task with the following script configured for Produmex Robot tool.
First, create an SQL view that contains all source data:
ALTER VIEW "PMX_REMOVE_SSCC_VIEW" AS
SELECT "ItemCode","Quantity", "ItemTransactionalInfoKey", "QualityStatusCode", "LogUnitIdentKey", "StorLocCode", "QuantityUom2", "Uom2", "Uom"
FROM "PMX_INVT"
WHERE
"LogUnitIdentKey" IS NOT NULL
AND "StorLocCode" = 'LOCATIONCODE'
AND "LogUnitIdentKey" not in (select "LogUnitIdentKey" from PMX_INLD where LogUnitIdentKey is not null)
You can join tables here, and use where clauses to get the data you need.
Next, save the following script as removesscc.cs, making sure to enter your connection string.
using System;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Text;
using System.Transactions;
using Produmex.Foundation.Data.Sbo;
using Produmex.Foundation.Data.Sbo.Attributes;
using Produmex.Foundation.Data.Sbo.BusinessObjects;
using Produmex.Foundation.Data.Sbo.BusinessObjects.Convertors;
using Produmex.Foundation.Data.Sbo.BusinessObjects.Definitions.Tables;
using Produmex.Foundation.Data.Sbo.Providers;
using Produmex.Foundation.Data.Sbo.Utilities;
using Produmex.Foundation.Data.SqlClient;
using Produmex.Foundation.Diagnostics;
using Produmex.Foundation.Reflection;
using Produmex.Foundation.Resources;
using Produmex.Foundation.SboGui;
using Produmex.Sbo.Logex.Data.BusinessObjects;
using Produmex.Sbo.Logex.Data.BusinessObjects.Definitions;
using Produmex.Sbo.Logex.Data.BusinessObjects.Definitions.Tables;
using Produmex.Sbo.Logex.Data.Providers;
namespace AddUpdateData
{
class Program
{
private static string CONNECTION_STRING = "ADDYOURCONNECTIONSTRINGHERE";
private static readonly ILog s_log = LogProvider.GetLogger(MethodInfo.GetCurrentMethod().DeclaringType);
static void Main(string[] args)
{
try
{
DoSomething();
}
catch (Exception ex)
{
s_log.Error("", ex);
Console.WriteLine(ex);
}
}
private static void DoSomething()
{
using (TransactionScope scope = PmxDbConnection.GetNewTransactionScope())
{
using (PmxDbConnectionSql conn = new PmxDbConnectionSql(CONNECTION_STRING))
{
conn.Open();
Console.Write("\r\nConnection is open\r\n");
// conn.EnlistTransaction(Transaction.Current);
PmxMoveProvider moveProv = new PmxMoveProvider(conn);
// string query = GetInventoryQuery(conn.DbCultureInfo);
string query = @"SELECT * from PMX_REMOVE_SSCC_VIEW";
using (ISboRecordset rs = SboRecordsetHelper.RunQuery(s_log, query, conn))
{
using (PmxMove move = moveProv.GetNewBO())
{
while (!rs.EoF)
{
Console.Write("\r\nPerform Move\r\n");
PmxMoveLine moveLine = moveProv.GetNewAddedLine(move);
moveLine.ItemCode = rs.GetTypedValue<string>("ItemCode");
moveLine.Quantity = rs.GetTypedValue<double>("Quantity");
//Console.Write("\r\nPmxInventoryTotalTable.Columns.ItemTransactionalInfoKey.NAME: " + PmxInventoryTotalTable.Columns.ItemTransactionalInfoKey.NAME + "\r\n");
if (rs.GetTypedValue<int>("ItemTransactionalInfoKey") > 0)
{
moveLine.ItemTransactionalInfoKey = rs.GetTypedValue<int>("ItemTransactionalInfoKey");
}
if (rs.GetTypedValue<double>("QuantityUom2") > 0)
{
moveLine.QuantityUom2 = rs.GetTypedValue<double>("QuantityUom2");
}
if (rs.GetTypedValue<string>("Uom2") != "")
{
moveLine.Uom2 = rs.GetTypedValue<string>("Uom2");
}
if (rs.GetTypedValue<string>("Uom") != "")
{
moveLine.Uom = rs.GetTypedValue<string>("Uom");
}
moveLine.SourceQualityStatusCode = rs.GetTypedValue<string>("QualityStatusCode");
moveLine.DestinationQualityStatusCode = rs.GetTypedValue<string>("QualityStatusCode");
moveLine.SourceLogisticUnitIdentKey = rs.GetTypedValue<int?>("LogunitIdentkey");
moveLine.DestinationLogisticUnitIdentKey = null;
moveLine.SourceStorageLocationCode = rs.GetTypedValue<string>("StorLocCode");
moveLine.DestinationStorageLocationCode = rs.GetTypedValue<string>("StorLocCode");
rs.MoveNext();
}
moveProv.AddBO(move, true);
}
}
//Complete transaction
scope.Complete();
}
}
}
}
}
You can now run this cs script with the Robot tool, for example with this .bat file:
"C:\Program Files\Produmex\Produmex Tools\Produmex.Sbo.Logex.Tools.Robot.exe" /t:csscript /a1:"C:\Program Files\Produmex\Produmex Tools\CsScript\removesscc.cs" /cs:yourconnectionstringhere
pause
The script will make move lines for each of the sscc's in your view and move the inventory directly on location, keeping the same quality status.
Comments
0 comments
Article is closed for comments.