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

Goods Receipt PO - addition thru DI API

Dear All,

I am using DIAPI for developing an addOn. In that I am adding record into Goods Reciept PO using oPurchaseDeliveryNotes business object.

I am attaching my coding for your reference.,


Dim oInvGenEntry As SAPbobsCOM.Documents

oInvGenEntry = vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)

oInvGenEntry.CardCode = "V002"

oInvGenEntry.HandWritten = tNO

oInvGenEntry.DocDate = "19/02/2008"

oInvGenEntry.Lines.SerialNumbers.SystemSerialNumber = 111 oInvGenEntry.Lines.SerialNumbers.ManufacturerSerialNumber = 222 oInvGenEntry.Lines.SerialNumbers.InternalSerialNumber = 333

oInvGenEntry.Lines.SerialNumbers.BaseLineNumber = 0



oInvGenEntry.Lines.ItemCode = oItems.ItemCode

oInvGenEntry.Lines.ItemDescription = oItems.ItemName

oInvGenEntry.Lines.WarehouseCode = "01"

oInvGenEntry.Lines.Currency = CurrencyComboBox.SelectedItem

oInvGenEntry.Lines.Price = CDbl(PriceText.Text)

oInvGenEntry.Lines.Rate = 2

oInvGenEntry.Lines.ShipDate = Now

oInvGenEntry.Lines.Quantity = CDbl(QuantityText.Text)

oInvGenEntry.Lines.DiscountPercent = CDbl(DiscountText.Text)

oInvGenEntry.PaymentGroupCode = -1

oInvGenEntry.DocTotal = 1

RetVal = oInvGenEntry.Add()

If RetVal <> 0 Then

MsgBoxLabel.Text = ErrCode & " " & ErrMsg

end if


When i am executing the above code i am getting error as below

[PDN1.WhsCode][line: 1] , 'P001 cannot be released from stock without a full selection of serial/batch no.'

I am able to add items without serial no. But I want a solution to add items with serial no.

Please help me to resolve this issue.



Benjamin Rosary.B

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Feb 19, 2008 at 09:37 AM


    when you have only one serial number don't add a empty line

    i recommend you to remove


    which adds a new data line



    Add a comment
    10|10000 characters needed characters exceeded

    • i meant you have two possibilites for an item:

      an item can be a serial item or a batch item


      oDoc.Lines.SerialNumbers.SystemSerialNumber = "x"



      oDoc.Lines.BatchNumbers.BatchNumber = "y"

      anyway - when you testet both i have no more idea



  • author's profile photo Former Member
    Former Member
    Posted on May 07, 2011 at 05:36 AM


    Have you got the solution of the error you are getting. If yes , please help me. I am getting the Same error on GRPO addition thru DI API

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2013 at 09:24 PM

    I am presuming your SAPB1's connections is correctly. This C# sample works for me. In this case "P00128" and "ART0334" are CardCode, ItemCode respectively in my company;


    Console.WriteLine("Connection established, the company is: " + oCompany.CompanyName);

    SAPbobsCOM.Documents documents = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);

    documents.CardCode = "P00128";

    documents.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO;

    documents.DocDate = DateTime.Today;

    documents.DocDueDate = DateTime.Today;

    documents.Lines.ItemCode = "ART0334";

    documents.Lines.ItemDescription = "Art";

    documents.Lines.WarehouseCode = "01";

    documents.Lines.Currency = "USD";

    documents.Lines.Price = 10.0;

    documents.Lines.ShipDate = DateTime.Today;

    documents.Lines.Quantity = 1.0;

    documents.Lines.DiscountPercent = 0.0;

    documents.Lines.BatchNumbers.Quantity = 1;

    documents.Lines.BatchNumbers.ManufacturerSerialNumber = "SerialNumber";

    documents.Lines.BatchNumbers.InternalSerialNumber = "SerialNumber";

    documents.Lines.BatchNumbers.BatchNumber = "SerialNumber";



    int resp=documents.Add();

    if(resp != 0)


    Console.WriteLine("ErrorCode:" + oCompany.GetLastErrorCode());

    Console.WriteLine("Description:" + oCompany.GetLastErrorDescription());



    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.