on 05-13-2015 5:58 PM
Hi Expert ,
Please help me as soon as possible, this is my request to all...
My problem is Cannot add row without complete selection of batch/serial numbers ,
1) I am trying to do Inventory Transfer with Serialwise and i am using following code for the same.
2) I am using User define form for above transaction, in that i am using same item code twice for one inventory transaction
SrNo. ItemCode Qty FrmWhs ToWhs SerialNo
1 ITM001 1 Pune Mum P001
2 ITM001 1 Pune Mum P002
THank You In Advance.
Pradeep Khodke
C# Code-
SAPbobsCOM.StockTransfer ostock = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer);
ostock.DocDate = DateTime.Now;
ostock.FromWarehouse = oForm.Items.Item("edtFwCd").Specific.Value;
ostock.ToWarehouse = oForm.Items.Item("edtTwCd").Specific.Value;
int j = 0;
int rowcount = oMat.VisualRowCount;
for (int i = 1; i <= oMat.VisualRowCount; i++)
{
// ostock.Lines.SetCurrentLine(j);
if (i == rowcount)
{
// ostock.Lines.SetCurrentLine(j);
ostock.Lines.ItemCode = oMat.Columns.Item("V_1").Cells.Item(i).Specific.Value;
ostock.Lines.FromWarehouseCode = oForm.Items.Item("edtFwCd").Specific.Value;
ostock.Lines.WarehouseCode = oForm.Items.Item("edtTwCd").Specific.Value;
ostock.Lines.Quantity = 1;
}
else
{
// ostock.Lines.SetCurrentLine(j);
ostock.Lines.ItemCode = oMat.Columns.Item("V_1").Cells.Item(i).Specific.Value;
ostock.Lines.FromWarehouseCode = oForm.Items.Item("edtFwCd").Specific.Value;
ostock.Lines.WarehouseCode = oForm.Items.Item("edtTwCd").Specific.Value;
ostock.Lines.Quantity = 1;
ostock.Lines.Add();
}
ostock.Lines.SerialNumbers.InternalSerialNumber = oMat.Columns.Item("V_4").Cells.Item(i).Specific.Value;
ostock.Lines.SerialNumbers.SetCurrentLine(0);
ostock.Lines.SerialNumbers.Add();
//
j++;
}
if (ostock.Add() == 0)
{
}
else
{
BubbleEvent = false;
clsAddOn.LDNA_Application.StatusBar.SetText(clsAddOn.LDNA_Company.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error);
return;
}
ASAP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pradeep
for (int i = 1; i <= oMat.VisualRowCount; i++)
{
// ostock.Lines.SetCurrentLine(j);
if (i == rowcount)
{
// ostock.Lines.SetCurrentLine(j);
ostock.Lines.ItemCode = oMat.Columns.Item("V_1").Cells.Item(i).Specific.Value;
ostock.Lines.FromWarehouseCode = oForm.Items.Item("edtFwCd").Specific.Value;
ostock.Lines.WarehouseCode = oForm.Items.Item("edtTwCd").Specific.Value;
ostock.Lines.Quantity = 1;
ostock.Lines.SerialNumbers.InternalSerialNumber = oMat.Columns.Item("V_4").Cells.Item(i).Specific.Value;
}
else
{
// ostock.Lines.SetCurrentLine(j);
ostock.Lines.ItemCode = oMat.Columns.Item("V_1").Cells.Item(i).Specific.Value;
ostock.Lines.FromWarehouseCode = oForm.Items.Item("edtFwCd").Specific.Value;
ostock.Lines.WarehouseCode = oForm.Items.Item("edtTwCd").Specific.Value;
ostock.Lines.Quantity = 1;
ostock.Lines.SerialNumbers.InternalSerialNumber = oMat.Columns.Item("V_4").Cells.Item(i).Specific.Value;
ostock.Lines.Add();
}
}
Regards
Edy
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
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.