Skip to Content
author's profile photo Former Member
Former Member

Cannot add row without complete selection of batch/serial numbers while Inventory transfer with Serialwise

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;

}

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 13, 2015 at 06:21 PM

    ASAP

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.