Skip to Content

1470000341 Fully allocate itemCode to bin locations in warehouse, Purchase DeliveryNotes

Hello, experts!

I'm trying receipt purchase item by DIAPI. But I'm receiving the error: 1470000341 - Fully allocate item \"MyItemCode\" to bin locations in warehouse \"MyWarehouse\". When I use the same data to insert manually, works fine.

Code goes like this in C#:

SAPbobsCOM.Documents myDocuments = SAP.SAPCompany.GetBusinessObject(BoObjectTypes.oPurchaseDeliveryNotes);

myDocuments.HandWritten = BoYesNoEnum.tNO;

myDocuments.CardCode = order.BusinessPartnerCode;
myDocuments.CardName = order.BusinessPartnerName;
myDocuments.Reference2 = order.Reference2;

myDocuments.DocDate = order.StorageDate;
myDocuments.DocDueDate = order.StorageDate;
myDocuments.TaxDate = order.StorageDate;

myDocuments.Printed = PrintStatusEnum.psNo;

int sarialNum = 0;
foreach (var item in order.PurchaseOrderItems)
{
    myDocuments.Lines.ShipDate = item.ShipDate;
    myDocuments.Lines.ItemCode = item.ItemCode;
    myDocuments.Lines.ItemDescription = item.ItemDescription;

    myDocuments.Lines.Quantity = Convert.ToDouble(item.Quantity);
    myDocuments.Lines.Price = item.Price;
    myDocuments.Lines.UnitPrice = item.UnitPrice;

    myDocuments.Lines.DiscountPercent = (double)item.DiscountPerLine;
    myDocuments.Lines.WarehouseCode = B1DlftWhsCode;
    myDocuments.Lines.BaseType = item.BaseDocumentType;
    myDocuments.Lines.BaseEntry = item.BaseDocumentEntry;
    myDocuments.Lines.BaseLine = item.BaseDocumentLineId;

    //Batch
    myDocuments.Lines.BatchNumbers.BatchNumber = item.U_WEBSO_ID;
    myDocuments.Lines.BatchNumbers.Quantity = item.Quantity;
    myDocuments.Lines.BatchNumbers.Add();

    //BinAllocation
    myDocuments.Lines.BinAllocations.BinAbsEntry = 5; //SZCPRT010101 (select * from OBIN where AbsEntry = 5)
    myDocuments.Lines.BinAllocations.Quantity = item.Quantity;
    myDocuments.Lines.BinAllocations.BaseLineNumber = sarialNum;
    myDocuments.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0;
    myDocuments.Lines.BinAllocations.Add();

    myDocuments.Lines.Add();
    sarialNum++;
}

myDocuments.DocTotal = Math.Round(double.Parse(order.DocumentTotal), 2);

int RntCode = myDocuments.Add();

When I try myDocuments.Add() it gives me this error:

ErrorNo=-10,
ErrorDescription= 1470000341 - Fully allocate item \"2001DCM\" to bin locations in warehouse \"SPOP\"

Any help would be appreciated.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Mar 16 at 12:50 PM

    Hi Lee,

    from first glance :

    <line>.Add() is always adding a new empty line, therefor should only be used before filling the data, not after ( there are still errors like that in official SDK help after 10+ years ). There is also different behaviour in DI API for extra empty lines -> just don't do it.

    But remember, the first line is already present, meaning you only have to use .Add() when it is not the first line

    This is imho the issue for you :

    myDocuments.Lines.BinAllocations.SerialAndBatchNumbersBaseLine = 0

    You always assign the first ( 0 ) batch number line to all bin allocations, but you are adding multiple batchlines - this has to be sorted.

    I would correct the issues and if the problem persists, use myDocuments.GetAsXML() to see the produced document (before adding it)

    best regards,

    Maik

    Add a comment
    10|10000 characters needed characters exceeded

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.