on 02-18-2014 8:45 PM
Hi,
I'm trying to create a picklist using the DIAPI, but I'm having problems.
Error Message is: "Internal error (-2007) occurred"
SAP 9 PL 7.
My Code:
public void UpdatePickingList(int id)
{
PickLists pk = c.GetBusinessObject(BoObjectTypes.oPickLists);
pk.PickDate = Convert.ToDateTime("15/02/2014"); ;
pk.Lines.BaseObjectType = "17";
pk.Lines.ReleasedQuantity = 1;
pk.Lines.OrderEntry = 32;
pk.Lines.OrderRowID = 0;
int i = pk.Lines.Count;
pk.Lines.BatchNumbers.SetCurrentLine(0);
pk.Lines.BatchNumbers.BatchNumber = "XPTO1234";
//pk.Lines.BatchNumbers.Location = "MG";//"MG-MATERIAL_ALOCADO";
pk.Lines.BatchNumbers.Quantity = 1;
pk.Lines.BatchNumbers.Add();
pk.Lines.BinAllocations.SetCurrentLine(0);
pk.Lines.BinAllocations.BinAbsEntry = 36;
pk.Lines.BinAllocations.Quantity = 1;
pk.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
//pk.Lines.BinAllocations.BaseLineNumber = 0;
pk.Lines.BinAllocations.Add();
pk.Lines.Add();
int iErro = pk.Add();
if (!iErro.Equals(0))
{
string sErro = c.GetLastErrorDescription();
}
}
Hi,
The following SAP Note http://service.sap.com/sap/support/notes/1958889, says:
"In order to add a Bin Location to an Item in a Pick List via the DI API, the Pick List must already be created"
This mean you can NOT allocate before adding the PickList.
Beni.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I keep having trouble, see:
"Cannot add row without complete selection of batch/serial numbers".
PickLists pk = c.GetBusinessObject(BoObjectTypes.oPickLists);
pk.PickDate = Convert.ToDateTime("15/02/2014"); ;
pk.Lines.BaseObjectType = "17";
pk.Lines.ReleasedQuantity = 1;
pk.Lines.OrderEntry = 32;
pk.Lines.OrderRowID = 0;
pk.Lines.Add();
int iErro = pk.Add();
if (!iErro.Equals(0))
{
string sErro = c.GetLastErrorDescription();
}
pk = null;
int iPick = 6;
pk = c.GetBusinessObject(BoObjectTypes.oPickLists);
pk.GetByKey(iPick);
int i = pk.Lines.Count;
pk.Lines.BatchNumbers.SetCurrentLine(0);
pk.Lines.BatchNumbers.BatchNumber = "XPTO1234";
pk.Lines.BatchNumbers.Location = "MG-MATERIAL_ALOCADO";
pk.Lines.BatchNumbers.Quantity = 1;
pk.Lines.BatchNumbers.Add();
pk.Lines.BinAllocations.SetCurrentLine(0);
pk.Lines.BinAllocations.BinAbsEntry = 36;
pk.Lines.BinAllocations.Quantity = 1;
pk.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
pk.Lines.PickedQuantity = 1;
//pk.Lines.BinAllocations.BaseLineNumber = 0;
pk.Lines.BinAllocations.Add();
iErro = pk.Update();
if (!iErro.Equals(0))
{
string sErro = c.GetLastErrorDescription();
}
PickLists pk = c.GetBusinessObject(BoObjectTypes.oPickLists);
pk.PickDate = Convert.ToDateTime("15/02/2014"); ;
pk.Lines.BaseObjectType = "17";
pk.Lines.ReleasedQuantity = 1;
pk.Lines.OrderEntry = 32;
pk.Lines.OrderRowID = 0;
pk.Lines.Add();
int iErro = pk.Add();
if (!iErro.Equals(0))
{
string sErro = c.GetLastErrorDescription();
}
pk = null;
int iPick = 0;
pk = c.GetBusinessObject(BoObjectTypes.oPickLists);
pk.GetByKey(iPick);
pk.Lines.BinAllocations.BinAbsEntry = 36;
pk.Lines.BinAllocations.Quantity = 1;
//pk.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
pk.Lines.PickedQuantity = 1;
//pk.Lines.BinAllocations.BaseLineNumber = 0;
pk.Lines.BinAllocations.Add();
iErro = pk.Update();
if (!iErro.Equals(0))
{
string sErro = c.GetLastErrorDescription();
}
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.